You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
At the moment, the hydrology model tracks daily values for variables within a time step by appending daily arrays to a list and then using np.stack to combine them at the end to get statistics across the time step.
Since the number of days is known (and will always be known?), this can be done by declaring a days x grid cell numpy array and inserting daily rows. If the code below is a fair comparison of the two approaches then this is faster and cleaner. I have to admit I was expecting it to be more faster, but it is faster and the advantage greater as the number of cells increases.
Is your feature request related to a problem? Please describe.
At the moment, the hydrology model tracks daily values for variables within a time step by appending daily arrays to a list and then using
np.stack
to combine them at the end to get statistics across the time step.virtual_ecosystem/virtual_ecosystem/models/hydrology/hydrology_model.py
Lines 390 to 408 in 6812907
Since the number of days is known (and will always be known?), this can be done by declaring a days x grid cell numpy array and inserting daily rows. If the code below is a fair comparison of the two approaches then this is faster and cleaner. I have to admit I was expecting it to be more faster, but it is faster and the advantage greater as the number of cells increases.
Describe the solution you'd like
Switch to matrix insertion, I think.
The text was updated successfully, but these errors were encountered: