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: object

Helper 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
__getstate__()[source]

Get the state of the setting; required when __slots__ are defined

__setstate__(state)[source]

Set the state of the setting; required when __slots__ are defined

setValue(v)[source]
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.

getDefaultAttributes()[source]

Returns values associated with the default initialization write out of settings

Excludes the stored name of the setting

getCustomAttributes()[source]

Returns values associated with a more terse write out of settings

static factory(key, attrib)[source]

The initialization method for the subclasses of Setting.

class armi.settings.setting.BoolSetting(name, attrib)[source]

Bases: armi.settings.setting.Setting

Setting 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

setValue(v)[source]

Protection against setting the value to an invalid/unexpected type

class armi.settings.setting.IntSetting(name, attrib)[source]

Bases: armi.settings.setting._NumericSetting

Setting 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._NumericSetting

Setting 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.Setting

Setting 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
setValue(v)[source]

Protection against setting the value to an invalid/unexpected type

getDefaultAttributes()[source]

Adds in the new attributes to the default attribute grab of the base

class armi.settings.setting.PathSetting(name, attrib)[source]

Bases: armi.settings.setting.StrSetting

Setting 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
setValue(v)[source]

Protection against setting the value to an invalid/unexpected type

getDefaultAttributes()[source]

Adds in the new attributes to the default attribute grab of the base

class armi.settings.setting.ListSetting(name, attrib)[source]

Bases: armi.settings.setting.Setting

Setting 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
setValue(v)[source]

Protection against setting the value to an invalid/unexpected type

getDefaultAttributes()[source]

Adds in the new attributes to the default attribute grab of the base