hec.interval

Provides standard time intervals

class IntervalException(hec.timespan.TimeSpanException):

Exception specific to Interval operations

class Interval(hec.timespan.TimeSpan):

Class to hold information about time series recurrence intervals.

Intervals are a restriction of the TimeSpan base class that also hold extra information.

  • Restriction: At most one of years, months, days, hours, and minutes can be non-zero, and seconds must be zero.
  • Extension:
    • Each interval has a name that may be context specific.
    • Each also has a specified number of minutes:
      • For non-calendar-based intervals, the minutes are the actual number of minutes in the interval
      • For calendar-based intervals, the minutes are a characteristic number based on standard calendar items:
        • Tri-Month: minutes = 10 * 1440 = 14400
        • Semi-Month: minutes = 15 * 1440 = 21600
        • 1 Month: minutes = 30 * 1440 = 43200
        • 1 Year: minutes = 365 * 1440 = 525600
        • 1 Decade: minutes = 365 * 1440 * 10 = 5256000
        • 1 Century: minutes = 365 * 1440 * 100 = 52560000

Intervals should not need to be created by the user, as intervals for the following three contexts are created during initialization of the interval module:

  • CWMS Context: Contains Intervals used with CWMS
  • DSS Context: Contains Intervals used with HEC-DSS files
  • DSS Block Size Context: Contains Intervals for the record block sizes in HEC-DSS files

Each context has its own set of four static methods that retrieve Interval objects or their names:

  • get_anyContext()
  • get_anyContext_name()
  • get_allContext()
  • get_allContext_names()

Where Context is Cwms, Dss, or DssBlock.

There are similar static methods that retrieve Interval objects or their names from all contexts:

Interval( timespan: str, name: str, context: str, minutes: Optional[int] = None)

Initializer used by module

MINUTES: dict[str, int] = {'0': 0, 'Irr': 0, '~1Minute': 0, '~2Minutes': 2, '~3Minutes': 3, '~4Minutes': 4, '~5Minutes': 5, '~6Minutes': 6, '~10Minutes': 10, '~12Minutes': 12, '~15Minutes': 15, '~20Minutes': 20, '~30Minutes': 30, '~1Hour': 0, '~2Hours': 120, '~3Hours': 180, '~4Hours': 240, '~6Hours': 360, '~8Hours': 480, '~12Hours': 720, '~1Day': 0, '~2Days': 2880, '~3Days': 4320, '~4Days': 5760, '~5Days': 7200, '~6Days': 8640, '~1Week': 0, '~1Month': 0, '~1Year': 0, '1Minute': 1, '2Minutes': 2, '3Minutes': 3, '4Minutes': 4, '5Minutes': 5, '6Minutes': 6, '10Minutes': 10, '12Minutes': 12, '15Minutes': 15, '20Minutes': 20, '30Minutes': 30, '1Hour': 60, '2Hours': 120, '3Hours': 180, '4Hours': 240, '6Hours': 360, '8Hours': 480, '12Hours': 720, '1Day': 1440, '2Days': 2880, '3Days': 4320, '4Days': 5760, '5Days': 7200, '6Days': 8640, '1Week': 10080, '1Month': 43200, '1Year': 525600, 'IR-Day': 0, 'IR-Month': 0, 'IR-Year': 0, 'IR-Decade': 0, 'IR-Century': 0, '~2Minute': 0, '~3Minute': 0, '~4Minute': 0, '~5Minute': 0, '~6Minute': 0, '~10Minute': 0, '~12Minute': 0, '~15Minute': 0, '~20Minute': 0, '~30Minute': 0, '~2Hour': 0, '~3Hour': 0, '~4Hour': 0, '~6Hour': 0, '~8Hour': 0, '~12Hour': 0, '~2Day': 0, '~3Day': 0, '~4Day': 0, '~5Day': 0, '~6Day': 0, '2Minute': 2, '3Minute': 3, '4Minute': 4, '5Minute': 5, '6Minute': 6, '10Minute': 10, '12Minute': 12, '15Minute': 15, '20Minute': 20, '30Minute': 30, '2Hour': 120, '3Hour': 180, '4Hour': 240, '6Hour': 360, '8Hour': 480, '12Hour': 720, '2Day': 2880, '3Day': 4320, '4Day': 5760, '5Day': 7200, '6Day': 8640, 'Tri-Month': 14400, 'Semi-Month': 21600, '1Decade': 5256000, '1Century': 52560000}

