NOAA-PMEL / PyFerret

The PyFerret program and Python module from NOAA/PMEL
https://ferret.pmel.noaa.gov/Ferret/
The Unlicense
59 stars 22 forks source link

Improve the time definitions in PyFerret (Trac #2420) #17

Open karlmsmith opened 8 years ago

karlmsmith commented 8 years ago

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.