NOAA-GFDL / fre-workflows

Code to generate, describe, validate, and configure scientific workflows within the FRE software framework
2 stars 3 forks source link

Validate month fix #21

Closed kiihne-noaa closed 1 week ago

kiihne-noaa commented 2 weeks ago

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.

kiihne-noaa commented 2 weeks ago

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

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

I have implemented changes based on this. Does this now look good to you?

ceblanton commented 1 week ago

This is definitely ready, @kiihne-noaa , so I'm going to click "ready for review" and merge it.