interval arithmetic libraries

S

srepmub

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)
 
P

pruebauno

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...ed9d05d11d0/56684b795fc527cc#56684b795fc527cc

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top