cotede.utils.load_cfg

cotede.utils.load_cfg(cfgname='cotede')

Load a QC configuration

A QC procedure is a sequence of tests, and respective tuning parameters used to quality control a dataset. This is how the user controls the QC steps to apply.

Parameters:

cfgname (string or dict-list, optional) –

  • None: If not given, it will use the CoTeDe’s default configuration, which is equivalent to use cfgname=’cotede’.

  • A config name [string]: A string with the name of a json file describing the QC procedure. It will first search among the build in pre-set (ex.: cotede, eurogoos, gtspp, argo, …). If can’t find a config with that name, it will search at ~/.config/cotederc/cfg/, or the path defined by the local variable $COTEDE_DIR.

  • Inline config [dict-like]: A dictionary describing the variables to process and which tests to use on each one. A minimalist example to apply the gradient test in the sea water temperature could be:

    >>> {"sea_water_temperature": {"gradient": 3}}
    

If inherit is used, it should be a string or a list of other procedures to inherit, where each item has higher priority than the following ones. For example:

>>> {"inherit": "eurogoos", "sea_water_temperature": {"gradient": 2}}

will use all the setup from eurogoos, and include/overwrite the gradient test for sea_water_temperature with a threshold of 2.

Returns:

cfg – A dictionary defining a full QC procedure that defines which tests to run on which variables.

Return type:

OrderedDict

See also

utils.list_cfgs