Dictionary that holds interval minutes, accessed by interval name. Includes all contexts.

Click to show contents.

NameMinutesContext(s)
00CWMS
Irr0CWMS
IR-Century0DSS
IR-Day0DSS
IR-Decade0DSS
IR-Month0DSS
IR-Year0DSS
1Minute1CWMS, DSS
2Minute2DSS
2Minutes2CWMS
3Minute3DSS
3Minutes3CWMS
4Minute4DSS
4Minutes4CWMS
5Minute5DSS
5Minutes5CWMS
6Minute6DSS
6Minutes6CWMS
10Minute10DSS
10Minutes10CWMS
12Minute12DSS
12Minutes12CWMS
15Minute15DSS
15Minutes15CWMS
20Minute20DSS
20Minutes20CWMS
30Minute30DSS
30Minutes30CWMS
1Hour60CWMS, DSS
2Hour120DSS
2Hours120CWMS
3Hour180DSS
3Hours180CWMS
4Hour240DSS
4Hours240CWMS
6Hour360DSS
6Hours360CWMS
8Hour480DSS
8Hours480CWMS
12Hour720DSS
12Hours720CWMS
1Day1440CWMS, DSS
2Day2880DSS
2Days2880CWMS
3Day4320DSS
3Days4320CWMS
4Day5760DSS
4Days5760CWMS
5Day7200DSS
5Days7200CWMS
6Day8640DSS
6Days8640CWMS
1Week10080CWMS, DSS
Tri-Month14400DSS
Semi-Month21600DSS
1Month43200CWMS, DSS, DSS BLOCK SIZE
1Year525600CWMS, DSS, DSS BLOCK SIZE
1Decade5256000DSS BLOCK SIZE
1Century52560000DSS BLOCK SIZE

context: str

The context of this object ("Cwms", "Dss", or "DssBlock")

Operations:

Read-only

@staticmethod
def get_all( matcher: Optional[Callable[[Interval], bool]] = None, exception_on_not_found: Optional[bool] = None) -> list[Interval]:

Retuns list of matched Interval objects in the any context

Arguments:
  • matcher (Optional[Callable[[Interval], bool]]): A function that returns True or False when passed an Interval object parameter. Defaults to None. If None, all Interval objects in all contexts are matched.
    Examples:
    • lambda i : i.is_irregular
    • lambda i : i.minutes < 60
    • lambda i : i.name.find("Week") != -1
Returns:

List[Interval]: A list of matched Interval objects (may be empty)

@staticmethod
def get_all_cwms( matcher: Optional[Callable[[Interval], bool]] = None, exception_on_not_found: Optional[bool] = None) -> list[Interval]:

Retuns list of matched Interval objects in the CWMS context

Arguments:
  • matcher (Optional[Callable[[Interval], bool]]): A function that returns True or False when passed an Interval object parameter. Defaults to None. If None, all Interval objects in the context are matched.
    Examples:
    • lambda i : i.is_irregular
    • lambda i : i.minutes < 60
    • lambda i : i.name.find("Week") != -1
  • exception_on_not_found (bool): Specifies whether to raise an exception if no Intervals are found. If None, the default behavior is used. Optional. Defaults to None. See set_default_exception_on_not_found and get_default_exception_on_not_found
Returns:

List[Interval]: A list of matched Interval objects (may be empty)

@staticmethod
def get_all_cwms_names( matcher: Optional[Callable[[Interval], bool]] = None, exception_on_not_found: Optional[bool] = None) -> list[str]:

Retuns list of names of matched Interval objects in the CWMS context

Arguments:
  • matcher (Optional[Callable[[Interval], bool]]): A function that returns True or False when passed an Interval object parameter. Defaults to None. If None, all Interval objects in the context are matched.
    Examples:
    • lambda i : i.is_irregular
    • lambda i : i.minutes < 60
    • lambda i : i.name.find("Week") != -1
  • exception_on_not_found (bool): Specifies whether to raise an exception if no Intervals are found. If None, the default behavior is used. Optional. Defaults to None. See set_default_exception_on_not_found and get_default_exception_on_not_found
Returns:

List[str]: A list of names of matched Interval objects (may be empty)

@staticmethod
def get_all_dss( matcher: Optional[Callable[[Interval], bool]] = None, exception_on_not_found: Optional[bool] = None) -> list[Interval]:

Retuns list of matched Interval objects in the DSS context

