-
Notifications
You must be signed in to change notification settings - Fork 56
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
add custom season method #411
Conversation
I have the values matching up, and am still wrestling with the Xarray dimension(?) name where it says SON instead of season. (it says dimensions are (`SON1,) but when I go to rename the dimension it says SON isn't a dimension so idk) Also I'm not sure if we want to add a pandas season index/ if that means something specific to the typical seasons (will research this). And one issue is that in order to get this values. I have to comment out this block of code borrowed from
or else that values are off in DJF. I need to look at this math more and know if this is right to not implement (as in are we doing it correctly in the non-custom season version). Any thoughts on that @anissa111 I want to answer these questions and solve the dimension thing before I add tests, so I know whether to say identical objects or identical values and dimensions. |
…/geocat-comp into custom_season_climatology
Didn't expect this to fail tests in test_climate_anomaly as well as test_climate_average. Will look into this tomorrow hopefully. |
@jukent I'm not sure I know enough about that to have any valuable thoughts right now. I think it could make sense that the two implementations are different enough that this version wouldn't need that block, but I'd want to understand the underlying reason why, does that make sense? |
Yeah that makes sense. I think when we want winter from one year, we have to deal with it being over the year break. But when we want winter from all years, it doesn't matter if January is in this winter or the next. Like the grouping of December 22 of January 23 together. There is still the very first and very last year that could be affected? And that causes the small discrepancy. My hunch is that since we're going through months first it isn't needed or wanted but I'll lay it out better tomorrow. |
Related to #313 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit concerned with the logic flow as written as mentioned in a few of my comments below for a few reasons, some of which predate this PR
- I am a little uncozy with the logic structure of
if <this setting>:
do all analysis
return
if <next setting>:
do all analysis
return
- This introduces some edge cases such as what happens if the user specifies custom seasons, but a frequency of anything other than 'season'
- Apart from the general uncozy mentioned in (1), I think we could be making better use of the
custom_seasons
optional argument here. What if we used a default ofcustom_seasons = ['DJF', 'MAM', 'JJA', 'SON']
and then performed the calculation for seasons in the same way instead of separating the season calculation into a "custom" or "default" section? I would think, ideally, the same calculations for custom season should also work for the standard, correct? - Seeing the code in this PR, I'm again not totally sure why you've changed some of the inputs to kwargs instead of just arguments.
Anyway, sorry for the late review, let me know if you'd like a dedicated time for me to explain some of my questions/thinking on suggestions!
I'll address your other points and make some edits on Monday. |
…m_season_climatology
Passing local tests! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly just comments from this morning's meeting. I did manage to write something that might be a little more readable for that one section I said I'd take a stab at.
Co-authored-by: Anissa Zacharias <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be good to go when the tests finish! Good job!!
PR Summary
Adds custom season list as kwarg for
climatology_average
Closes #198
PR Checklist
General
closes #XXX
to the PR description where XXX is the number of the issue.docs/release-notes.rst
@NCAR/geocat
for reviewsprecommit
. To set up on your local, runpre-commit install
from the top level of the repository. To manually run pre-commits, usepre-commit run --all-files
and re-add any changed files before committing again and pushing.Functionality
src/geocat/comp/__init__.py
fileTesting
Documentation
_
) and have been added todocs/internal_api/index.rst
docs/user_api/index.rst
under their module