Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#45 ticktock time system a function

for 0.11
closed
Steve Morley
None
5
2013-11-05
2013-08-16
Brian Larsen
No

As was discussed today, adding in the capability for a Ticktock object to be created using an arbitrary function would be great.

The interface could look like this:
spt.Ticktock(['20130101', '20130304'], dateutil.parser.parse)
spt.Ticktock(['20130101', '20130304'], lambda x: datetime.datetime.strptime('%y%m%d', x))

Discussion

  • Steve Morley
    Steve Morley
    2013-11-05

    • status: open --> closed
     
  • Steve Morley
    Steve Morley
    2013-11-05

    Feature added and docstring updated.

    y = Ticktock(['01-01-2013', '20-03-2013'], lambda x: datetime.datetime.strptime(x, '%d-%m-%Y'))
    y.UTC
    dmarray([2013-01-01 00:00:00, 2013-03-20 00:00:00], dtype=object)
    y.DOY # Day of year
    dmarray([ 1., 79.])