Arguments:
  • matcher (Optional[Callable[[Interval], bool]]): A function that returns True or False when passed an Interval object parameter. Defaults to None. If None, all Interval objects in the context are matched.
    Examples:
    • lambda i : i.is_irregular
    • lambda i : i.minutes < 60
    • lambda i : i.name.find("Week") != -1
  • exception_on_not_found (bool): Specifies whether to raise an exception if no Intervals are found. If None, the default behavior is used. Optional. Defaults to None. See set_default_exception_on_not_found and get_default_exception_on_not_found
Returns:

List[Interval]: A list of matched Interval objects (may be empty)

@staticmethod
def get_all_dss_block_names( matcher: Optional[Callable[[Interval], bool]] = None, exception_on_not_found: Optional[bool] = None) -> list[str]:

Retuns list of names of matched Interval objects in the DSS block size context

Arguments:
  • matcher (Optional[Callable[[Interval], bool]]): A function that returns True or False when passed an Interval object parameter. Defaults to None. If None, all Interval objects in the context are matched.
    Examples:
    • lambda i : i.is_irregular
    • lambda i : i.minutes < 60
    • lambda i : i.name.find("Week") != -1
  • exception_on_not_found (bool): Specifies whether to raise an exception if no Intervals are found. If None, the default behavior is used. Optional. Defaults to None. See set_default_exception_on_not_found and get_default_exception_on_not_found
Returns:

List[str]: A list of names of matched Interval objects (may be empty)

@staticmethod
def get_all_dss_blocks( matcher: Optional[Callable[[Interval], bool]] = None, exception_on_not_found: Optional[bool] = None) -> list[Interval]:

Retuns list of matched Interval objects in the DSS block size context

Arguments:
  • matcher (Optional[Callable[[Interval], bool]]): A function that returns True or False when passed an Interval object parameter. Defaults to None. If None, all Interval objects in the context are matched.
    Examples:
    • lambda i : i.is_irregular
    • lambda i : i.minutes < 60
    • lambda i : i.name.find("Week") != -1
  • exception_on_not_found (bool): Specifies whether to raise an exception if no Intervals are found. If None, the default behavior is used. Optional. Defaults to None. See set_default_exception_on_not_found and get_default_exception_on_not_found
Returns:

List[Interval]: A list of matched Interval objects (may be empty)

@staticmethod
def get_all_dss_names( matcher: Optional[Callable[[Interval], bool]] = None, exception_on_not_found: Optional[bool] = None) -> list[str]:

Retuns list of names of matched Interval objects in the DSS context

Arguments:
  • matcher (Optional[Callable[[Interval], bool]]): A function that returns True or False when passed an Interval object parameter. Defaults to None. If None, all Interval objects in the context are matched.
    Examples:
    • lambda i : i.is_irregular
    • lambda i : i.minutes < 60
    • lambda i : i.name.find("Week") != -1
  • exception_on_not_found (bool): Specifies whether to raise an exception if no Intervals are found. If None, the default behavior is used. Optional. Defaults to None. See set_default_exception_on_not_found and get_default_exception_on_not_found
Returns:

List[str]: A list of names of matched Interval objects (may be empty)

@staticmethod
def get_all_names( matcher: Optional[Callable[[Interval], bool]] = None, exception_on_not_found: Optional[bool] = None) -> list[str]:

Retuns list of names of matched Interval objects in the any context

Arguments:
  • matcher (Optional[Callable[[Interval], bool]]): A function that returns True or False when passed an Interval object parameter. Defaults to None. If None, all Interval objects in all contexts are matched.
    Examples:
    • lambda i : i.is_irregular
    • lambda i : i.minutes < 60
    • lambda i : i.name.find("Week") != -1
Returns:

List[str]: A list of names of matched Interval objects (may be empty)

@staticmethod
def get_any( matcher: Callable[[Interval], bool], exception_on_not_found: Optional[bool] = None) -> Optional[Interval]:

Retuns a matched Interval object in any context

Arguments:
  • matcher (Callable[[Interval], bool]): A function that returns True or False when passed an Interval object parameter.
    Examples:
    • lambda i : i.is_irregular
    • lambda i : i.minutes < 60
    • lambda i : i.name.find("Week") != -1
  • exception_on_not_found (bool): Specifies whether to raise an exception if no Intervals are found. If None, the default behavior is used. Optional. Defaults to None. See set_default_exception_on_not_found and get_default_exception_on_not_found
Returns:

Optional[Interval]: A matched Interval object or None

