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

unstack horizon #203

Merged
merged 6 commits into from
Jun 1, 2023
Merged

unstack horizon #203

merged 6 commits into from
Jun 1, 2023

Conversation

juliettelavoie
Copy link
Contributor

@juliettelavoie juliettelavoie commented May 23, 2023

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
  • (If applicable) Documentation has been added / updated (for bug fixes / features)
  • This PR does not seem to break the templates.
  • HISTORY.rst has been updated (with summary of main changes)
    • Link to issue (:issue:number) and pull request (:pull:number) has been added

What kind of change does this PR introduce?

  • new_coords['horizon'] was still the length of the original time dimension. I guess before xarray was able to make it fit with the new time dimension, but it doesn't seem to work anymore. I manually unstackhorizon similarly to the variables.
  • Also dropped coords in climatological_mean to address a future warning (FutureWarning: Updating MultiIndexed coordinate 'time' would corrupt indices for other variables: ['year', 'month', 'day']. This will raise an error in the future. Use .drop_vars({'month', 'year', 'time', 'day'})before assigning new coordinate values.)

Does this PR introduce a breaking change?

no

Other information:

@juliettelavoie juliettelavoie requested a review from RondeauG May 26, 2023 14:03
Copy link
Collaborator

@RondeauG RondeauG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@@ -150,6 +150,7 @@ def climatological_mean(
]
else:
raise ValueError("The type of 'time' could not be understood.")
ds_rolling = ds_rolling.drop_vars({"month", "year", "time", "day"})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this is to resolve the warning that keeps popping up ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exact

@juliettelavoie juliettelavoie merged commit 2f9a62d into main Jun 1, 2023
@juliettelavoie juliettelavoie deleted the fix-202 branch June 1, 2023 15:46
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.

"new" xarray breaks produce_horizon
2 participants