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 bad references #178

Merged

Conversation

emileten
Copy link
Contributor

@emileten emileten commented Feb 14, 2022

This fixes a few object reference mistakes in dodola.core.standardize_gcm, that were causing ClimateImpactLab/downscaleCMIP6#439 but could have been in general more problematic.

In the beginning of the function, a new transformed dataset object named ds_cleaned is created out of ds, but in subsequent calls, there are remaining references to ds where we should reference the transformed object instead.

This fix mechanically solves /ClimateImpactLab/downscaleCMIP6/issues/439 (which I verified in this workflow : https://argo.cildc6.org/archived-workflows/default/6da813ba-47ba-45a0-95d8-36444e2bcf7b), because we actually drop the time bounds in ds_cleaned, which were causing the issue.

@emileten emileten requested a review from brews February 14, 2022 04:37
Copy link
Member

@brews brews left a comment

Choose a reason for hiding this comment

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

Nice fix, @emileten! This looks good to go. 👍

@brews
Copy link
Member

brews commented Feb 14, 2022

I'm a little suprised that unit testing did catch this. Do we actually have a test checking that calendars get converted in standardize_gcm? This might be something to come back to later, as it sounds like an important behavior.

@emileten
Copy link
Contributor Author

@brews, you mean that you're surprised it did not catch it, right ?

I don't fully understand your comment : we do have unit tests for calendar conversion. The 'error' I am fixing here wasn't as consequential as you might think, the calendar was still getting converted. Bad referencing meant that one step at the beginning of the code (where, among other things, we drop time_bnds) was not being taken in account. Since that step isn't 'key', things were in general working.

@brews
Copy link
Member

brews commented Feb 14, 2022

@emileten Yeah, I was expecting a larger impact from the bug but I guess you're right. Thanks for the clarification.

@emileten emileten merged commit 6959c17 into ClimateImpactLab:main Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants