#12 poppy no longer works with datetime inputs

open-works-for-me
None
3
2013-04-18
2011-06-02
No

Tracker: Bug Reports
Title: poppy no longer works with datetime inputs
Description:

As evidenced by the documentation, it used to also work with datetime objects for the times and timedeltas for the lags,
halfwindow.

That may still be the case if it doesn't drop to the C, but it definitely doesn't work on my install (which I believe is
using the C because it's blazing fast). Rather than change the docs, or have possible inconsistent behaviour depending
on whether libSpacepy works, this shoudl be fixed to give the original behaviour.

I'll prob get around to looking at this sometime, but I flagged JN for this bug since it was his rewrite.

Submitted By: Steven K. Morley - (FN)
Submitted On: 03/04/2011 18:06 MST
Last Modified: 03/07/2011 11:10 MST

Comments
Quote in Comment
#4 – Jonathan T. Niehof: 03/07/2011 11:10 MST
Comment:

Nice suggestion, Brian. It might not handle everything but it's at least a reasonable first hack.

Action: Update
Quote in Comment
#3 – Brian A. Larsen: 03/07/2011 11:06 MST
Comment:

One decent option is the matplotlib date2num
(http://matplotlib.sourceforge.net/api/dates_api.html#matplotlib.dates.date2num)

It is built in and used across all of matplotlib. It adds a requirement but poppy has a plot method that already
requires this anyway.

Action: Update
Quote in Comment
#2 – Jonathan T. Niehof: 03/07/2011 09:13 MST
Comment:

This is on my todo list. C only handles doubles, so anything else passed in would need to be converted, probably to "
seconds since start of series 1" or the like. I'm afraid the C won't be able to recover the original behaviour of "works
with anything that can compare and subtract" since I don't see a way around special-case code, but I'll try. Worst-case
it should fall back to Python.

Action: Update
Priority changed from 3 to 2

Discussion

  • Brian Larsen

    Brian Larsen - 2011-06-02

    This is form LANL teamforge

     
  • Steve Morley

    Steve Morley - 2013-04-18

    Assignment changed to Jon.
    I've added some type-checking and conversion from datetimes and timedeltas to fractional days. The current tests pass, and I added a new, rather amateur, test for datetime usage.

    Status set to "Works for me" as there seems to be a (new?) issue with PoPPy, related to the calculation of percentiles after dropping to the C (below). However, I don't think this means the code isn't working. It seems to be a Python 2.7 issue only.

    /usr/lib/pymodules/python2.7/matplotlib/mlab.py:925: RuntimeWarning: Item size computed from the PEP 3118 buffer format string does not match the actual item size.
    values = np.array(x).ravel() # copy
    /usr/lib/python2.7/dist-packages/numpy/core/fromnumeric.py:807: RuntimeWarning: Item size computed from the PEP 3118 buffer format string does not match the actual item size.
    return searchsorted(v, side)

     
  • Steve Morley

    Steve Morley - 2013-04-18
    • assigned_to: stevemorley --> jnlanl
    • priority: 5 --> 3
    • status: open --> open-works-for-me
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks