armi.settings.settingsIO module¶
This module contains classes and methods for reading and writing
Settings
, and the contained
Setting
.
- class armi.settings.settingsIO.Roots[source]¶
Bases:
object
XML tree root node common strings
- CUSTOM = 'settings'¶
- VERSION = 'version'¶
- class armi.settings.settingsIO.SettingRenamer(settings: Dict[str, armi.settings.setting.Setting])[source]¶
Bases:
object
Utility class to help with setting rename migrations.
This class stores a cache of renaming maps, derived from the
Setting.oldNames
values of the passedsettings
. Expired renames are retained, so that meaningful warning messages can be generated if one attempts to use one of them. The renaming logic follows the rules described inrenameSetting()
.- renameSetting(name) Tuple[str, bool] [source]¶
Attempt to rename a candidate setting.
- Renaming follows these rules:
If the
name
corresponds to a current setting name, do not attempt to rename it.If the
name
does not correspond to a current setting name, but is one of the active renames, return the corresponding active rename.If the
name
does not correspond to a current setting name, but is one of the expired renames, produce a warning and do not rename it.
- Parameters
name (str) – The candidate setting name to potentially rename.
- Returns
name (str) – The potentially-renamed setting
renamed (bool) – Whether the setting was actually renamed
- class armi.settings.settingsIO.SettingsReader(cs)[source]¶
Bases:
object
Abstract class for processing settings files.
- Parameters
cs (CaseSettings) – The settings object to read into
- class armi.settings.settingsIO.SettingsWriter(settings_instance, style='short')[source]¶
Bases:
object
Writes settings out to files.
This can write in two styles:
- short
setting values that are not their defaults only
- full
all setting values regardless of default status
- armi.settings.settingsIO.prompt(statement, question, *options)[source]¶
Prompt the user for some information.