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.scenario.configuration_classes.PowerPlantConfig, target_area_list_config: artist.scenario.configuration_classes.TargetAreaListConfig, light_source_list_config: artist.scenario.configuration_classes.LightSourceListConfig, heliostat_list_config: artist.scenario.configuration_classes.HeliostatListConfig, prototype_config: artist.scenario.configuration_classes.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 The power plant configuration object. target_area_list_config : TargetAreaListConfig The target area list configuration object. light_source_list_config : LightSourceListConfig The light source list configuration object. heliostat_list_config : HeliostatListConfig The heliostat_list configuration object. prototype_config : PrototypeConfig The prototype configuration object. version : float The 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_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() 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, parent_key: str = '', sep: str = '/') -> dict[str, Any] Flatten nested dictionaries to first-level keys. Parameters ---------- dictionary : MutableMapping 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, parent_key: str, sep: str) -> Generator .. py:method:: _include_parameters(file: h5py.File, prefix: str, parameters: dict) -> 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 The parameters to be included into the HFD5 file. .. py:method:: generate_scenario() -> None Generate the scenario and save it as an HDF5 file.