improver.metadata.amend module
Module containing utilities for modifying cube metadata
- amend_attributes(cube, attributes_dict)[source]
Add, update or remove attributes from a cube. Modifies cube in place.
- set_history_attribute(cube, value, append=False)[source]
Add a history attribute to a cube. This uses the current datetime to generate the timestamp for the history attribute. The new history attribute will overwrite any existing history attribute unless the “append” option is set to True. The history attribute is of the form “Timestamp: Description”.
- update_model_id_attr_attribute(cubes, model_id_attr)[source]
Update the dictionary with the unique values of the model_id_attr attribute from within the input cubes. The model_id_attr attribute is expected on all cubes.
- Parameters
- Return type
- Returns
Dictionary containing a model_id_attr key, if available.
- Raises
AttributeError – Expected to find the model_id_attr attribute on all cubes.