interval arithmetic libraries

pruebauno at latinmail.com pruebauno at latinmail.com
Mon Jun 8 10:00:08 EDT 2009


On Jun 6, 8:15 am, srepmub <mark.duf... at gmail.com> wrote:
> Hi all,
>
> I'm looking for libraries that allow one to calculate with sets of
> (date) intervals. So for example, I'd like to be able to calculate the
> overlap between two sets of intervals, the union etc. Preferrably,
> this works with datetime objects, is written in pure Python, and has
> reasonably good (algorithmic) performance. The neatest library I've
> found so far is this one:
>
> http://members.cox.net/apoco/interval/
>
> From an API standpoint, it looks rather nice, but the performance
> could be better (for example, calculating an overlap now involves
> looping quadratically over both interval sets), and it doesn't work
> fully with datetime objects (Inf doesn't work).
>
> Thanks for any pointers,
> Mark Dufour.
> (author of Shedskin, an experimental (restricted-)Python-to-C++
> compiler,http://shedskin.googlecode.com)

For some pointers look at this thread where I posted a similar
question:

http://groups.google.com/group/comp.lang.python/browse_frm/thread/1a1d2ed9d05d11d0/56684b795fc527cc#56684b795fc527cc

I am surprised that libraries to do that are not more common. I guess
everybody rolls his own.



More information about the Python-list mailing list