NOAA-GFDL / fre-workflows

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

Validate month fix #21

Closed kiihne-noaa closed 2 months ago

kiihne-noaa commented 3 months 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 3 months 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 2 months ago

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