NOAA-GSL / ExascaleWorkflowSandbox

Other
2 stars 2 forks source link

Leadtime utility functions renamed and unit tests added. #94

Closed NaureenBharwaniNOAA closed 4 months ago

NaureenBharwaniNOAA commented 4 months ago

The leadtime.fcst_to_seconds and leadtime.seconds_to_fcst utility functions should be renamed to better reflect what they do.

leadtime.fcst_to_seconds should be renamed to leadtime.leadtime_to_seconds. leadtime.seconds_to_fcst should be renamed to leadtime.seconds_to_leadtime.

Added unit tests to the utility functions to ensure they work correctly. The tests cover the following scenarios:

"PT0S" <---> 0 "PT1M" <---> 60 "PT1H" <---> 3600 "PT1H30M" <---> 5400 "P1D" <---> 86400 "P1DT1H" <---> 90000 "P1DT1H30M" <---> 91800 "MT0S" <---> 0 "MT1M" <---> -60 "MT1H" <---> -3600 "MT1H30M" <--> -5400 "M1D" <---> -86400 "M1DT1H" <---> -90000 "M1DT1H30M"<---> -91800

closes #86