Skip to content

iss #408 speed up shear time of day#526

Open
rm-mol wants to merge 1 commit intodevfrom
iss408-shear-speedup
Open

iss #408 speed up shear time of day#526
rm-mol wants to merge 1 commit intodevfrom
iss408-shear-speedup

Conversation

@rm-mol
Copy link
Copy Markdown
Collaborator

@rm-mol rm-mol commented Aug 30, 2025

Linked to #408

I noticed the TimeOfDay shear method was especially slow when running .apply() - which I guess is the reason why you used FloatProgress in the code.

I propose here a slight change of logic: instead of looping through all months and hour, which is computationally "costly", we append instead a column to the wind speed with the correct alpha for the hour/month, and we use vector operation to calculate the sheared column. Similar to the time series shear I guess.
But this could be done more elegantly I suppose, I probably don't use all the most optimal way to do it.

Using the demo data the .apply() method now takes under a second compared to around 20s for the current code.

All the test_shear passed locally.

@rm-mol rm-mol requested a review from stephenholleran August 30, 2025 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant