scexao-org / vampires_dpp

Tools for processing VAMPIRES data
MIT License
3 stars 3 forks source link

config upgrade script #5

Closed mileslucas closed 1 year ago

mileslucas commented 1 year ago

It would be convenient to provide an upgrade script between versions of the pipeline for the configuration files. This can help automate the deprecation of old features and smooths over cases where the config only needs small (sometimes automatable) updates. Example usage

dpp upgrade old_config.toml

I think the implementation will have to chain every single version together. I.e., (psuedo-code)

min_vers = find_last conf_version < version
_conf = config
for each version > min_vers
    _conf = convert(version, _conf.version)

This way there's only one function I need to write when I change something, rather than having the exponential task of converting all previous versions to the new version.