transforms class#

class pycif.utils.classes.transforms.Transform(plg_orig=None, orig_name='', **kwargs)[source]#

Bases: Setup

end_pipe = False#
flushrun(*args, **kwargs)[source]#

Default empty flushrun method for transforms

classmethod get_transform(plg)[source]#

Get the correct Parser for a provider and file_format_id

Args:

provider (str): provider of the input file file_format_id (str): name of the type of file with a given format

Returns:

Parser: Parser for provider and file_format_id

ini_mapper(*args, **kwargs)[source]#

Default empty ini_mapper method

initiate_template()[source]#

Initializes a Plugin template, with methods from the corresponding module.

Args:

self: the plugin to initialize plg_type: the type of the plugin to initialize default_functions (dict[str, bool]):

functions to load from the module and to attach to the plugin. Each key names the function and each value is a boolean to determine whether the corresponding function is a class method (with a reflective self as argument) or a classical static function

mapper2batch(nsamples, transf_mapper, all_mapper, all_transforms, dir_samples, file_samples, **kwargs)[source]#

Default mapper2batch method.

Perturb the mapper to simulate a batch of samples at once.

Propagate perturbations from precursors to outputs.

For transformations with no inputs, perturb outputs if “fromcontrol”

perturb_transform(*args, **kwargs)[source]#

Default empty perturb_transform method.

Do nothing by default.

If specified in the corresponding plugin, the function should perturb its own behaviour beyond the mapper if necessary.

For instance, for models, it is necessary to update the chemical scheme to know which species should be accounted for

propagate_incompatible(trans_mapper, attributes, trid, mode='backward', **kwargs)[source]#

Default method to propagate incompatible attributes

propagate_incompatible_dates(*args, **kwargs)[source]#

Default empty propagate_incompatible_dates method for transforms

propagate_incompatible_domain(*args, **kwargs)[source]#

Default empty propagate_incompatible_domain method for transforms

propagate_incompatible_input_dates(*args, **kwargs)[source]#

Default empty propagate_incompatible_dates method for transforms

propagate_incompatible_input_files(*args, **kwargs)[source]#

Default empty propagate_incompatible_files method for transforms

propagate_incompatible_tracer(*args, **kwargs)[source]#

Default empty propagate_incompatible_tracer method for transforms

classmethod register_plugin(name, version, module, subtype='', **kwargs)[source]#

Register a module for a plugin and version with possibly options

Args:

name (str): name of the plugin version (str): version of the plugin module (types.ModuleType): module defining the interface

between pyCIF and the plugin

plugin_type (str): type of plugin **kwargs (dictionary): default options for module

start_pipe = False#