armi.scripts.migration.m0_1_0_newDbFormat module

Migrate ARMI databases to newer versions.

Oftentimes, code changes cause databases from previous versions to become invalid, yet users still want to be able to load from the old cases. These scripts assist in converting old databases to new ones.

This is expected to be extended with version-dependent chains.

class armi.scripts.migration.m0_1_0_newDbFormat.ConvertDB2toDB3(stream=None, path=None)[source]

Bases: armi.scripts.migration.base.DatabaseMigration

Convert ARMI DB version 2 to DB version 3.

apply()[source]

Apply migration.

This is generally called from a subclass.

armi.scripts.migration.m0_1_0_newDbFormat._migrateDatabase(databasePath, preCollector, visitor, postApplier)[source]

Generic database-traversing system to apply custom version-specific migrations.

Parameters
  • databasePath (str) – Path to DB file to be converted

  • preCollector (callable) – Function that acts on oldDB and produces some generic data object

  • visitor (callable) – Function that will be called on each dataset of the old HDF5 database. This should map information into the new DB.

  • postApplier (callable) – Function that will run after all visiting is done. Will have acecss to the pre-collected data.

Raises

OSError – When database is not found.

armi.scripts.migration.m0_1_0_newDbFormat._visit(newDB, preCollection, name, dataset)[source]
armi.scripts.migration.m0_1_0_newDbFormat._preCollector(oldDB)[source]
armi.scripts.migration.m0_1_0_newDbFormat._postApplier(oldDB, newDB, preCollection)[source]
armi.scripts.migration.m0_1_0_newDbFormat._updateLayout(newDB, preCollection, name, dataset)[source]
armi.scripts.migration.m0_1_0_newDbFormat._updateParams(newDB, preCollection, name, dataset)[source]

Visit parameters and apply migration transformations.

Does not affect input or layout.

armi.scripts.migration.m0_1_0_newDbFormat._collectParamRenames()[source]
armi.scripts.migration.m0_1_0_newDbFormat._collectSymmetry(oldDB)[source]

Read symmetry and geomType off old-style geometry input str in DB.

armi.scripts.migration.m0_1_0_newDbFormat._applyRenames(newDB, renames, name, dataset)[source]