PERF: Speed up create_input when dates are already np.datetime64#87
Merged
greglucas merged 1 commit intoSWxTREC:mainfrom Jul 9, 2025
Merged
Conversation
greglucas
reviewed
Jul 8, 2025
Contributor
Author
|
Not sure why ruff is complaining |
Member
It wants it all on one line I think now that it is shortened. Can you run |
86c8ef4 to
2bb1800
Compare
Contributor
Author
|
Good to go! |
Member
|
:( now mypy doesn't like the updates. Sorry about all this hassle... I had a hard time satisfying the type checker going through that portion previously too, maybe we should just disable it for some of those variables/sections? |
Simplify line of code formatting ruff
2bb1800 to
2c71869
Compare
Contributor
Author
|
Ok hopefully that does it... |
greglucas
approved these changes
Jul 9, 2025
Member
|
Thanks @scottshambaugh! Also I was checking some other timings and found some compiler optimization improvements you might be interested in here: #84 |
Contributor
Author
|
Oh cool! I'm not on windows so can't play around with those build options. Will keep my eye open for the next release that incorporates all this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In my workflow, about 65% of the pymsis runtime is spent in manipulating the python inputs rather than running the core code. This small change avoids some array creations and speeds up overall runtime by about 25% for me!
Before:

After:
