setTimeInterval()

Signature:

set_interval(
    value: Union[hec.Interval, str, int],
    in_place: bool = False
) -> TimeSeries

Detailed Documentation

The hec-python-library equivalent of Jython method setTimeInterval():

If in_place=True, the instance itself is modified. In this case the returned value (which can be ignored in python) is the modified instance, which can be used in chaining methods.

Example:

from hec import Interval

ts2 = ts1.set_interval(
    Interval.get_any_cwms(lambda i: i.minutes==60 and i.is_psueudo_regular)
)

ts4 = ts3.set_interval("1Hour")

ts6 = ts5.set_interval(60)

Signature:

iset_interval(value: Union[hec.Interval, str, int]) -> TimeSeries

Convenience method for calling setTimeInterval(...) with in_place=True.

Example:

from hec import Interval

ts1.iset_interval(
    Interval.get_any_cwms(
        lambda i: i.minutes==60 and i.is_psueudo_regular
    )
)

ts2.iset_interval("1Hour")

ts3.iset_interval(60)