perf: Vectorize index clamping in Dataset.expand_index_in_trial#300
perf: Vectorize index clamping in Dataset.expand_index_in_trial#300SimpingOjou wants to merge 2 commits into
Conversation
|
Thank you for your contribution. We require contributors to sign our Contributor License Agreement (CLA). We do not have a signed CLA on file for you. In order for us to review and merge your code, please sign our CLA here. After you signed, you can comment on this PR with |
|
@cla-bot check |
|
Thanks for tagging me. I looked for a signed form under your signature again, and updated the status on this PR. If the check was successful, no further action is needed. If the check was unsuccessful, please see the instructions in my first comment. |
stes
left a comment
There was a problem hiding this comment.
Hi @SimpingOjou , thanks a lot for your contribution!
This looks good. Could you add a new test case, where you copy-paste the old implementation of the function to the tests as a backup, and then ensure that the results of the two implementations are the same?
Co-authored-by: Steffen Schneider <steffen@bethgelab.org>
This PR addresses the TODOs in expand_index_in_trial regarding potential speed improvements. The previous implementation utilized a Python list comprehension to iterate over index and calculate boundaries, which created a bottleneck during execution.
Changes