trnslator.schedule.Schedule¶
-
class
trnslator.schedule.Schedule(Name=None, idf=None, start_day_of_the_week=0, strict=False, base_year=2018, schType=None, schTypeLimitsName=None, values=None, **kwargs)[source]¶ An object designed to handle any EnergyPlus schedule object
- Parameters
Name (str) – The schedule name in the idf file
idf (IDF) – IDF object
start_day_of_the_week (int) – 0-based day of week (Monday=0)
strict (bool) – if True, schedules that have the Field-Sets such as Holidays and CustomDay will raise an error if they are absent from the IDF file. If False, any missing qualifiers will be ignored.
base_year (int) – The base year of the schedule. Defaults to 2018 since the first day of that year is a Monday.
schType (str) – The EnergyPlus schedule type. eg.: “Schedule:Year”
schTypeLimitsName –
values –
**kwargs –
-
classmethod
constant_schedule(hourly_value=1, Name='AlwaysOn', idf=None, **kwargs)[source]¶ Create a schedule with a constant value for the whole yetr. Defaults to a schedule with a value of 1, named ‘AlwaysOn’.
-
property
all_values¶ returns the values array
-
property
series¶ Returns the schedule values as a pd.Series object with a DateTimeIndex
-
get_schedule_type_limits_name(sch_type=None)[source]¶ Return the Schedule Type Limits name associated to this schedule
- Parameters
sch_type –
-
get_schedule_type_limits_data(name=None)[source]¶ Returns Schedule Type Limits data from schedule name
- Parameters
name –
-
get_schedule_type(name=None)[source]¶ Return the schedule type, eg.: “Schedule:Year”
- Parameters
name –
-
plot(slice=None, **kwargs)[source]¶ Plot the schedule. Implements the .loc accessor on the series object.
Examples
>>> s = Schedule( >>> Name="NECB-A-Thermostat Setpoint-Heating", >>> idf=idf_object) >>> ) >>> s.plot(slice=("2018/01/02", "2018/01/03"), drawstyle="steps-post") >>> plt.show()
- Parameters
slice (tuple) – define a 2-tuple object the will be passed to
pandas.IndexSliceas a range.**kwargs (dict) – keyword arguments passed to
pandas.Series.plot().
-
get_interval_day_ep_schedule_values(epbunch)[source]¶ Schedule:Day:Interval
- Parameters
epbunch (EpBunch) – The schedule EpBunch object.
-
get_hourly_day_ep_schedule_values(epbunch)[source]¶ Schedule:Day:Hourly
- Parameters
epbunch (EpBunch) – The schedule EpBunch object.
-
get_compact_weekly_ep_schedule_values(epbunch, start_date=None, index=None)[source]¶ schedule:week:compact
- Parameters
epbunch (EpBunch) – the name of the schedule
start_date –
index –
-
get_daily_weekly_ep_schedule_values(epbunch)[source]¶ schedule:week:daily
- Parameters
epbunch (EpBunch) – The schedule EpBunch object.
-
get_list_day_ep_schedule_values(epbunch)[source]¶ schedule:day:list
- Parameters
epbunch (EpBunch) – The schedule epbunch object.
-
get_constant_ep_schedule_values(epbunch)[source]¶ schedule:constant
- Parameters
epbunch (EpBunch) – The schedule epbunch object.
-
get_file_ep_schedule_values(epbunch)[source]¶ schedule:file
- Parameters
epbunch (EpBunch) – The schedule epbunch object.
-
get_compact_ep_schedule_values(epbunch)[source]¶ schedule:compact
- Parameters
epbunch (EpBunch) – The schedule epbunch object.
-
get_yearly_ep_schedule_values(epbunch)[source]¶ schedule:year
- Parameters
epbunch (EpBunch) – the schedule epbunch.
-
get_schedule_values(sched_epbunch, start_date=None, index=None)[source]¶ Main function that returns the schedule values
- Parameters
sched_epbunch (EpBunch) – the schedule epbunch object
start_date –
index –
-
to_year_week_day(values=None, idf=None)[source]¶ convert a Schedule Class to the ‘Schedule:Year’, ‘Schedule:Week:Daily’ and ‘Schedule:Day:Hourly’ representation
- Parameters
values –
idf –
- Returns
3-element tuple containing
yearly (Schedule): The yearly schedule object
weekly (list of Schedule): The list of weekly schedule objects
daily (list of Schedule):The list of daily schedule objects
-
field_set(field, slicer_=None)[source]¶ helper function to return the proper slicer depending on the field_set value.
Available values are: Weekdays, Weekends, Holidays, Alldays, SummerDesignDay, WinterDesignDay, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, CustomDay1, CustomDay2, AllOtherDays
- Parameters
field (str) – The EnergyPlus field set value.
slicer –
- Returns
Returns the appropriate indexer for the series.
- Return type
(indexer-like)
-
get_sdow(start_day_of_week)[source]¶ Returns the start day of the week
- Parameters
start_day_of_week –
-
special_day(field, slicer_)[source]¶ try to get the RunPeriodControl:SpecialDays for the corresponding Day Type
- Parameters
field –
slicer –
-
combine(other, weights=None, quantity=None)[source]¶ Combine two schedule objects together.
- Parameters
other (Schedule) – the other Schedule object to combine with.
weights (list-like, optional) – A list-like object of len 2. If None, equal weights are used.
quantity – scalar value that will be multiplied by self before the averaging occurs. This ensures that the resulting schedule returns the correct integrated value.
- Returns
the combined Schedule object.
- Return type
(Schedule)