@staticmethod
def get_any_cwms( matcher: Callable[[Interval], bool], exception_on_not_found: Optional[bool] = None) -> Optional[Interval]:

Retuns a matched Interval object in the CWMS context, or None if there is no such object

Arguments:
  • matcher (Callable[[Interval], bool]): A function that returns True or False when passed an Interval object parameter.
    Examples:
    • lambda i : i.is_irregular
    • lambda i : i.minutes < 60
    • lambda i : i.name.find("Week") != -1
  • exception_on_not_found (bool): Specifies whether to raise an exception if no Intervals are found. If None, the default behavior is used. Optional. Defaults to None. See set_default_exception_no_not_found and get_default_exception_on_not_found
Returns:

Optional[Interval]: A matched Interval object or None

@staticmethod
def get_any_cwms_name( matcher: Callable[[Interval], bool], exception_on_not_found: Optional[bool] = None) -> Optional[str]:

Retuns the name of a matched Interval object in the CWMS context, or None if there is no such object

Arguments:
  • matcher (Callable[[Interval], bool]): A function that returns True or False when passed an Interval object parameter.
    Examples:
    • lambda i : i.is_irregular
    • lambda i : i.minutes < 60
    • lambda i : i.name.find("Week") != -1
  • exception_on_not_found (bool): Specifies whether to raise an exception if no Intervals are found. If None, the default behavior is used. Optional. Defaults to None. See set_default_exception_on_not_found and get_default_exception_on_not_found
Returns:

Optional[str]: The name of a matched Interval object or None

@staticmethod
def get_any_dss( matcher: Callable[[Interval], bool], exception_on_not_found: Optional[bool] = None) -> Optional[Interval]:

Retuns a matched Interval object in the DSS context, or None if there is no such object

Arguments:
  • matcher (Callable[[Interval], bool]): A function that returns True or False when passed an Interval object parameter.
    Examples:
    • lambda i : i.is_irregular
    • lambda i : i.minutes < 60
    • lambda i : i.name.find("Week") != -1
  • exception_on_not_found (bool): Specifies whether to raise an exception if no Intervals are found. If None, the default behavior is used. Optional. Defaults to None. See set_default_exception_on_not_found and get_default_exception_on_not_found
Returns:

Optional[Interval]: A matched Interval object or None

@staticmethod
def get_any_dss_block( matcher: Callable[[Interval], bool], exception_on_not_found: Optional[bool] = None) -> Optional[Interval]:

Retuns a matched Interval object in the DSS block size context, or None if there is no such object

Arguments:
  • matcher (Callable[[Interval], bool]): A function that returns True or False when passed an Interval object parameter.
    Examples:
    • lambda i : i.is_irregular
    • lambda i : i.minutes < 60
    • lambda i : i.name.find("Week") != -1
  • exception_on_not_found (bool): Specifies whether to raise an exception if no Intervals are found. If None, the default behavior is used. Optional. Defaults to None. See set_default_exception_on_not_found and get_default_exception_on_not_found
Returns:

Optional[Interval]: A matched Interval object or None

@staticmethod
def get_any_dss_block_name( matcher: Callable[[Interval], bool], exception_on_not_found: Optional[bool] = None) -> Optional[str]:

Retuns the name of a matched Interval object in the DSS block size context, or None if there is no such object

Arguments:
  • matcher (Callable[[Interval], bool]): A function that returns True or False when passed an Interval object parameter.
    Examples:
    • lambda i : i.is_irregular
    • lambda i : i.minutes < 60
    • lambda i : i.name.find("Week") != -1
  • exception_on_not_found (bool): Specifies whether to raise an exception if no Intervals are found. If None, the default behavior is used. Optional. Defaults to None. See set_default_exception_on_not_found and get_default_exception_on_not_found
Returns:

Optional[str]: The name of a matched Interval object or None

@staticmethod
def get_any_dss_name( matcher: Callable[[Interval], bool], exception_on_not_found: Optional[bool] = None) -> Optional[str]:

Retuns the name of a matched Interval object in the DSS context, or None if there is no such object

Arguments:
  • matcher (Callable[[Interval], bool]): A function that returns True or False when passed an Interval object parameter.
    Examples:
    • lambda i : i.is_irregular
    • lambda i : i.minutes < 60
    • lambda i : i.name.find("Week") != -1
  • exception_on_not_found (bool): Specifies whether to raise an exception if no Intervals are found. If None, the default behavior is used. Optional. Defaults to None. See set_default_exception_on_not_found and get_default_exception_on_not_found
