gcubed.projections.simulation_layer_definitions
This module contains the SimulationLayerDefinitions
class.
It contains a list of simulation layer definitions, in the order that they are to be imposed over the baseline for the model.
An event_year ordered list of simulation layer definitions.
The ordered list implemented as a singly linked list.
It supports addition, removal and iteration of simulation layer definitions.
Create an empty ordered list of SimulationLayerDefinitions
Overview
Insert a SimulationLayerDefinition
into the iterable list of
definitions, in the correct event-year order.
Remove a SimulationLayerDefinition from the list
Arguments
simulation_name: The name of the simulation to retrieve details for.
Returns the definition for a named simulation layer.
Arguments
event_year: The event year.
Returns the simulation layer definitions that have the specified event year. They are returned in the same order as they have been loaded.
The list of unique event years associated with simulation layer definitions in ascending order.
Overview
Loads the metadata about each simulation layer from the specified CSV experiment design file.
Arguments
design_file
: the name and absolute path to the experiment design file.
Loads the simulation layer definitions from a CSV file that lists the files along with other details of each simulation layer. The CSV file columns are expected to be, in the following order:
name
- the name of the simulation layerdata
- the name of the simulation layer data file. The data files are expected to be in the same directory as the CSV design file that defines the simulation layers.event_year
- the event year for the simulation layer.description
- the text description of the simulation layer.
Exceptions
Raises an exception if the experiment design file does not exist.
Raises and exception if the simulation layers in the experiment design are not in event year order from earliest to latest.