-
Notifications
You must be signed in to change notification settings - Fork 7
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
Validate month fix #21
Conversation
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.
Thanks for looking at this! I agree there is a problem, and the problem is that there are differing days per month. But history file segments in months ARE supported and somewhat common.
A better solution would be to compare the months. So get the months for the big chunk and small chunk and then do the modulo. You can get the years with duration.years
and months with duration.years * 12 + duration.months
.
Does that make sense?
duration = parse.DurationParser().parse('P1M')
duration
<metomi.isodatetime.data.Duration: P1M>
duration.years
0
duration.months
1
duration = parse.DurationParser().parse('P1M')
duration.months
1
duration = parse.DurationParser().parse('P1Y')
duration.months
0
duration.years
1
big_chunk and small_chunk are now broken into months before division.
I have implemented changes based on this. Does this now look good to you? |
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.
Looks good, but the variable names still have "days" in them. Can you update for our future selves?
changed days to months in variable names
This is definitely ready, @kiihne-noaa , so I'm going to click "ready for review" and merge it. |
Added two lines that cause validate step to return a more detailed error message when Months used as time step in yaml file. This message states that month chunks are not implemented yet.