opyplus.Simulation¶
-
class
opyplus.
Simulation
(base_dir_path, simulation_name=None)¶ Class describing an E+ simulation.
Simulation output data has following characteristics: - convention: left (00:00 is [00:00;01:00[ for an hourly series) - clock: tzt
Left convention applies to datetime index. In data columns, start and end of period are given (=> user can choose to work with one convention or another).
A simulation is not characterized by it’s input files but by it’s base_dir_path. This approach makes it possible to load an already simulated directory without having to define it’s idf or epw.
- Parameters
- base_dir_path: str
simulation dir path
- simulation_name: str or None
if provided, simulation will be looked for in {base_dir_path}/{simulation_name} else, simulation will be looked for in {base_dir_path}
Methods
check_exists
(self, ref)Check if resource exist from ref.
from_inputs
(base_dir_path, …[, …])Create a simulation from input data: Epm (idf) and WeatherData (epw).
get_dir_path
(self)Get simulation dir path.
get_in_epm
(self)Get simulation input Epm (idf).
get_in_weather_data
(self)Get simulation input WeatherData (epw).
get_info
(self)Get simulation info.
get_out_eio
(self)Get simulation output eio.
get_out_err
(self)Get simulation out_err (E+ .err file).
get_out_eso
(self[, print_function])Get simulation output eso.
get_out_mdd
(self)Get simulation output mdd.
get_out_mtd
(self)Get simulation output mtd.
get_out_mtr
(self)Get simulation output mtr.
get_out_summary_table
(self)Get simulation output summary table.
get_resource_path
(self, ref[, …])Get simulation resource path from ref.
get_simulation_dir_path
(base_dir_path[, …])Get simulation dir path from base path and name.
get_status
(self)Get simulation status.
simulate
(self[, print_function, beat_freq])Run this simulation on E+.
-
check_exists
(self, ref)¶ Check if resource exist from ref.
- Parameters
- ref: str
- Returns
- bool
-
classmethod
from_inputs
(base_dir_path, epm_or_buffer_or_path, weather_data_or_buffer_or_path, simulation_name=None)¶ Create a simulation from input data: Epm (idf) and WeatherData (epw).
- Parameters
- base_dir_path: str
- epm_or_buffer_or_path: Epm or str or typing.StringIO
- weather_data_or_buffer_or_path: WeatherData or str or typing.StringIO
- simulation_name: str
- Returns
- Simulation
-
get_dir_path
(self)¶ Get simulation dir path.
- Returns
- str
-
get_in_epm
(self)¶ Get simulation input Epm (idf).
- Returns
- Epm
-
get_in_weather_data
(self)¶ Get simulation input WeatherData (epw).
- Returns
- WeatherData
-
get_info
(self)¶ Get simulation info.
- Returns
- Info
-
get_out_eio
(self)¶ Get simulation output eio.
- Returns
- Eio
-
get_out_err
(self)¶ Get simulation out_err (E+ .err file).
- Returns
- Err
-
get_out_eso
(self, print_function=<function Simulation.<lambda> at 0x7f3e01c451e0>)¶ Get simulation output eso.
- Parameters
- print_function: typing.Callable
print function, default does not do anything
- Returns
- StandardOutput
-
get_out_mdd
(self)¶ Get simulation output mdd.
- Returns
- str
-
get_out_mtd
(self)¶ Get simulation output mtd.
- Returns
- Mtd
-
get_out_mtr
(self)¶ Get simulation output mtr.
- Returns
- StandardOutput
-
get_out_summary_table
(self)¶ Get simulation output summary table.
- Returns
- SummaryTable
-
get_resource_path
(self, ref, raise_if_not_found=False)¶ Get simulation resource path from ref.
- Parameters
- ref: str
- raise_if_not_found: bool
- Returns
- str
- Raises
- FileNotFoundError
-
classmethod
get_simulation_dir_path
(base_dir_path, simulation_name=None)¶ Get simulation dir path from base path and name.
- Parameters
- base_dir_path: str
- simulation_name: str or None
- Returns
- str
-
get_status
(self)¶ Get simulation status.
- Returns
- empty, success, error
-
simulate
(self, print_function=None, beat_freq=None)¶ Run this simulation on E+.
- Parameters
- print_function: typing.Callable or None
Function to print current status
- beat_freq: float or None:
If set, will print a message to print_function every beat_freq seconds while E+ is running.