Skip to content

Commit

Permalink
update tabulation for tabulate 0.9.0
Browse files Browse the repository at this point in the history
tabulate 0.9.0 crashes when you feed it a non-scalar value
for a cell entry.
  • Loading branch information
mgjarrett committed Jun 6, 2024
1 parent 32ad281 commit 7f2124a
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions armi/physics/neutronics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
import numpy
import tabulate

from armi import plugins
from armi import runLog
from armi import plugins, runLog
from armi.physics.neutronics.const import CONF_CROSS_SECTION


Expand Down Expand Up @@ -79,8 +78,8 @@ def defineEntryPoints():
@plugins.HOOKIMPL
def defineSettings():
"""Define settings for the plugin."""
from armi.physics.neutronics import settings as neutronicsSettings
from armi.physics.neutronics import crossSectionSettings
from armi.physics.neutronics import settings as neutronicsSettings
from armi.physics.neutronics.fissionProductModel import (
fissionProductModelSettings,
)
Expand All @@ -99,10 +98,10 @@ def defineSettings():
@plugins.HOOKIMPL
def defineSettingsValidators(inspector):
"""Implementation of settings inspections for neutronics settings."""
from armi.physics.neutronics.settings import getNeutronicsSettingValidators
from armi.physics.neutronics.fissionProductModel.fissionProductModelSettings import (
getFissionProductModelSettingValidators,
)
from armi.physics.neutronics.settings import getNeutronicsSettingValidators

settingsValidators = getNeutronicsSettingValidators(inspector)
settingsValidators.extend(getFissionProductModelSettingValidators(inspector))
Expand Down Expand Up @@ -133,7 +132,6 @@ def getReportContents(r, cs, report, stage, blueprint):
RESTARTFILES,
)


# ARC and CCCC cross section file format names
COMPXS = "COMPXS"
PMATRX = "PMATRX"
Expand Down Expand Up @@ -252,18 +250,20 @@ def applyEffectiveDelayedNeutronFractionToCore(core, cs):
core.p.betaDecayConstants = numpy.array(decayConstants)

reportTableData.append(("Total Delayed Neutron Fraction", core.p.beta))
reportTableData.append(
("Group-wise Delayed Neutron Fractions", core.p.betaComponents)
)
reportTableData.append(
("Group-wise Precursor Decay Constants", core.p.betaDecayConstants)
)
for i, betaComponent in enumerate(core.p.betaComponents):
reportTableData.append(
(f"Group {i} Delayed Neutron Fractions", betaComponent)
)
for i, decayConstant in enumerate(core.p.betaDecayConstants):
reportTableData.append(
("Group {i} Precursor Decay Constants", decayConstant)
)

# Report to the user the values were not applied.
if not reportTableData and (beta is not None or decayConstants is not None):
runLog.warning(
f"Delayed neutron fraction(s) - {beta} and decay constants"
" - {decayConstants} have not been applied."
f" - {decayConstants} have not been applied."
)
else:
runLog.extra(
Expand Down

0 comments on commit 7f2124a

Please sign in to comment.