climate_ref_core.pycmec.output
#
CMEC output bundle class
An output bundle describes the figures and data generated during a diagnostic execution.
Following the CMEC output bundle standards at https://github.com/Earth-System-Diagnostics-Standards/EMDS
To validate that a dictionary is compatible with the CMEC output bundle standards, please use: - class instantiation: cmec = CMECOutput(**result_dict) - class model_validate method: cmec = CMECOutput.model_validate(result_dict) Both ways will create the CMECOutput instance (cmec)
CMECOutput
#
Bases: BaseModel
CMEC output bundle object
Describes the assets generated during a diagnostic execution.
Source code in packages/climate-ref-core/src/climate_ref_core/pycmec/output.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | |
data = None
class-attribute
instance-attribute
#
(optional) Dictionary of data files produced with the output.
html = None
class-attribute
instance-attribute
#
(optional) Dictionary of html files produced with the output.
index = None
class-attribute
instance-attribute
#
Short name of the plot/html/diagnostic that should be opened when the user chooses to “open” the output bundle.
metrics = None
class-attribute
instance-attribute
#
(optional) Dictionary of diagnostic files produced with the output.
plots = None
class-attribute
instance-attribute
#
(optional) Dictionary of plots produced with the output.
provenance
instance-attribute
#
Command line and version information used to execute the DEM. This includes environment variables and the observational datasets used (including dataset versions).
create_template()
staticmethod
#
Return a empty dictionary in CMEC output bundle format
Source code in packages/climate-ref-core/src/climate_ref_core/pycmec/output.py
dump_to_json(json_path='./cmec_output.json')
#
Save the CMECOutput object to a JSON file in the CMEC format
Source code in packages/climate-ref-core/src/climate_ref_core/pycmec/output.py
load_from_json(json_file)
classmethod
#
Create a CMECOuput object from a CMEC standard JSON file
Source code in packages/climate-ref-core/src/climate_ref_core/pycmec/output.py
update(output_kw, *, short_name, dict_content)
#
Update the content of output_kw using short_name and dict_content pair
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_kw
|
Literal['data', 'plots', 'html', 'diagnostics']
|
CMEC output bundle keywords, one of [data, plots, html, diagnostics] |
required |
short_name
|
str
|
Key name of the dictionary nested in the output_kw dictionary |
required |
dict_content
|
dict[str, Any]
|
Value of the dictionary with the key of short_name |
required |
Returns:
| Type | Description |
|---|---|
None
|
CMECOutput object with content updated |
Source code in packages/climate-ref-core/src/climate_ref_core/pycmec/output.py
OutputCV
#
Bases: Enum
CMEC output bundle controlled vocabulary
Source code in packages/climate-ref-core/src/climate_ref_core/pycmec/output.py
OutputDict
#
Bases: BaseModel
Description of an output
Source code in packages/climate-ref-core/src/climate_ref_core/pycmec/output.py
dimensions = None
class-attribute
instance-attribute
#
Dimensions associated with this output
These dimensions can be used to filter the output for given sources/experiments/variables etc. They should match the controlled vocabulary dimensions defined in the system.
OutputProvenance
#
Bases: BaseModel
CMEC output bundle provenance object
Source code in packages/climate-ref-core/src/climate_ref_core/pycmec/output.py
environment
instance-attribute
#
Key/value pairs listing all relevant diagnostic and framework environment variables.
log
instance-attribute
#
Filename of a free format log file written during execution.
modeldata
instance-attribute
#
Path to the model data used in this analysis.
obsdata
instance-attribute
#
Key/value pairs containing short names and versions of all observational datasets used.