armi package

Welcome to the Advanced Reactor Modeling Interface (ARMI).

This module initializes the ARMI platform. The bootstrap process is broken into several phases:

  • Import fundamental dependencies in Python library and some third-party libs

  • Investigate environment: Check Python version, check code version, check MPI situation, check for TTY/GUI/interactivity,

  • Set up temp dirs

  • Set up printout table formats (in preparation of logging info)

  • Initialize all possible nuclide objects in the nuclide directory

  • Discover and register available built-in plugins (custom ones registered after input available)

  • Discover and define all potential configuration settings from available plugins

  • Read input files

  • Update nuclide directory with depletion info based on config

  • Discover and define all state Parameters on data model (possibly dependent on config)

  • Discover Entry points from plugins

  • Choose entry point based on user command

If using the run entry point, additional work is done:

  • Build reactor model based on input

  • Build operator object with specific calculation loop

  • Build ordered interface stack based on configuration settings

  • Begin looping over interface stack, operating upon data model according to operator design

  • Loop until complete

  • Wrap up

  • Quit

armi.isStableReleaseVersion(version=None)[source]

Determine if the version should be considered a stable release

armi._registerUserPlugin(plugManager, userPluginName)[source]

Register one individual user plugin by name.

armi.init(choice=None, fName=None, cs=None)[source]

Scan a directory for armi inputs and load one to interact with.

Parameters
  • choice (int, optional) – Automatically run with this item out of the menu that would be produced of existing xml files.

  • fName (str, optional) – An actual case name to load. e.g. ntTwr1.xml

  • cs (object, optional) – If supplied, supercede the other case input methods and use the object directly

Examples

>>> o = armi.init()
armi.getDefaultPlugins() → List[Type[armi.plugins.ArmiPlugin]][source]

Return a list containing the default set of ARMI Framework plugins.

This is useful for an application to fold all of the ARMI Framework’s capabilities into its own set of plugins.

armi.getDefaultPluginManager() → armi.pluginManager.ArmiPluginManager[source]

Return a plugin manager containing the default set of ARMI Framework plugins.

This is useful when using standalone facilities of ARMI without a specific application.

armi.isConfigured()[source]

Returns whether ARMI has been configured with an App.

armi.getPluginManager() → Optional[armi.pluginManager.ArmiPluginManager][source]

Return the plugin manager, if there is one.

armi.getPluginManagerOrFail() → armi.pluginManager.ArmiPluginManager[source]

Return the plugin manager. Raise an error if there is none.

armi.getApp() → Optional[armi.apps.App][source]
armi._cleanupOnCancel(signum, _frame)[source]

Helper function to clean up upon cancellation.

armi._liveInterpreter()[source]

Return whether we are running within a live/interactive python interpreter.

armi.configure(app: Optional[armi.apps.App] = None, permissive=False)[source]

Set the plugin manager for the Framework and configure internals to those plugins.

Parameters
  • app – An armi.apps.App instance with which the framework is to be configured. If it is not provided, then the default ARMI App will be used.

  • permissive – Whether or not an error should be produced if configure is called more than once. This should only be set to True under testing or demonstration purposes, where the contents of otherwise independent scripts need to be run under the same python instance.

Important

Since this affects the behavior of several modules at their import time, it is generally not safe to re-configure the ARMI framework once it has been configured. Therefore this will raise an RuntimeError if such a re-configuration is attempted, unless permissive is set to True.

Notes

We are planning on encapsulating much of the global ARMI state that gets configured with an App into the App object itself (with some other things going into the Case object). This will provide a number of benefits, the main one being that it will become trivial to re-configure the framework, which is currently not possible.

armi.applyAsyncioWindowsWorkaround()[source]

Apply Asyncio workaround for Windows and Python 3.8.

This prevents a NotImplementedError on Windows with Python 3.8 his error showed up during jupyter notebook built-tests and documentation. See https://bugs.python.org/issue37373

Subpackages