diff --git a/armi/reactor/flags.py b/armi/reactor/flags.py index 8e396c72d..773adc0b2 100644 --- a/armi/reactor/flags.py +++ b/armi/reactor/flags.py @@ -260,6 +260,17 @@ def fromString(cls, typeSpec): .. impl:: Retrieve flag from a string. :id: I_ARMI_FLAG_TO_STR0 :implements: R_ARMI_FLAG_TO_STR + + For a string passed as ``typeSpec``, first converts the whole string + to uppercase. + Then tries to parse the string for any special phrases, as defined + in the module dictionary ``_CONVERSIONS``, and converts those phrases + to flags directly. + + Then splits the remaining string into separate words based on the presence + of spaces. Looping over each of the words, any numbers are stripped out + and the remaining string is matched up to any class attribute names. + If any matches are found these are returned as flags. """ def updateMethod(typeSpec): @@ -281,6 +292,12 @@ def toString(cls, typeSpec): .. impl:: Convert a flag to string. :id: I_ARMI_FLAG_TO_STR1 :implements: R_ARMI_FLAG_TO_STR + + This converts the representation of a bunch of flags from ``typeSpec``, + which might look like ``Flags.A|B``, + into a string with spaces in between the flag names, which would look + like ``'A B'``. This is done via nesting string splitting and replacement + actions. """ return str(typeSpec).split("{}.".format(cls.__name__))[1].replace("|", " ")