armi.settings.setting module¶
This defines a Setting object and its subclasses that populate the Settings object.
This module is really only needed for its interactions with the submitter GUI.
-
class
armi.settings.setting.Setting(name, underlyingType, attrib)[source]¶ Bases:
objectHelper class to Settings
Holds a factory to instantiate the correct sub-type based on the input dictionary with a few expected keywords. Setting objects hold all associated information of a setting in ARMI and should typically be accessed through the Settings class methods rather than directly. The exception being the SettingAdapter class designed for additional GUI related functionality
- Initialization used in all subclass calls, some values are to be overwritten
as they are either uniquely made or optional values.
All set values should be run through the convertType(self.name,) function as Setting is so closely tied to python types being printed to strings and parsed back, convertType(self.name,) should cleanly fetch any python values.
- Parameters
name (str) – the setting’s name
underlyingType (type) – The setting’s type
attrib (dict) – the storage bin with the strictly named attributes of the setting
-
self.underlyingType¶ explicity states the type of setting, usually a python type, but potentially something like ‘file’
- Type
type
-
self.value¶ the setting value stored
- Type
select allowed python types
-
self.default¶ the backup value of self.value to regress to if desired
- Type
always the same as value
-
self.description¶ the helpful description of the purpose and use of a setting, primarily used for GUI tooltip strings
- Type
str
-
self.label¶ the shorter description used for the ARMI GUI
- Type
str
-
name¶
-
description¶
-
label¶
-
underlyingType¶
-
property
schema¶
-
property
default¶
-
property
value¶
-
revertToDefault()[source]¶ Revert a setting back to its default.
Notes
Skips the property setter because default val should already be validated.
-
isDefault()[source]¶ Returns a boolean based on whether or not the setting equals its default value
It’s possible for a setting to change and not be reported as such when it is changed back to its default. That behavior seems acceptable.
-
property
offDefault¶ Return True if the setting is not the default value for that setting.
-
class
armi.settings.setting.BoolSetting(name, attrib)[source]¶ Bases:
armi.settings.setting.SettingSetting surrounding a python boolean
No new attributes have been added
- Initialization used in all subclass calls, some values are to be overwritten
as they are either uniquely made or optional values.
All set values should be run through the convertType(self.name,) function as Setting is so closely tied to python types being printed to strings and parsed back, convertType(self.name,) should cleanly fetch any python values.
- Parameters
name (str) – the setting’s name
underlyingType (type) – The setting’s type
attrib (dict) – the storage bin with the strictly named attributes of the setting
-
self.underlyingType¶ explicity states the type of setting, usually a python type, but potentially something like ‘file’
- Type
type
-
self.value¶ the setting value stored
- Type
select allowed python types
-
self.default¶ the backup value of self.value to regress to if desired
- Type
always the same as value
-
self.description¶ the helpful description of the purpose and use of a setting, primarily used for GUI tooltip strings
- Type
str
-
self.label¶ the shorter description used for the ARMI GUI
- Type
str
-
class
armi.settings.setting.IntSetting(name, attrib)[source]¶ Bases:
armi.settings.setting._NumericSettingSetting surrounding a python integer
- Initialization used in all subclass calls, some values are to be overwritten
as they are either uniquely made or optional values.
All set values should be run through the convertType(self.name,) function as Setting is so closely tied to python types being printed to strings and parsed back, convertType(self.name,) should cleanly fetch any python values.
- Parameters
name (str) – the setting’s name
underlyingType (type) – The setting’s type
attrib (dict) – the storage bin with the strictly named attributes of the setting
-
self.underlyingType¶ explicity states the type of setting, usually a python type, but potentially something like ‘file’
- Type
type
-
self.value¶ the setting value stored
- Type
select allowed python types
-
self.default¶ the backup value of self.value to regress to if desired
- Type
always the same as value
-
self.description¶ the helpful description of the purpose and use of a setting, primarily used for GUI tooltip strings
- Type
str
-
self.label¶ the shorter description used for the ARMI GUI
- Type
str
-
class
armi.settings.setting.FloatSetting(name, attrib)[source]¶ Bases:
armi.settings.setting._NumericSettingSetting surrounding a python float
- Initialization used in all subclass calls, some values are to be overwritten
as they are either uniquely made or optional values.
All set values should be run through the convertType(self.name,) function as Setting is so closely tied to python types being printed to strings and parsed back, convertType(self.name,) should cleanly fetch any python values.
- Parameters
name (str) – the setting’s name
underlyingType (type) – The setting’s type
attrib (dict) – the storage bin with the strictly named attributes of the setting
-
self.underlyingType¶ explicity states the type of setting, usually a python type, but potentially something like ‘file’
- Type
type
-
self.value¶ the setting value stored
- Type
select allowed python types
-
self.default¶ the backup value of self.value to regress to if desired
- Type
always the same as value
-
self.description¶ the helpful description of the purpose and use of a setting, primarily used for GUI tooltip strings
- Type
str
-
self.label¶ the shorter description used for the ARMI GUI
- Type
str
-
class
armi.settings.setting.StrSetting(name, attrib)[source]¶ Bases:
armi.settings.setting.SettingSetting surrounding a python string
-
self.options¶ OPTIONAL - a list of strings that self.value is allowed to be set as
- Type
list
-
self.enforcedOptions¶ OPTIONAL - toggles whether or not we care about self.options
- Type
bool
- Initialization used in all subclass calls, some values are to be overwritten
as they are either uniquely made or optional values.
All set values should be run through the convertType(self.name,) function as Setting is so closely tied to python types being printed to strings and parsed back, convertType(self.name,) should cleanly fetch any python values.
- Parameters
name (str) – the setting’s name
underlyingType (type) – The setting’s type
attrib (dict) – the storage bin with the strictly named attributes of the setting
-
self.underlyingType¶ explicity states the type of setting, usually a python type, but potentially something like ‘file’
- Type
type
-
self.value¶ the setting value stored
- Type
select allowed python types
-
self.default¶ the backup value of self.value to regress to if desired
- Type
always the same as value
-
self.description¶ the helpful description of the purpose and use of a setting, primarily used for GUI tooltip strings
- Type
str
-
self.label¶ the shorter description used for the ARMI GUI
- Type
str
-
options¶
-
enforcedOptions¶
-
-
class
armi.settings.setting.PathSetting(name, attrib)[source]¶ Bases:
armi.settings.setting.StrSettingSetting surrounding a python string file path
Allows for paths relative to various dynamic ARMI environment variables
- Initialization used in all subclass calls, some values are to be overwritten
as they are either uniquely made or optional values.
All set values should be run through the convertType(self.name,) function as Setting is so closely tied to python types being printed to strings and parsed back, convertType(self.name,) should cleanly fetch any python values.
- Parameters
name (str) – the setting’s name
underlyingType (type) – The setting’s type
attrib (dict) – the storage bin with the strictly named attributes of the setting
-
self.underlyingType¶ explicity states the type of setting, usually a python type, but potentially something like ‘file’
- Type
type
-
self.value¶ the setting value stored
- Type
select allowed python types
-
self.default¶ the backup value of self.value to regress to if desired
- Type
always the same as value
-
self.description¶ the helpful description of the purpose and use of a setting, primarily used for GUI tooltip strings
- Type
str
-
self.label¶ the shorter description used for the ARMI GUI
- Type
str
-
relativeTo¶
-
mustExist¶
-
class
armi.settings.setting.ListSetting(name, attrib)[source]¶ Bases:
armi.settings.setting.SettingSetting surrounding a python list
-
self.containedType¶ OPTIONAL - used to ensure all items in the list conform to this specified type, if omitted the list is free to hold anything
- Type
any python type
- Initialization used in all subclass calls, some values are to be overwritten
as they are either uniquely made or optional values.
All set values should be run through the convertType(self.name,) function as Setting is so closely tied to python types being printed to strings and parsed back, convertType(self.name,) should cleanly fetch any python values.
- Parameters
name (str) – the setting’s name
underlyingType (type) – The setting’s type
attrib (dict) – the storage bin with the strictly named attributes of the setting
-
self.underlyingType¶ explicity states the type of setting, usually a python type, but potentially something like ‘file’
- Type
type
-
self.value¶ the setting value stored
- Type
select allowed python types
-
self.default¶ the backup value of self.value to regress to if desired
- Type
always the same as value
-
self.description¶ the helpful description of the purpose and use of a setting, primarily used for GUI tooltip strings
- Type
str
-
self.label¶ the shorter description used for the ARMI GUI
- Type
str
-
containedType¶
-
options¶
-
enforcedOptions¶
-
property
value¶
-
property
default¶
-