-
Notifications
You must be signed in to change notification settings - Fork 3
Interval
The Interval
class is designed to represent a mathematical interval, providing a start and end value along with functionalities to handle intervals more comprehensively in various applications.
Initializes a new Interval instance.
- `start` (float): The starting value of the interval.
- `end` (float): The ending value of the interval.
- `interval` (list, optional): A list that may represent subdivided intervals or specific points within the start and end bounds, depending on the context or method of subdivision.
-
__str__(self) -> str
: Generates a string representation of the Interval. -
deserialize(data: dict) -> Interval
: Reconstructs an Interval object from serialized data contained in a dictionary. -
serialize(self) -> dict
: Serializes the interval's attributes into a dictionary.This method facilitates converting the interval's properties into a format that can be easily stored or transmitted.
Generates a string representation of the Interval.
str: A string representation of the Interval, primarily indicating its class name.
Reconstructs an Interval object from serialized data contained in a dictionary.
data (dict): The dictionary containing serialized data of an Interval object.
Interval: A new Interval object initialized with the data from the dictionary.
Serializes the interval's attributes into a dictionary.
This method facilitates converting the interval's properties into a format that can be easily stored or transmitted.
dict: A dictionary containing the serialized attributes of the interval.