foundryts.Interval

class foundryts.Interval(start=None, end=None, name=None, metadata=None)

An interval defined by start and end time.

Intervals are useful for splitting time series in a NodeCollection to time ranges for each interval or for representing results of FoundryTS interval functions such as foundryts.functions.time_series_search().

Intervals can hold optional metadata.

  • Parameters:
    • start (int | datetime | str , optional) – The start timestamp (inclusive) of the interval (default is pandas..Timestamp.min).
    • end (int | datetime | str , optional) – The end timestamp (exclusive) of the interval (default is pandas..Timestamp.min).
    • name (int | datetime | str , optional) – Optional name for the interval (default is None).
    • metadata (Dict [str , Any ] , optional) – Optional metatadata dictionary for the interval (default is None).

Examples

Copied!
1 2 3 4 5 6 7 8 >>> from foundryts import Interval >>> interval = Interval(start='2018-01-01', end='2018-02-01', name='january', metadata={'days': 31}) >>> interval Interval(start='2018-01-01 00:00:00', end='2018-02-01 00:00:00', name='january', metadata={'days': 31}) >>> interval.name 'january' >>> interval.metadata['days'] 31

property end

End time as codex_core.Timestamp.

property end_codex

Copy of Interval.end() which will be migrated to return Python native, non-codex Conjure types in the future.

property end_native

End time as int | datetime | str

property end_ns

End time in nanoseconds.

property metadata

Return metadata dictionary.

property name

Name of the interval.

property start

Start time as codex_core.Timestamp.

property start_codex

Copy of Interval.start() which will be migrated to return Python native, non-codex Conjure types in the future.

property start_native

Start time as int | datetime | str

property start_ns

Start time in nanoseconds.