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

floor and ceiling for DTR #163

Merged
merged 7 commits into from
Dec 28, 2021
Merged

floor and ceiling for DTR #163

merged 7 commits into from
Dec 28, 2021

Conversation

emileten
Copy link
Contributor

@emileten emileten commented Dec 23, 2021

  • helps closing (but does not close) :

  • #468, #470, #472, #473, #474, #475, #476, #477, #481 from https://github.com/ClimateImpactLab/downscaleCMIP6/issues

  • tests added / passed

  • docs reflect changes

  • entry in CHANGELOG.md

  • rename the DTR correction core function to 'floor...'

  • added an equivalent one for a ceiling only applied to [-60, 60]. Default ceiling is 70.

  • merged these two functionalities in one service renamed to correct_dtr

  • added tests for the latter

  • accordingly modified click

  • changed < to <= in the DTR range validation

This means our DTR 'validation' looses its meaning from when the DTR correction is applied on. It's a quick-and-dirty fix.

@dgergel this is just applying a cap at 70. This follows what I saw in the data (data points away from 60th north parallel but with a value significantly larger than 70) and me realizing (1) that 60th north parallel already crosses a significant european population area and (2) 70 diff in kelvin is already quite extreme

…orrection service with the ceiling functionality and tests
@emileten emileten requested review from brews and dgergel December 23, 2021 14:39
@brews brews added the enhancement New feature or request label Dec 23, 2021
@brews
Copy link
Member

brews commented Dec 23, 2021

So we can keep track of it, can someone list out the downscaleCMIP6 issues this is related to? This will create links and it will be easier to keep track of what needs to be rerun.

I see ClimateImpactLab/downscaleCMIP6#476. What else?

Edit:
Also, I'd be careful because this doesn't fully close the issues upstream in downscaleCMIP6. This is an upgrade we need, but we won't actually close it until we upgrade the Argo Workflows and container images in downscaleCMIP6 to take advantage of these new dodola features, @emileten.

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.

@emileten I think this looks good. I have two quick comments/suggestions on expanding documentation. Aside from these, I think we can merge this and take things for a run. Thanks!

dodola/services.py Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
@brews
Copy link
Member

brews commented Dec 23, 2021

I took a look at this with a programmer's eye. @dgergel, I'd appreciate it if you could review this and double-check the method actually does what you want/described.

Copy link
Member

@dgergel dgergel left a comment

Choose a reason for hiding this comment

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

@emileten this looks really good. Nice work!

My one suggestion for change - which should be really quick - is adding a correction_type argument to the CLI with options ceiling, floor or both (or something like that). Even though we're using dodola core functions in our workflow, since we're applying the ceiling and floor functionality at different points in the workflow, I think it'd be nice to have the option to only apply one here and have that be a service.

dodola/cli.py Outdated Show resolved Hide resolved
dodola/services.py Outdated Show resolved Hide resolved
@emileten
Copy link
Contributor Author

@dgergel @brews I addressed all your concerns and following our conversation, structurally modified things a bit.

floor and ceiling are two separate functions, in services and cli as well. That keeps things clean and there is no step when we're doing both.

@brews I am modifying the header of this to include all related issues.

Copy link
Member

@dgergel dgergel left a comment

Choose a reason for hiding this comment

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

LGTM!

@emileten emileten requested a review from brews December 28, 2021 00:29
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.

@emileten Technically, I think this revision is fine (good, fast turn-around on this!). The changelog and PR description are a bit terse, but that's a minor comment given the deadline you're under for this.

@brews
Copy link
Member

brews commented Dec 28, 2021

@emileten BTW, I think you can merge this whenever you're ready!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants