Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing defunct flags CORE and REACTOR #1835

Merged
merged 3 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions armi/bookkeeping/db/database3.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@
from armi.reactor.blocks import Block
from armi.reactor.components import Component
from armi.reactor.composites import ArmiObject
from armi.reactor.flags import Flags
from armi.reactor.parameters import parameterCollections
from armi.reactor.reactors import Core
from armi.reactor.reactors import Core, Reactor
from armi.settings.fwSettings.globalSettings import CONF_SORT_REACTOR
from armi.utils import getNodesPerCycle
from armi.utils.textProcessors import resolveMarkupInclusions
Expand Down Expand Up @@ -854,11 +853,7 @@ def _compose(self, comps, cs, parent=None):
comp.add(child)

if isinstance(comp, Core):
# TODO: This is also an issue related to geoms and which core is "The Core".
# We only have a good geom for the main core, so can't do process loading on
# the SFP, etc.
if comp.hasFlags(Flags.CORE):
comp.processLoading(cs, dbLoad=True)
comp.processLoading(cs, dbLoad=True)
keckler marked this conversation as resolved.
Show resolved Hide resolved
elif isinstance(comp, Assembly):
comp.calculateZCoords()

Expand Down Expand Up @@ -1311,8 +1306,7 @@ def getHistories(
Returns
-------
dict
Dictionary ArmiObject (input): dict of str/list pairs containing ((cycle,
node), value).
Dictionary ArmiObject (input): dict of str/list pairs containing ((cycle, node), value).
"""
histData: Histories = {
c: collections.defaultdict(collections.OrderedDict) for c in comps
Expand All @@ -1329,8 +1323,7 @@ def getHistories(
if "layout" not in h5TimeNodeGroup:
# Layout hasn't been written for this time step, so whatever is in there
# didn't come from the DatabaseInterface. Probably because it's the
# current time step and something has created the group to store aux
# data
# current time step and something has created the group to store aux data
continue

cycle = h5TimeNodeGroup.attrs["cycle"]
Expand Down Expand Up @@ -1419,7 +1412,7 @@ def getHistories(

histData[c][paramName][cycle, timeNode] = val

r = comps[0].getAncestorWithFlags(Flags.REACTOR)
r = comps[0].getAncestor(lambda c: isinstance(c, Reactor))
cycleNode = r.p.cycle, r.p.timeNode
for c, paramHistories in histData.items():
for paramName, hist in paramHistories.items():
Expand Down
3 changes: 1 addition & 2 deletions armi/physics/neutronics/tests/test_crossSectionTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
isotopicDepletionInterface as idi,
)
from armi.physics.neutronics.latticePhysics import ORDER
from armi.reactor.flags import Flags
from armi.reactor.tests.test_blocks import loadTestBlock
from armi.reactor.tests.test_reactors import loadTestReactor
from armi.settings import Settings
Expand All @@ -37,7 +36,7 @@ def test_makeTable(self):
"""
obj = loadTestBlock()
obj.p.mgFlux = range(33)
core = obj.getAncestorWithFlags(Flags.CORE)
core = obj.parent.parent
core.lib = isotxs.readBinary(ISOAA_PATH)
table = crossSectionTable.makeReactionRateTable(obj)

Expand Down
3 changes: 0 additions & 3 deletions armi/reactor/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,6 @@ class Flags(Flag):
MEDIUM = auto()
LOW = auto()

CORE = auto()
REACTOR = auto()

# general kinds of assemblies or blocks
MATERIAL = auto()
FUEL = auto()
Expand Down
4 changes: 1 addition & 3 deletions armi/reactor/reactors.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ def __init__(self, name, blueprints):
self.spatialLocator = None
self.p.maxAssemNum = 0
self.p.cycle = 0
self.p.flags |= Flags.REACTOR
self.core = None
self.sfp = None
self.blueprints = blueprints
Expand All @@ -123,7 +122,7 @@ def __repr__(self):

def add(self, container):
composites.Composite.add(self, container)
cores = self.getChildrenWithFlags(Flags.CORE)
cores = [c for c in self.getChildren(deep=True) if isinstance(c, Core)]
if cores:
if len(cores) != 1:
raise ValueError(
Expand Down Expand Up @@ -283,7 +282,6 @@ def __init__(self, name):
Name of the object. Flags will inherit from this.
"""
composites.Composite.__init__(self, name)
self.p.flags = Flags.fromStringIgnoreErrors(name)
self.assembliesByName = {}
self.circularRingList = {}
self.blocksByName = {} # lookup tables
Expand Down
4 changes: 2 additions & 2 deletions armi/reactor/tests/test_assemblies.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,8 @@ def test_duplicate(self):

for refBlock, curBlock in zip(self.assembly, assembly2):
numNucs = 0
for nuc in self.assembly.getAncestorWithFlags(
Flags.REACTOR
for nuc in self.assembly.getAncestor(
lambda c: isinstance(c, reactors.Reactor)
).blueprints.allNuclidesInProblem:
numNucs += 1
# Block level density
Expand Down
2 changes: 2 additions & 0 deletions doc/release/0.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ New Features

API Changes
-----------
#. Removing flags ``CORE`` and ``REACTOR``. (`PR#1835 <https://github.com/terrapower/armi/pull/1835>`_)
#. TBD

Bug Fixes
Expand All @@ -24,6 +25,7 @@ Bug Fixes
Quality Work
------------
#. Removing code that causes a deprecation warning (converting ``axialUnitGrid`` to ``AxialGrid.fromNCells``) (`PR#1809 <https://github.com/terrapower/armi/pull/1809>`_)
#. TBD

Changes that Affect Requirements
--------------------------------
Expand Down
Loading