Returns:

Optional[str]: The name of a matched Interval object or None

@staticmethod
def get_any_name( matcher: Callable[[Interval], bool], exception_on_not_found: Optional[bool] = None) -> Optional[str]:

Retuns the name of a matched Interval object in the any context, or None if there is no such object

Arguments:
  • matcher (Callable[[Interval], bool]): A function that returns True or False when passed an Interval object parameter.
    Examples:
    • lambda i : i.is_irregular
    • lambda i : i.minutes < 60
    • lambda i : i.name.find("Week") != -1
  • exception_on_not_found (bool): Specifies whether to raise an exception if no Intervals are found. If None, the default behavior is used. Optional. Defaults to None. See set_default_excpetion_on_not_found and get_default_exception_on_not_found
Returns:

Optional[str]: The name of a matched Interval object or None

@staticmethod
def get_cwms(key: Union[str, int]) -> Interval:

Returns a CWMS interval with the specified name or minutes

Arguments:
  • key (Union[str, int]): The name or (actual or characteristic) minutes of the interval to retrieve.
Raises:
  • IntervalException: if no CWMS interval exists with the specified key
  • TypeError: If the key is not a string or integer
Returns:

Interval: The CWMS interval

def get_datetime_index( self, start_time: Any, end_time: Optional[Any] = None, count: Optional[int] = None, offset: Optional[Any] = None, time_zone: Optional[Any] = None, name: Optional[str] = None) -> pandas.core.indexes.datetimes.DatetimeIndex:

Generates a pandas DatetimeIndex from this interval.

Arguments:
  • start_time (Any): A time in the first interval. If offset is None, this will be the first time, otherwise the first time will be the top of the interval containing this time plus the specified offset. If the time includes no time zone, it will be assumed to be in time_zone, if specified, if any. Must be an HecTime object or an object suitable for the HecTime constructor
  • end_time (Optional[Any]): The generated series will end on or before this time, if specified. If the time includes no time zone, it will be assumed to be in time_zone, if specified. If specified, must be an HecTime object or an object suitable for the HecTime constructor. Either end_time or count, but not both, must be specified. Defaults to None.
  • count (Optional[int]): The number of times in the index. Either end_time or count, but not both, must be specified. Defaults to None.
  • offset (Optional[Any]): The offset of each time into the interval. If None, the offset is determined from start_time. If specified, must be an TimeSpan object or an object suitable for the TimeSpan constructor. Defaults to None.
  • time_zone (Optional[Any]): The time zone of the generated times. Must be specified if the interval is a local-regular interval. Defaults to None.
  • name (Optional[str]): The name of the index. If the generated index is to be used in a TimeSeries object, specify the name as "name". Defaults to None.
Raises:
  • IntervalException: If invalid parameters are specified
Returns:

pd.DatetimeIndex: The generated index.

Notes:

There is a somewhat subtle interplay between start_time and offset. If offset is None or not specified, the index is generated as follows:

  • The offset used is the offset of start_time into the Interval object being used
  • The offset handles end-of-month dates and leap years by adjusting the actual offset at each time to keep dates as aligned as possible

Otherwise the offset is used literally.
See the following examples:

