Skip to content

Conversation

jperez999
Copy link
Collaborator

This PR substitutes the loop creating the range of individual indices for each value to be added to the padded array with a map function in order to make it faster. This PR also adds a check to ensure that the padding size selected by user fits the data. If the data has any records that are bigger than the padding size, we raise a value error. This op is for padding only, it does not incorporate list slice.

@jperez999 jperez999 added the enhancement New feature or request label May 11, 2023
@jperez999 jperez999 self-assigned this May 11, 2023
row_ranges.extend(array_lib.arange(int(starts[idx]), int(ends[idx])))
row_ranges = array_lib.concatenate(
list(map(functools.partial(get_arange, array_lib), starts, ends))
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very slick 😎

@karlhigley karlhigley added this to the Merlin 23.05 milestone May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants