The definition of time steps in PyFerret Python is very clunky - using a six int tuple for year/month/day/hour/minute/second (and not in that order). The calendar is passed as the 'unit' - very much a hack. Instead it should use a object with named attributes, and either make seconds floating point or add a nanoseconds field to resolve issues with precision. Include a calendar and modulo attribute. The object doesn't need to do anything special.
While the standard Python time and datetime modules look appealing at first, they are very much oriented to actual recent dates; years must be positive, modulo time and alternate calendars not supported.
The definition of time steps in PyFerret Python is very clunky - using a six int tuple for year/month/day/hour/minute/second (and not in that order). The calendar is passed as the 'unit' - very much a hack. Instead it should use a object with named attributes, and either make seconds floating point or add a nanoseconds field to resolve issues with precision. Include a calendar and modulo attribute. The object doesn't need to do anything special.
While the standard Python time and datetime modules look appealing at first, they are very much oriented to actual recent dates; years must be positive, modulo time and alternate calendars not supported.