pacificclimate / climpyrical

A Python tool for constraining and manipulating CanRCM4 climate models.
GNU General Public License v3.0
1 stars 0 forks source link

Pytest warning handling #16

Closed nannau closed 5 years ago

nannau commented 5 years ago

I've discovered that a few of my checks in my check functions are a bit too harsh, and that I need to soften their requirements. This will allow a more flexible use of a few functions (specifically, find_nearest_index ).

One such change on this PR is to raise a warning using pytest instead of an exception. In this particular case, there are stations outside of the CanRCM4 model grid space, causing an error to be risen in my check functions. I don't want this to raise an error since this is a probable scenario - especially in northern stations, so instead, I want to raise a UserWarning with a similar message.

nannau commented 5 years ago

I purposely favour a strict enforcement of "Canada-only" grid cells. I do see the value in making this more flexible, and adding a CanRCM4 test model to load the numbers from the grid input is straight forward.

I think that probably belongs in a separate PR. Would you agree?

jameshiebert commented 5 years ago

Yeah, a separate PR would be fine.