Skip to content

Commit

Permalink
Releasing ARMI version 0.5.0 (terrapower#2009)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science authored Nov 20, 2024
1 parent 81631c0 commit e13de1a
Show file tree
Hide file tree
Showing 9 changed files with 203 additions and 180 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ permissions:

jobs:
stale:
# This workflow is not designed to make sense on forks
if: github.repository == 'terrapower/armi'
runs-on: ubuntu-24.04
steps:
- uses: actions/stale@v8
Expand Down
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,9 @@ like ARMI somewhat recently.
ARMI has been written to support specific engineering/design tasks. As such, polish in
the GUIs and output is somewhat lacking.

Most of our code is in the ``camelCase`` style, which is not the normal style for
Python. This started in 2009 and we have stuck with the convention.
The ARMI framework uses the ``camelCase`` style, which is not the standard style for Python. As this
is an issue of style, it is not considered worth the API-breaking cost to our downstream users to
change it.


License
Expand Down
10 changes: 5 additions & 5 deletions armi/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,12 @@ def beforeReactorConstruction(cs) -> None:
Function to call before the reactor is constructed.
.. impl:: Plugins can inject code before reactor initialization.
:id: I_ARMI_PLUGIN_BEFORE_REACTOR_HOOK
:implements: R_ARMI_PLUGIN_BEFORE_REACTOR_HOOK
:id: I_ARMI_SETTINGS_BEFORE_REACTOR_HOOK
:implements: R_ARMI_SETTINGS_BEFORE_REACTOR_HOOK
This method allows for plugin developers to implement code after settings
are loaded but before the reactor is constructed. This hook is called
in :py:func:`armi.reactor.reactors.factory`.
This method allows for plugin developers to implement code after settings are loaded but
before the reactor is constructed. This hook is called in
:py:func:`armi.reactor.reactors.factory`.
"""

@staticmethod
Expand Down
4 changes: 2 additions & 2 deletions armi/tests/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ def test_beforeReactorConstructionHook(self):
"""Test that plugin hook successfully injects code before reactor initialization.
.. test:: Capture code in the beforeReactorConstruction hook from reactor construction being carried out.
:id: T_ARMI_PLUGIN_BEFORE_REACTOR_HOOK
:tests: R_ARMI_PLUGIN_BEFORE_REACTOR_HOOK
:id: T_ARMI_SETTINGS_BEFORE_REACTOR_HOOK
:tests: R_ARMI_SETTINGS_BEFORE_REACTOR_HOOK
"""
pm = getPluginManagerOrFail()
pm.register(BeforeReactorPlugin)
Expand Down
82 changes: 36 additions & 46 deletions doc/developer/guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,41 @@
Framework Architecture
**********************

Here we will discuss some big-picture elements of the ARMI architecture. Throughout,
links to the API docs will lead to additional details.

The Reactor Model
=================

The :py:mod:`~armi.reactor` package is the central representation of a nuclear reactor
in ARMI. All modules can be expected to want access to some element of the state data
in a run, and should be enabled to find the data present somewhere in the ``reactor``
package's code during runtime.

An approximation of `Composite Design Pattern
<http://en.wikipedia.org/wiki/Composite_pattern>`_ is used to represent the **Reactor**
in ARMI. In this hierarchy the **Reactor** object has a child **Core** object, and
potentially many generic **Composite** child objects representing ex-core structures.
The **Core** is made of **Assembly** objects, which are in turn made up as a collection
of **Block** objects. :term:`State <reactor state>` variables may be stored at any level
of this hierarchy using the :py:mod:`armi.reactor.parameters` system to contain results
(e.g., ``keff``, ``flow rates``, ``power``, ``flux``, etc.). Within each block are
**Components** that define the pin-level geometry. Associated with each Component are
**Material** objects that contain material properties (``density``, ``conductivity``,
``heat capacity``, etc.) and isotopic mass fractions.

.. note:: Non-core structures (spent fuel pools, core restraint, heat exchangers, etc.)
may be represented analogously to the **Core**, but this feature is new and under
development. Historically, the **Core** and **Reactor** were the same thing, and some
information in the documentation still reflects this.
What follows is a discussion of the high-level elements of the ARMI framework. Throughout, links to
the API docs will be provided for additional details.

The Reactor Data Model
======================

The ARMI framework represents a nuclear reactor via a reactor data model, which is defined in the
:py:mod:`~armi.reactor` package. Each physical piece of the nuclear reactor is defined by a Python
object, called an :py:class:`ArmiObject <armi.reactor.composites.ArmiObject>`. Each ``ArmiObject``
has associated data like: shape, material, or other physical values. The physical values can be
nearly anything, and are attached to the data model via ARMI's
:py:mod:`Parameter <armi.reactor.parameters>` system. Example parameters might be: ``keff``,
``flow rates``, ``power``, ``flux``, etc.

The reactor data model is a hierarchical model, following the `Composite Design Pattern
<http://en.wikipedia.org/wiki/Composite_pattern>`_. The top of the data model is the
:py:class:`Reactor <armi.reactor.reactors.Reactor>`, which contains one
:py:class:`Core <armi.reactor.cores.Core>` object and a collection of zero or more
:py:class:`ExcoreStructures <armi.reactor.excoreStructure.ExcoreStructure>`. An example
``ExcoreStructure`` might be a :py:class:`SpentFuelPool <armi.reactor.spentFuelPool.SpentFuelPool>`.

For now, the ``Core`` object in ARMI assumes it contains **Assembly** objects, which are in turn
made up as a collection of **Block** objects. The leaves of the the Composite Model in the ARMI
framework are called :py:class:`Component <armi.reactor.components.component.Component>`.

.. figure:: /.static/armi_reactor_objects.png
:align: center

The primary data containers in ARMI

Each level of the composite pattern hierarchy contains most of its state data in a
collection of parameters detailing considerations of how the reactor has progressed
through time to any given point. This information also constitutes the majority of what
gets written to the database for evaluation and/or follow-on analysis.
Time-evolving the parameters on the reactor composite hierarchy is what most modelers and analysts
will want from the ARMI framework.

Review the data model :ref:`armi-tutorials` section for examples
exploring a populated instance of the **Reactor** model.
Review the data model :ref:`armi-tutorials` section for examples exploring a populated instance of
the ``Reactor`` data model.

Finding objects in a model
--------------------------
Expand Down Expand Up @@ -101,8 +96,7 @@ various physics operations.

For example, some lattice physics routines convert the full core to a 2D R-Z model and
compute flux with thousands of energy groups to properly capture the spectral-spatial
coupling in a core/reflector interface. The converters are used heavily in these
operations.
coupling in a core/reflector interface. The converters are used heavily in these operations.

Blueprints
----------
Expand Down Expand Up @@ -160,7 +154,7 @@ configuration (such as Fuel management, and depletion) are disabled.
The Interface Stack
-------------------
*Interfaces* (:py:class:`armi.interfaces.Interface`) operate upon the Reactor Model to
do analysis. They're designed to allow expansion of the code in a natural and
do analysis. They're designed to allow expansion of the code in a natural and
well-organized manner. Interfaces are useful to link external codes to ARMI as well for
adding new internal physics into the rest of the system. As a result, very many aspects
of ARMI are contained within interfaces.
Expand Down Expand Up @@ -235,7 +229,7 @@ hooks include:
after every node step/flux calculation, if tight physics coupling is active.

These interaction points are optional in every interface, and you may override one or
more of them to suit your needs. You should not change the arguments to the hooks,
more of them to suit your needs. You should not change the arguments to the hooks,
which are integers.

Each interface has a ``enabled`` flag. If this is set to ``False``, then the interface's
Expand All @@ -252,7 +246,6 @@ When using the Operators that come with ARMI, Interfaces are discovered using th
:py:meth:`createInterfaces <armi.operators.operator.Operator.createInterfaces>` method.



How interfaces get called
-------------------------

Expand All @@ -269,9 +262,9 @@ To use interfaces in parallel, please refer to :py:mod:`armi.mpiActions`.
Plugins
=======

Plugins are higher-level objects that can bring in one or more Interfaces, settings
definitions, parameters, validations, etc. They are documented in
:ref:`armi-app-making` and :py:mod:`armi.plugins`.
Plugins are higher-level objects that can add things to the simulations like Interfaces, settings
definitions, parameters, validations, etc. They are documented in :ref:`armi-app-making` and
:py:mod:`armi.plugins`.


Entry Points
Expand All @@ -282,9 +275,6 @@ invoke ARMI with ``python -m armi run``, the ``__main__.py`` file is loaded and
valid Entry Points are dynamically loaded. The proper entry point (in this case,
:py:class:`armi.cli.run.RunEntryPoint`) is invoked. As ARMI initializes itself, settings
are loaded into a :py:class:`Settings <armi.settings.caseSettings.Settings>`
object. From those settings, an :py:class:`Operator <armi.operators.operator.Operator>`
object. From those settings, an :py:class:`Operator <armi.operators.operator.Operator>`
subclass is built by a factory and its ``operate`` method is called. This fires up the
main ARMI analysis loop and its interface stack is looped over as indicated by user
input.


main ARMI analysis loop and its interface stack is looped over as indicated by user input.
86 changes: 1 addition & 85 deletions doc/release/0.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,90 +2,6 @@
ARMI v0.4 Release Notes
***********************

ARMI v0.4.1
===========
Release Date: TBD

New Features
------------
#. Adding data models for ex-core structures in ARMI. (`PR#1891 <https://github.com/terrapower/armi/pull/1891>`_)
#. ARMI now supports Python 3.12. (`PR#1813 <https://github.com/terrapower/armi/pull/1813>`_)
#. Removing the ``tabulate`` dependency by ingesting it to ``armi.utils.tabulate``. (`PR#1811 <https://github.com/terrapower/armi/pull/1811>`_)
#. Adding ``--skip-inspection`` flag to ``CompareCases`` CLI. (`PR#1842 <https://github.com/terrapower/armi/pull/1842>`_)
#. Allow merging a component with zero area into another component. (`PR#1858 <https://github.com/terrapower/armi/pull/1858>`_)
#. Use ``Block.getNumPins()`` in ``HexBlock._rotatePins()``. (`PR#1859 <https://github.com/terrapower/armi/pull/1859>`_)
#. Provide utilities for determining location of a rotated object in a hexagonal lattice (``getIndexOfRotatedCell``). (`PR#1846 <https://github.com/terrapower/armi/1846>`_)
#. Allow merging a component with zero area into another component. (`PR#1858 <https://github.com/terrapower/armi/pull/1858>`_)
#. Provide ``Parameter.hasCategory`` for quickly checking if a parameter is defined with a given category. (`PR#1899 <https://github.com/terrapower/armi/pull/1899>`_)
#. Provide ``ParameterCollection.where`` for efficient iteration over parameters who's definition matches a given condition. (`PR#1899 <https://github.com/terrapower/armi/pull/1899>`_)
#. Flags can now be defined with letters and numbers. (`PR#1966 <https://github.com/terrapower/armi/pull/1966>`_)
#. Plugins can provide the ``getAxialExpansionChanger`` hook to customize axial expansion. (`PR#1870 <https://github.com/terrapower/armi/pull/1870>`_)
#. ``HexBlock.rotate`` updates the spatial locator for children of that block. (`PR#1943 <https://github.com/terrapower/armi/pull/1943>`_)
#. New plugin hook ``beforeReactorConstruction`` added to enable plugins to process case settings before reactor init. (`PR#1945 <https://github.com/terrapower/armi/pull/1945>`_)
#. Provide ``Block.getInputHeight`` for determining the height of a block from blueprints. (`PR#1927 <https://github.com/terrapower/armi/pull/1927>`_)
#. Improve performance by changing the lattice physics interface so that cross sections are not updated on ``everyNode`` calls during coupled calculations (`PR#1963 <https://github.com/terrapower/armi/pull/1963>`_)
#. Improve efficiency of reaction rate calculations. (`PR#1887 <https://github.com/terrapower/armi/pull/1887>`_)
#. Adding support for ENDF/B-VII.1-based MC2-3 libraries. (`PR#1982 <https://github.com/terrapower/armi/pull/1982>`_)
#. Adding new options for simplifying 1D cross section modeling. (`PR#1949 <https://github.com/terrapower/armi/pull/1949>`_)
#. Updating ``copyOrWarn`` and ``getFileSHA1Hash`` to support directories. (`PR#1984 <https://github.com/terrapower/armi/pull/1984>`_)
#. Exposing ``detailedNDens`` to components. (`PR#1954 <https://github.com/terrapower/armi/pull/1954>`_)
#. TBD

API Changes
-----------
#. Removing flags ``CORE`` and ``REACTOR``. (`PR#1835 <https://github.com/terrapower/armi/pull/1835>`_)
#. Alphabetizing ``Flags.toString()`` results. (`PR#1912 <https://github.com/terrapower/armi/pull/1912>`_)
#. Moving ``settingsValidation`` from ``operators`` to ``settings``. (`PR#1895 <https://github.com/terrapower/armi/pull/1895>`_)
#. Removing deprecated method ``prepSearch``. (`PR#1845 <https://github.com/terrapower/armi/pull/1845>`_)
#. Removing unused function ``SkippingXsGen_BuChangedLessThanTolerance``. (`PR#1845 <https://github.com/terrapower/armi/pull/1845>`_)
#. Renaming ``Reactor.moveList`` to ``Reactor.moves``. (`PR#1881 <https://github.com/terrapower/armi/pull/1881>`_)
#. ``copyInterfaceInputs`` no longer requires a valid setting object. (`PR#1934 <https://github.com/terrapower/armi/pull/1934>`_)
#. Removing ``buildEqRingSchedule``. (`PR#1928 <https://github.com/terrapower/armi/pull/1928>`_)
#. Removing broken plot ``buVsTime``. (`PR#1994 <https://github.com/terrapower/armi/pull/1994>`_)
#. Allowing for unknown Flags when opening a DB. (`PR#1844 <https://github.com/terrapower/armi/pull/1835>`_)
#. Removing ``Assembly.doubleResolution()``. (`PR#1951 <https://github.com/terrapower/armi/pull/1951>`_)
#. Removing ``assemblyLists.py`` and the ``AssemblyList`` class. (`PR#1891 <https://github.com/terrapower/armi/pull/1891>`_)
#. Removing ``Assembly.rotatePins`` and ``Block.rotatePins``. Prefer ``Assembly.rotate`` and ``Block.rotate``. (`PR#1846 <https://github.com/terrapower/armi/1846>`_)
#. Removing unused setting ``autoGenerateBlockGrids``. (`PR#1947 <https://github.com/terrapower/armi/pull/1947>`_)
#. Transposing ``pinMgFluxes`` parameters so that leading dimension is pin index. (`PR#1937 <https://github.com/terrapower/armi/pull/1937>`_)
#. ``Block.getPinCoordinates`` returns an ``(N, 3)`` array, rather than a length ``N`` list of three-length arrays. (`PR#1943 <https://github.com/terrapower/armi/pull/1943>`_)
#. Removing ``globalFluxInterface.DoseResultsMapper`` class. (`PR#1952 <https://github.com/terrapower/armi/pull/1952>`_)
#. Removing setting ``mpiTasksPerNode`` and renaming ``numProcessors`` to ``nTasks``. (`PR#1958 <https://github.com/terrapower/armi/pull/1958>`_)
#. Changing ``synDbAfterWrite`` default to ``True``. (`PR#1968 <https://github.com/terrapower/armi/pull/1968>`_)
#. Removing unused class ``SmartList``. (`PR#1992 <https://github.com/terrapower/armi/pull/1992>`_)
#. `nuclideBases.byMcc3ID` and `getMcc3Id()` return IDs consistent with ENDF/B-VII.1. (`PR#1982 <https://github.com/terrapower/armi/pull/1982>`_)
#. TBD

Bug Fixes
---------
#. Fixed spatial grids of pins in Blocks on flats-up grids. (`PR#1947 <https://github.com/terrapower/armi/pull/1947>`_)
#. Fixed ``DerivedShape.getArea`` for ``cold=True``. (`PR#1831 <https://github.com/terrapower/armi/pull/1831>`_)
#. Fixed error parsing command line integers in ``ReportsEntryPoint``. (`PR#1824 <https://github.com/terrapower/armi/pull/1824>`_)
#. Fixed ``PermissionError`` when using ``syncDbAfterWrite``. (`PR#1857 <https://github.com/terrapower/armi/pull/1857>`_)
#. Fixed ``MpiDirectoryChanger``. (`PR#1853 <https://github.com/terrapower/armi/pull/1853>`_)
#. Changed data type of ``thKernel`` setting from ``bool`` to ``str`` in ``ThermalHydraulicsPlugin``. (`PR#1855 <https://github.com/terrapower/armi/pull/1855>`_)
#. Update height of fluid components after axial expansion. (`PR#1828 <https://github.com/terrapower/armi/pull/1828>`_)
#. Rotate hexagonal assembly patches correctly on facemap plots. (`PR#1883 <https://github.com/terrapower/armi/pull/1883>`_)
#. Material theoretical density is serialized to and read from database. (`PR#1852 <https://github.com/terrapower/armi/pull/1852>`_)
#. Removed broken and unused column in ``summarizeMaterialData``. (`PR#1925 <https://github.com/terrapower/armi/pull/1925>`_)
#. Fixed hex block rotation in ``plotBlockDiagram``. (`PR#1926 <https://github.com/terrapower/armi/pull/1926>`_)
#. Fixed edge case in ``assemblyBlueprint._checkParamConsistency()``. (`PR#1928 <https://github.com/terrapower/armi/pull/1928>`_)
#. Fixed wetted perimeter for hex inner ducts. (`PR#1985 <https://github.com/terrapower/armi/pull/1985>`_)
#. TBD

Quality Work
------------
#. Removing deprecated code ``axialUnitGrid``. (`PR#1809 <https://github.com/terrapower/armi/pull/1809>`_)
#. Refactoring ``axialExpansionChanger``. (`PR#1861 <https://github.com/terrapower/armi/pull/1861>`_)
#. Raising a ValueError when database load fails. (`PR#1940 <https://github.com/terrapower/armi/pull/1940>`_)
#. Changes to make axial expansion related classes more extensible. (`PR#1920 <https://github.com/terrapower/armi/pull/1920>`_)
#. TBD

Changes that Affect Requirements
--------------------------------
#. TBD


ARMI v0.4.0
===========
Release Date: 2024-07-29
Expand Down Expand Up @@ -160,6 +76,6 @@ Quality Work

Changes that Affect Requirements
--------------------------------
#. Very minor change to ``Block.coords()``, removing unused argument. (`PR#1651 <https://github.com/terrapower/armi/pull/1651>`_)
#. Removing unused argument to ``Block.coords()``. (`PR#1651 <https://github.com/terrapower/armi/pull/1651>`_)
#. Touched ``HexGrid`` by adding a "cornersUp" property and fixing two bugs. (`PR#1649 <https://github.com/terrapower/armi/pull/1649>`_)
#. Very slightly modified the implementation of ``Assembly.add()``. (`PR#1670 <https://github.com/terrapower/armi/pull/1670>`_)
Loading

0 comments on commit e13de1a

Please sign in to comment.