Standard class for time *period*?
Cameron Simpson
cs at cskk.id.au
Wed Mar 29 20:13:09 EDT 2023
On 30Mar2023 10:13, Cameron Simpson <cs at cskk.id.au> wrote:
>I do in fact have a `TimePartition` in my timeseries module; it
>presently doesn't do comparisons because I'm not comparing them - I'm
>just using them as slices into the timeseries data on the whole.
>
>https://github.com/cameron-simpson/css/blob/0ade6d191833b87cab8826d7ecaee4d114992c45/lib/python/cs/timeseries.py#L2163
On review it isn't a great match for a simple time range; it's aimed at
expressing the time ranges into which my time series data files are
broken up.
I think most of the code using this particular class just starts with a
`start_unixtime` and `end_unixtime` and indexes whichever timeseries
it's using, and these come into play internally to access the relevant
files. There are a bunch of methods to take a pair of start/stop
unixtimes and return time slot indices etc.
So even I don't have a purely time period class, right now anyway;
passing around a pair of floats is so simple that I probably haven't
elaborated on it. Just made ways to make that pair from what I'm given.
Cheers,
Cameron Simpson <cs at cskk.id.au>
More information about the Python-list
mailing list