Dump to specific format dump2format/std#

Description#

This transform allows to dump the data at the end of the control vector transformations to a specific format. The data can be regridded and resampled before being dumped.

YAML arguments#

The following arguments are used to configure the plugin. pyCIF will return an exception at the initialization if mandatory arguments are not specified, or if any argument does not fit accepted values or type:

Mandatory arguments#

parameter : str, mandatory

Name of the parameter to dump to a specific format.

component : str, mandatory

Name of the component to dump to a specific format.

Optional arguments#

orig_parameter_plg : Plugin, optional

Plugin object on which the transform works on

orig_component_plg : Plugin, optional

Corresponding component object on which the transform works on

successor : str, optional

Name of the successor transform

precursor : str, optional

Name of the precursor transform

dump_dir : str, optional

Dump directory for the files, the simulation period run subdirectory is used by default.

dump_file : str, optional, default “dump_%Y%m%d”

File format for the files

dump_format : optional

Definition of the plugin to use to dump the data, this plugin should have a write method implemented

Argument structure:
name : str, mandatory

Name of the plugin

version : str, mandatory

Version of the plugin

type : str, mandatory

Type of the plugin

dump_options : optional

Dumping options, i.e., options for the plugin chosen in dump_format

overwrite : bool, optional, default True

If the target file already exists and overwrite is False, the data will not be dumped.

use_defined_domain : bool, optional, default False

Get the dump domain from the YAML configuration as a plugin dependency, the domain plugin is picked from this plugin or from the root level if none is defined within this plugin

use_get_domain : optional

Get the dump domain with get_domain method of the plugin defined with dump_format and dump_options, the dump_options arguments are passed to the dump plugin’s get_domain method with the tracer keyword argument.

Argument structure:
file : str, mandatory

File name passed as the second positional argument (ref_file) of the dump plugin’s get_domain method

dir : str, optional, default “”

Directory passed as the first positional argument (ref_dir) of the dump plugin’s get_domain method

resample_dump : optional

Resample the data before dumping

Argument structure:
file_freq : str, mandatory

Dump files frenquency

var_freq : str, mandatory

Variable frequency inside each file

Requirements#

The current plugin requires the present plugins to run properly:

Requirement name

Requirement type

Explicit definition

Any valid

Default name

Default version

domain

Domain

True

True

None

None

YAML template#

Please find below a template for a YAML configuration:

 1transform:
 2  plugin:
 3    name: dump2format
 4    version: std
 5    type: transform
 6
 7  # Mandatory arguments
 8  parameter: XXXXX  # str
 9  component: XXXXX  # str
10
11  # Optional arguments
12  orig_parameter_plg: XXXXX  # Plugin
13  orig_component_plg: XXXXX  # Plugin
14  successor: XXXXX  # str
15  precursor: XXXXX  # str
16  dump_dir: XXXXX  # str
17  dump_file: XXXXX  # str
18  dump_format:
19    name: XXXXX  # str
20    version: XXXXX  # str
21    type: XXXXX  # str
22  dump_options: XXXXX  # any
23  overwrite: XXXXX  # bool
24  use_defined_domain: XXXXX  # bool
25  use_get_domain:
26    dir: XXXXX  # str
27    file: XXXXX  # str
28  resample_dump:
29    file_freq: XXXXX  # str
30    var_freq: XXXXX  # str