Skip to content

Commit

Permalink
Removing unnecessary column in print-out (#1925)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science authored Oct 4, 2024
1 parent f1f3dbe commit 484c708
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
23 changes: 7 additions & 16 deletions armi/reactor/blueprints/reactorBlueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def construct(self, cs, bp, reactor, geom=None, loadAssems=True):
"""
from armi.reactor import reactors # avoid circular import

runLog.info("Constructing the `{}`".format(self.name))
runLog.info(f"Constructing the `{self.name}`")

if geom is not None and self.name == "core":
gridDesign = geom.toGridBlueprints("core")[0]
Expand Down Expand Up @@ -196,9 +196,7 @@ def construct(self, cs, bp, reactor, geom=None, loadAssems=True):
return system

def _loadAssemblies(self, cs, container, gridContents, bp):
runLog.header(
"=========== Adding Assemblies to {} ===========".format(container)
)
runLog.header(f"=========== Adding Assemblies to {container} ===========")
badLocations = set()
for locationInfo, aTypeID in gridContents.items():
newAssembly = bp.constructAssem(cs, specifier=aTypeID)
Expand Down Expand Up @@ -232,9 +230,7 @@ def _modifyGeometry(self, container, gridDesign):
# (unless specified on input)
if not gridDesign.latticeDimensions:
runLog.info(
"Updating spatial grid pitch data for {} geometry".format(
container.geomType
)
f"Updating spatial grid pitch data for {container.geomType} geometry"
)
if container.geomType == geometry.GeomType.HEX:
container.spatialGrid.changePitch(container[0][0].getPitch())
Expand All @@ -258,26 +254,21 @@ def summarizeMaterialData(container):
Any Core object with Blocks and Components defined.
"""
runLog.header(
"=========== Summarizing Source of Material Data for {} ===========".format(
container
)
f"=========== Summarizing Source of Material Data for {container} ==========="
)
materialNames = set()
materialData = []
for c in container.iterComponents():
if c.material.name in materialNames:
continue
materialData.append((c.material.name, c.material.DATA_SOURCE, False))
materialData.append((c.material.name, c.material.DATA_SOURCE))
materialNames.add(c.material.name)

materialData = sorted(materialData)
runLog.info(
tabulate.tabulate(
data=materialData,
headers=[
"Material Name",
"Source Location",
"Property Data was Modified\nfrom the Source?",
],
headers=["Material Name", "Source Location"],
tableFmt="armi",
)
)
Expand Down
6 changes: 1 addition & 5 deletions armi/reactor/blueprints/tests/test_reactorBlueprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,7 @@ def test_construct(self):

def test_materialDataSummary(self):
"""Test that the material data summary for the core is valid as a printout to the stdout."""
expectedMaterialData = [
("Custom", "ARMI", False),
("HT9", "ARMI", False),
("UZr", "ARMI", False),
]
expectedMaterialData = [("Custom", "ARMI"), ("HT9", "ARMI"), ("UZr", "ARMI")]
core, _sfp = self._setupReactor()
materialData = reactorBlueprint.summarizeMaterialData(core)
for actual, expected in zip(materialData, expectedMaterialData):
Expand Down
1 change: 1 addition & 0 deletions doc/release/0.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Bug Fixes
#. Rotate hexagonal assembly patches correctly on facemap plots. (`PR#1883 <https://github.com/terrapower/armi/pull/1883>`_)
#. Update height of fluid components after axial expansion (`PR#1828 <https://github.com/terrapower/armi/pull/1828>`_)
#. 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>`_)
#. TBD

Quality Work
Expand Down

0 comments on commit 484c708

Please sign in to comment.