armi.scripts.migration.base module

Base migration classes.

A classic migration takes a file name, read the files, migrates the data, and re-writes the file. Some migrations need to happen live on a stream. For example, if an old/invalid input file is being read in from an old database. The migration class defined here chooses this behavior based on whether the stream or path variables are given in the constructor.

class armi.scripts.migration.base.Migration(stream=None, path=None)[source]

Bases: object

Generic migration.

To implement a concrete Migration, one must often only implement the _applyToStream method.

fromVersion = 'x.x.x'
toVersion = 'x.x.x'
apply()[source]

Apply migration.

This is generally called from a subclass.

_loadStreamFromPath()[source]

Common stream-loading code. Must be extended to actually load.

The operative subclasses implementing this method are below.

_applyToStream()[source]

Add actual migration code here in a subclass.

_backupOriginal()[source]
_writeNewFile(newStream)[source]
class armi.scripts.migration.base.BlueprintsMigration(stream=None, path=None)[source]

Bases: armi.scripts.migration.base.Migration

Migration for blueprints input.

_loadStreamFromPath()[source]

Common stream-loading code. Must be extended to actually load.

The operative subclasses implementing this method are below.

class armi.scripts.migration.base.SettingsMigration(stream=None, path=None)[source]

Bases: armi.scripts.migration.base.Migration

Migration for settings input.

_loadStreamFromPath()[source]

Common stream-loading code. Must be extended to actually load.

The operative subclasses implementing this method are below.

class armi.scripts.migration.base.GeomMigration(stream=None, path=None)[source]

Bases: armi.scripts.migration.base.Migration

Migration for non-blueprints geometry input.

_loadStreamFromPath()[source]

Common stream-loading code. Must be extended to actually load.

The operative subclasses implementing this method are below.

class armi.scripts.migration.base.DatabaseMigration(stream=None, path=None)[source]

Bases: armi.scripts.migration.base.Migration

Migration for db output.