Skip to content

Interval

Source code in src/library_analyzer/processing/annotations/model/_annotations.py
@dataclass
class Interval:
    lowerIntervalLimit: int | float | str  # noqa: N815
    lowerLimitType: int  # noqa: N815
    upperIntervalLimit: int | float | str  # noqa: N815
    upperLimitType: int  # noqa: N815
    isDiscrete: bool  # noqa: N815

    @staticmethod
    def from_dict(d: dict[str, Any]) -> Interval:
        return Interval(
            d["lowerIntervalLimit"],
            d["lowerLimitType"],
            d["upperIntervalLimit"],
            d["upperLimitType"],
            d["isDiscrete"],
        )

    def to_dict(self) -> dict:
        return asdict(self)

isDiscrete: bool instance-attribute

lowerIntervalLimit: int | float | str instance-attribute

lowerLimitType: int instance-attribute

upperIntervalLimit: int | float | str instance-attribute

upperLimitType: int instance-attribute

__init__(lowerIntervalLimit, lowerLimitType, upperIntervalLimit, upperLimitType, isDiscrete)

from_dict(d) staticmethod

Source code in src/library_analyzer/processing/annotations/model/_annotations.py
@staticmethod
def from_dict(d: dict[str, Any]) -> Interval:
    return Interval(
        d["lowerIntervalLimit"],
        d["lowerLimitType"],
        d["upperIntervalLimit"],
        d["upperLimitType"],
        d["isDiscrete"],
    )

to_dict()

Source code in src/library_analyzer/processing/annotations/model/_annotations.py
def to_dict(self) -> dict:
    return asdict(self)