preheat_open.loadable_types.SetpointSchedule
- class preheat_open.loadable_types.SetpointSchedule(schedule=<factory>)
Bases:
LoadableDataTypeRepresents a setpoint schedule containing multiple schedule items.
- Variables:
parent (Unit, optional) – The parent unit of the setpoint schedule.
schedule (list[ScheduleItem]) – A list of schedule items.
- __init__(schedule=<factory>)
Methods
__init__([schedule])add_data(data)Adds schedule items to the setpoint schedule.
astimezone(tz)Converts the setpoint schedule to the specified timezone.
from_frame(frame)Creates a SetpointSchedule object from a pandas DataFrame.
from_series(series)Creates a SetpointSchedule object from a pandas Series.
get_data(date_range)Retrieves schedule items for the specified date range.
to_frame()Converts the setpoint schedule to a pandas DataFrame.
Attributes
Checks if the setpoint schedule is empty.
schedule- add_data(data)
Adds schedule items to the setpoint schedule.
- Parameters:
data (SetpointSchedule) – The schedule items to add.
- Return type:
None
- astimezone(tz)
Converts the setpoint schedule to the specified timezone.
- Parameters:
tz (tzinfo) – The timezone to convert to.
- Returns:
A SetpointSchedule object with the schedule items converted to the specified timezone.
- Return type:
- property empty
Checks if the setpoint schedule is empty.
- Returns:
True if the schedule is empty, False otherwise.
- Return type:
bool
- classmethod from_frame(frame)
Creates a SetpointSchedule object from a pandas DataFrame.
- Parameters:
frame (pd.DataFrame) – The DataFrame containing the schedule items.
parent (Unit) – The parent unit of the setpoint schedule.
- Returns:
A SetpointSchedule object.
- Return type:
- classmethod from_series(series)
Creates a SetpointSchedule object from a pandas Series.
- Parameters:
series (pd.Series) – The Series containing the schedule items.
parent (Unit) – The parent unit of the setpoint schedule.
- Returns:
A SetpointSchedule object.
- Return type:
- get_data(date_range)
Retrieves schedule items for the specified date range.
- Parameters:
date_range (DateRange) – The date range for which to retrieve schedule items.
- Returns:
A tuple containing the date range and the schedule items.
- Return type:
tuple[DateRange, list[ScheduleItem]]
- to_frame()
Converts the setpoint schedule to a pandas DataFrame.
- Returns:
A DataFrame containing the schedule items.
- Return type:
pd.DataFrame