Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in array_handling.stack_by_init_date #5

Merged
merged 8 commits into from
Nov 30, 2021

Conversation

dougiesquire
Copy link
Collaborator

This PR tries to fix a few bugs in array_handling.stack_by_init_date function. I have also changed the API of the function in the following ways:

  • remove the freq parameter,
  • expect that the time dimension of ds has the same dtype as init_dates. I think this is cleaner than requiring that init_dates is an array of strings,
  • Add optional parameters for the names of the time, initial date and lead time dimensions.

I trialled adding a catch to use the stride option in .rolling.contruct when the initial dates are evenly spaced along the time dimension, but this ended up being overly complicated and didn't really add any performance benefits.

I've added some basic tests of the new function and added pytest to environment.yml so that these tests can be run.

Closes #4

@DamienIrving DamienIrving merged commit d048e65 into AusClimateService:master Nov 30, 2021
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.

Bug in array_handling.stack_by_init_date
2 participants