fold_legacy_data_dir#

rojak.orchestrator.configuration.fold_legacy_data_dir(data, legacy_key, new_key, **extra)[source]#

Rewrite a legacy <legacy_key>: <directory> entry into <new_key>’s MeteorologyConfig form

Intended for use in a mode="before" model validator so existing configuration files keep working.

Parameters:
  • data (Any) – Raw input to the model being validated

  • legacy_key (str) – Name of the deprecated directory field (e.g. calibration_data_dir)

  • new_key (str) – Name of the MeteorologyConfig field replacing it

  • **extra (Any) – Additional MeteorologyConfig fields (e.g. engine) or, under the location key, additional FilesLocation fields (e.g. glob_pattern)

Returns:

data with legacy_key replaced by new_key

Raises:

InvalidConfigurationError – If both legacy_key and new_key are given

Return type:

Any