2020-06-23 12:12:49 -04:00
|
|
|
Schedules
|
|
|
|
=========
|
|
|
|
|
2020-11-02 10:42:25 -05:00
|
|
|
`trnslator` can parse EnergyPlus schedules. In EnergyPlus, there are many ways to define schedules in an IDF file. The
|
2020-06-23 12:12:49 -04:00
|
|
|
Schedule module defines a class that handles parsing, plotting converting schedules.
|
|
|
|
|
|
|
|
Reading Schedules
|
|
|
|
-----------------
|
|
|
|
|
2020-11-02 10:42:25 -05:00
|
|
|
*trnslator* can read almost any schedules defined in an IDF file using a few commands. First,
|
2020-06-23 12:12:49 -04:00
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
2020-11-02 10:42:25 -05:00
|
|
|
>>> import trnslator as tr
|
2020-06-23 12:12:49 -04:00
|
|
|
>>> idf = tr.load_idf(<idf-file-path>)
|
|
|
|
>>> this_schedule = Schedule(Name='name', idf=idf)
|
|
|
|
|
|
|
|
|
|
|
|
Converting Schedules
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
Some tools typically rely on a group of 3 schedules; defined as a Yearly, Weekly, Daily schedule object. This is the
|
2020-11-02 10:42:25 -05:00
|
|
|
case for the :ref:`IDF to TRNSYS <Converting IDF to BUI>` converter. The Schedule module of *trnslator* can handle this conversion.
|
2020-06-23 12:12:49 -04:00
|
|
|
|
|
|
|
The `year-week-day` representation for any schedule object is invoked with
|
2020-11-02 10:42:25 -05:00
|
|
|
the :py:meth:`~trnslator.schedule.Schedule.to_year_week_day` method:
|
2020-06-23 12:12:49 -04:00
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
>>> this_schedule.to_year_week_day()
|
|
|
|
|
|
|
|
Plotting Schedules
|
|
|
|
------------------
|
|
|
|
|
|
|
|
Schedules can be parsed as :class:`pandas.Series` objects (call the `series` property on a Schedule object) which then
|
|
|
|
exposes useful methods from the pandas package. For convenience, a wrapper for the plotting method is built-in the
|
2020-11-02 10:42:25 -05:00
|
|
|
Schedule class. To plot the full annual schedule (or a specific range), simply call the :meth:`trnslator.schedule.Schedule.plot`
|
2020-06-23 12:12:49 -04:00
|
|
|
method. For example,
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
>>> this_schedule.plot(slice=("2018/01/02", "2018/01/03"), drawstyle="steps-post")
|