aiida.manage.configuration.migrations package¶
Methods and definitions of migrations for the configuration file of an AiiDA instance.
-
aiida.manage.configuration.migrations.
check_and_migrate_config
(config)[source]¶ Checks if the config needs to be migrated, and performs the migration if needed.
- Parameters
config – the configuration dictionary
- Returns
the migrated configuration dictionary
-
aiida.manage.configuration.migrations.
config_needs_migrating
(config)[source]¶ Checks if the config needs to be migrated.
If the oldest compatible version of the configuration is higher than the current configuration version defined in the code, the config cannot be used and so the function will raise.
- Returns
True if the configuration has an older version and needs to be migrated, False otherwise
- Raises
aiida.common.ConfigurationVersionError – if the config’s oldest compatible version is higher than the current
-
aiida.manage.configuration.migrations.
get_current_version
(config)[source]¶ Return the current version of the config.
- Returns
current config version or 0 if not defined
Submodules¶
Define the current configuration version and migrations.
Defines utilities for verifying the version of the configuration file and migrating it when necessary.
-
aiida.manage.configuration.migrations.utils.
check_and_migrate_config
(config)[source]¶ Checks if the config needs to be migrated, and performs the migration if needed.
- Parameters
config – the configuration dictionary
- Returns
the migrated configuration dictionary
-
aiida.manage.configuration.migrations.utils.
config_needs_migrating
(config)[source]¶ Checks if the config needs to be migrated.
If the oldest compatible version of the configuration is higher than the current configuration version defined in the code, the config cannot be used and so the function will raise.
- Returns
True if the configuration has an older version and needs to be migrated, False otherwise
- Raises
aiida.common.ConfigurationVersionError – if the config’s oldest compatible version is higher than the current