Index on 1Month interval
Values in red exceed the end of the month
start_time"2025‑01‑31 08:00:00""2025‑01‑01 00:00:00"
offsetNoneTimeSpan("P30DT8H")timedelta(
  days=30,
  hours=8,
)
index
2025‑01‑31 08:00:002025‑01‑31 08:00:002025‑01‑31 08:00:002025‑01‑31 08:00:00
2025‑02‑28 08:00:002025‑03‑03 08:00:002025‑03‑03 08:00:002025‑03‑03 08:00:00
2025‑03‑31 08:00:002025‑03‑31 08:00:002025‑03‑31 08:00:002025‑03‑31 08:00:00
2025‑04‑30 08:00:002025‑05‑01 08:00:002025‑05‑01 08:00:002025‑05‑01 08:00:00
2025‑05‑31 08:00:002025‑05‑31 08:00:002025‑05‑31 08:00:002025‑05‑31 08:00:00
2025‑06‑30 08:00:002025‑07‑01 08:00:002025‑07‑01 08:00:002025‑07‑01 08:00:00
2025‑07‑31 08:00:002025‑07‑31 08:00:002025‑07‑31 08:00:002025‑07‑31 08:00:00
2025‑08‑31 08:00:002025‑08‑31 08:00:002025‑08‑31 08:00:002025‑08‑31 08:00:00
2025‑09‑30 08:00:002025‑10‑01 08:00:002025‑10‑01 08:00:002025‑10‑01 08:00:00
2025‑10‑31 08:00:002025‑10‑31 08:00:002025‑10‑31 08:00:002025‑10‑31 08:00:00
2025‑11‑30 08:00:002025‑12‑01 08:00:002025‑12‑01 08:00:002025‑12‑01 08:00:00
2025‑12‑31 08:00:002025‑12‑31 08:00:002025‑12‑31 08:00:002025‑12‑31 08:00:00
Index on 1Year interval
Values in red don't match the starting day-of-month
start_time"2025‑05‑11 00:00:00""2025‑01‑01 00:00:00"
offsetNoneTimeSpan("P1M10D")timedelta(
  days=130,
)
index
2025‑05‑11 00:00:002025‑05‑11 00:00:002025‑05‑11 00:00:002025‑05‑11 00:00:00
2026‑05‑11 00:00:002026‑05‑11 00:00:002026‑05‑11 00:00:002026‑05‑11 00:00:00
2027‑05‑11 00:00:002027‑05‑11 00:00:002027‑05‑11 00:00:002027‑05‑11 00:00:00
2028‑05‑11 00:00:002028‑05‑11 00:00:002028‑05‑11 00:00:002028‑05‑10 00:00:00
2029‑05‑11 00:00:002029‑05‑11 00:00:002029‑05‑11 00:00:002029‑05‑11 00:00:00
2030‑05‑11 00:00:002030‑05‑11 00:00:002030‑05‑11 00:00:002030‑05‑11 00:00:00
2031‑05‑11 00:00:002031‑05‑11 00:00:002031‑05‑11 00:00:002031‑05‑11 00:00:00
2032‑05‑11 00:00:002032‑05‑11 00:00:002032‑05‑11 00:00:002032‑05‑10 00:00:00
2033‑05‑11 00:00:002033‑05‑11 00:00:002033‑05‑11 00:00:002033‑05‑11 00:00:00
2034‑05‑11 00:00:002034‑05‑11 00:00:002034‑05‑11 00:00:002034‑05‑11 00:00:00
2035‑05‑11 00:00:002035‑05‑11 00:00:002035‑05‑11 00:00:002035‑05‑11 00:00:00
2036‑05‑11 00:00:002036‑05‑11 00:00:002036‑05‑11 00:00:002036‑05‑10 00:00:00
@staticmethod
def get_default_exception_on_not_found() -> bool:

Retrieves the default behavior if any of the get... methods do not find an Interval object to return.

Returns:

bool: True if the default behavior is to raise an exception when no Interval is found or False if None is returned when no Interval is found

@staticmethod
def get_dss(key: Union[str, int]) -> Interval:

Returns an HEC-DSS interval with the specified name or minutes

Arguments:
  • key (Union[str, int]): The name or (actual or characteristic) minutes of the interval to retrieve.
Raises:
  • IntervalException: if no Dss interval exists with the specified key
  • TypeError: If the key is not a string or integer
Returns:

Interval: The Dss interval

@staticmethod
def get_dss_block_for_interval( interval: Union[str, int, Interval]) -> Interval:

Returns the HEC-DSS block size for a specified interval.

Arguments:
  • interval (Union[str, int, "Interval"]): The interval to return the block size for. May be an Interval object, or its name or (actual or characteristic) minutes.
Returns:

Interval: An interval object representing the HEC-DSS block size

is_any_irregular: bool

Whether this object represents a normal irregular or pseudo-regular interval

Operations:

Read-only

is_any_regular: bool

Whether this object represents a regular or local regular interval

Operations:

Read-only

is_local_regular: bool

Whether this object represents a local regular interval

Operations:

Read-only

is_pseudo_regular: bool

Whether this object represents a pseudo-regular interval

Operations:

Read-only

is_regular: bool

Whether this object represents a normal regular interval

Operations:

Read-only

is_irregular: bool

Whether this object represents a normal irregular interval

Operations:

Read-only

minutes: int

The minutes (actual or characteristic) of this object

Operations:

Read-only

name: str

The name of this object

Operations:

Read-only

@staticmethod
def set_default_exception_on_not_found(state: bool) -> None:

Sets the default behavior if any of the get... methods do not find an Interval object to return.

Arguments:
  • state (bool): Whether to raise an exception if no Interval is found (True) or return None (False)