artist.scenario.h5_scenario_generator ===================================== .. py:module:: artist.scenario.h5_scenario_generator Attributes ---------- .. autoapisummary:: artist.scenario.h5_scenario_generator.log Classes ------- .. autoapisummary:: artist.scenario.h5_scenario_generator.H5ScenarioGenerator Module Contents --------------- .. py:data:: log A logger for the scenario generator. .. py:class:: H5ScenarioGenerator(file_path: pathlib.Path, power_plant_config: artist.util.config.PowerPlantConfig, target_area_list_planar_config: artist.util.config.TargetAreaPlanarListConfig, target_area_list_cylindrical_config: artist.util.config.TargetAreaCylindricalListConfig, light_source_list_config: artist.util.config.LightSourceListConfig, heliostat_list_config: artist.util.config.HeliostatListConfig, prototype_config: artist.util.config.PrototypeConfig, version: float = 1.0) Initialize the scenario generator. Scenarios in ``ARTIST`` describe the whole environment and all the components of a solar tower power plant. The scenario generator creates the scenarios. A scenario encompasses the tower target area(s), the light source(s), prototypes, and the heliostat(s). The generated scenarios are then saved in HDF5 files. Parameters ---------- file_path : pathlib.Path File path to the HDF5 to be saved. power_plant_config : PowerPlantConfig Power plant configuration object. target_area_list_planar_config : TargetAreaPlanarListConfig Planar target area list configuration object. target_area_list_cylindrical_config : TargetAreaCylindricalListConfig Cylindrical target area list configuration object. light_source_list_config : LightSourceListConfig Light source list configuration object. heliostat_list_config : HeliostatListConfig Heliostat_list configuration object. prototype_config : PrototypeConfig Prototype configuration object. version : float Version of the scenario generator being used (default is 1.0). .. py:attribute:: file_path .. py:attribute:: power_plant_config .. py:attribute:: target_area_list_planar_config .. py:attribute:: target_area_list_cylindrical_config .. py:attribute:: light_source_list_config .. py:attribute:: heliostat_list_config .. py:attribute:: prototype_config .. py:attribute:: version :value: 1.0 .. py:method:: _get_number_of_heliostat_groups() -> int Get the number of heliostat groups in the scenario. Returns ------- int Number of heliostat groups in the scenario. .. py:method:: _check_equal_facet_numbers() -> None Check that each heliostat has the same number of facets. Raises ------ ValueError If at least one heliostat has a different number of facets. .. py:method:: _flatten_dict(dictionary: collections.abc.MutableMapping[str, Any], parent_key: str = '', sep: str = '/') -> dict[str, Any] Flatten nested dictionaries to first-level keys. Parameters ---------- dictionary : MutableMapping[str, Any] Original nested dictionary to flatten. parent_key : str The parent key of nested dictionaries. Should be empty upon initialization. sep : str The separator used to separate keys in nested dictionaries. Returns ------- dict[str, Any] A flattened version of the original dictionary. .. py:method:: _flatten_dict_gen(d: collections.abc.MutableMapping[str, Any], parent_key: str, sep: str) -> collections.abc.Generator[tuple[str, Any], None, None] .. py:method:: _include_parameters(file: h5py.File, prefix: str, parameters: dict[str, Any]) -> None :staticmethod: Include the parameters from a parameter dictionary. Parameters ---------- file : h5py.File The HDF5 file to write to. prefix : str The prefix used for naming the parameters. parameters : dict[str, Any] The parameters to be included into the HDF5 file. .. py:method:: generate_scenario() -> None Generate the scenario and save it as an HDF5 file.