smif.metadata module¶
Encapsulates the input or output parameters of a sector model, for example:
- name: petrol_price
spatial_resolution: GB
temporal_resolution: annual
units: £/l
- name: diesel_price
spatial_resolution: GB
temporal_resolution: annual
units: £/l
- name: LPG_price
spatial_resolution: GB
temporal_resolution: annual
units: £/l
Summary¶
Classes:
Metadata |
All metadata about a single dataset, typically model input or output |
MetadataSet |
A container for metadata about model inputs or outputs |
Reference¶
-
class
smif.metadata.
Metadata
(name, spatial_resolution, temporal_resolution, units)[source]¶ Bases:
object
All metadata about a single dataset, typically model input or output
Parameters: - name (str) – The dataset name
- spatial_resolution (
smif.convert.region.RegionSet
) – The region set that defines the spatial resolution - temporal_resolution (
smif.convert.interval.IntervalSet
) – The interval set that defines the temporal resolution - units (str) – Name of the units for the dataset values
-
class
smif.metadata.
MetadataSet
(metadata_list=None)[source]¶ Bases:
collections.abc.Mapping
A container for metadata about model inputs or outputs
Parameters: metadata (list) – A list of dicts like
{ 'name': 'heat_demand' 'spatial_resolution': smif.convert.ResolutionSet 'temporal_resolution': smif.convert.ResolutionSet 'units': 'kW' }
Or, a list of smif.metadata.Metadata
- Metadata(‘heat_demand’,
- smif.convert.area.RegionSet, smif.convert.interval.IntervalSet, ‘kW’)
-
metadata
¶ A list of the model parameters
Returns: parameters – A list of smif.Metadata
, sorted by nameReturn type: list
-
add_metadata
(item)[source]¶ Add an item to the set
Parameters: item (Metadata or dict) – Metadata object or dictionary with keys ‘name’, ‘spatial_resolution’, ‘temporal_resolution’ and ‘units’
-
get_spatial_res
(name)[source]¶ The spatial resolution for parameter name
Parameters: name (str) – The name of a model parameter
-
get_temporal_res
(name)[source]¶ The temporal resolution for parameter name
Parameters: name (str) – The name of a model parameter
-
get_units
(name)[source]¶ The units used for parameter ‘name’
Parameters: name (str) – The name of a model parameter
-
spatial_resolutions
¶ A list of the spatial resolutions
Returns: A list of the spatial resolutions associated with the model parameters Return type: list
-
temporal_resolutions
¶ A list of the temporal resolutions
Returns: A list of the temporal resolutions associated with the model parameters Return type: list
-
names
¶ A list of the parameter names