google-code-export / stoqs

Automatically exported from code.google.com/p/stoqs
GNU General Public License v3.0
1 stars 1 forks source link

Apply diffs to coards.py module to accept more ways to represent time #56

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is needed for loading data sets from OceanSITES that are not 100% COARDS 
compliant but that may have Time Units that are CF compliant. The diff looks 
something like:

diff __init__.py.orig __init__.py
109a110,115
>     Parse a CF (ISO-8601) compliant data - ignore case::
>         >>> parse(0, "DAYS since 1950-01-01T00:00:00Z")
>         datetime.datetime(1950, 1, 1, 0, 0)
>         >>> parse(7, "days since 1950-01-01t00:00:00z")
>         datetime.datetime(1950, 1, 8, 0, 0)
> 
166,169c172,175
<     udunits = [(SECOND,             ['second', 'seconds', 'sec', 's', 
'secs']),
<                (MINUTE,             ['minute', 'minutes', 'min']),
<                (HOUR,               ['hour', 'hours', 'hr', 'h']),
<                (DAY,                ['day', 'days', 'd']),

---
>     udunits = [(SECOND,             ['second', 'seconds', 'sec', 's', 'secs', 
'SECOND', 'SECONDS', 'SEC', 'S', 'SECS']),
>                (MINUTE,             ['minute', 'minutes', 'min', 'MINUTE', 
'MINUTES', 'MIN']),
>                (HOUR,               ['hour', 'hours', 'hr', 'h', 'HOUR', 
'HOURS', 'HR', 'H']),
>                (DAY,                ['day', 'days', 'd', 'DAY', 'DAYS', 'D']),
213c219
<                             (?:\s|T)                #

---
>                             (?:\s|T|t)              #
227c233
<                                 \s?                 #

---
>                                 \s*                 #       space or no space
235c241
<                                 (?:UTC)|(?:Z))      #           UTC | Z

---
>    

Original issue reported on code.google.com by MBARIm...@gmail.com on 22 Dec 2014 at 6:06