Skip to content

Utils

qseek.utils.Range module-attribute

Range = Annotated[_Range, AfterValidator(_range_validator)]

qseek.utils._Range

Bases: NamedTuple

Methods:

Name Description
from_list

Create a Range object from a numpy array.

inside

Check if a value is inside the range.

width

Calculate the width of the range.

from_list classmethod

from_list(array: ndarray | list[float]) -> _Range

Create a Range object from a numpy array.

  • array: numpy.ndarray The array from which to create the Range object.

Returns: - _Range: The created Range object.

inside

inside(value: float) -> bool

Check if a value is inside the range.

Parameters:

Name Type Description Default
value float

The value to check.

required

Returns:

Name Type Description
bool bool

True if the value is inside the range, False otherwise.

width

width() -> float

Calculate the width of the range.

Returns:

Name Type Description
float float

The width of the range.