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

Improve partition #504

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open

Improve partition #504

wants to merge 39 commits into from

Conversation

juliettelavoie
Copy link
Contributor

@juliettelavoie juliettelavoie commented Jan 7, 2025

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
    • This PR fixes #xyz
  • (If applicable) Documentation has been added / updated (for bug fixes / features).
  • (If applicable) Tests have been added.
  • This PR does not seem to break the templates.
  • CHANGELOG.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?

Does this PR introduce a breaking change?

yes, I removed the indicator_kw argument. I realized it was too heavy to do everything in one shot.

Other information:

Developped for "On the importance of the reference data: Uncertainty partitioning of bias-adjusted climate simulations over Quebec" by Lavoie et al. (submitted in 2024) (presented at the last jamboree)
Code for the paper here: https://github.com/Ouranosinc/partition

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@@ -47,11 +47,10 @@ def test_basic_train(self, var, period):

def test_preprocess(self):

dref360 = self.dref.convert_calendar("360_day", align_on="year")

dhist360 = self.dhist.convert_calendar("360_day", align_on="year")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test failed because ref had s 720 and sim a 730 shape, but actually it should have always failed. The function assumes that the simulation will always always a smaller or equal calendar to the ref ( ref don't have 360 day cal).
In the previous version, we were "converting" the 360 day cal of the ref to noleap, but the function doesn't add values if you don't specify it ( which we don't because we assume that we are always only removing dates). Hence, it stays 720 long and fails.

In this version, sim is 360 and ref is convert to 360 as well. Both are 720 long

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but I am now noticing that there is another issue with adpat_freq

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem was in xclim : https://github.com/Ouranosinc/xclim/pull/2038/files

I removed the test temporarily.

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