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

Plot cartesian #71

Merged
merged 5 commits into from
May 11, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 6 additions & 4 deletions armi/bookkeeping/report/reportingUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
from armi import utils
from armi.utils import iterables
from armi.utils import units
from armi.utils import pathTools
from armi.utils import textProcessors
from armi.utils import plotting
from armi import interfaces
from armi.bookkeeping import report
from armi.reactor.flags import Flags
from armi.reactor.components import ComponentType
from armi.operators import RunTypes
from armi.localization import strings
from armi.localization import warnings


# Set to prevent the image and text from being too small to read.
MAX_ASSEMS_PER_ASSEM_PLOT = 6
Expand Down Expand Up @@ -934,7 +934,8 @@ def makeCoreAndAssemblyMaps(r, cs, generateFullCoreMap=False, showBlockAxMesh=Tr
report.data.Report.groupsOrderFirst.insert(-1, assemPlotImage)
report.data.Report.componentWellGroups.insert(-1, assemPlotImage)
assemPlotName = os.path.abspath(
core.plotAssemblyTypes(
plotting.plotAssemblyTypes(
core,
assemBatch,
plotNum,
maxAssems=MAX_ASSEMS_PER_ASSEM_PLOT,
Expand Down Expand Up @@ -973,7 +974,8 @@ def makeCoreAndAssemblyMaps(r, cs, generateFullCoreMap=False, showBlockAxMesh=Tr
]

fName = "".join([cs.caseTitle, "RadialCoreMap.", cs["outputFileExtension"]])
corePlotName = core.plotFaceMap(
corePlotName = plotting.plotFaceMap(
core,
title="{} Radial Core Map".format(cs.caseTitle),
fName=fName,
cmapName="RdYlBu",
Expand Down
2 changes: 1 addition & 1 deletion armi/bookkeeping/tests/test_plotting.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019 TerraPower, LLC
# Copyright 2020 TerraPower, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
8 changes: 3 additions & 5 deletions armi/physics/fuelCycle/fuelHandlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,18 @@
"""
import re
import os
import collections
import math
import importlib.util
import warnings

import numpy

import armi
from armi import interfaces
from armi import runLog
from armi.localization.exceptions import InputError
from armi.reactor.flags import Flags
from armi.operators import RunTypes
from armi.utils import directoryChangers, pathTools
from armi import utils
from armi.utils import plotting


class FuelHandlerInterface(interfaces.Interface):
Expand Down Expand Up @@ -130,7 +127,8 @@ def manageFuel(self, cycle):
fh.outage(shuffleFactors) # move the assemblies around
if self.cs["plotShuffleArrows"]:
arrows = fh.makeShuffleArrows()
self.r.core.plotFaceMap(
plotting.plotFaceMap(
self.r.core,
"percentBu",
labelFmt=None,
fName="{}.shuffles_{}.png".format(self.cs.caseTitle, self.r.p.cycle),
Expand Down
5 changes: 1 addition & 4 deletions armi/reactor/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1846,14 +1846,12 @@ def getPitch(self, returnComp=False):

"""
c, _p = self._pitchDefiningComponent

if c is None:
raise ValueError("{} has no valid pitch defining component".format(self))

# ask component for dimensions, since they could have changed,
# due to temperature, for example.
p = c.getPitchData()

return (p, c) if returnComp else p

def hasPinPitch(self):
Expand Down Expand Up @@ -2885,8 +2883,7 @@ def getMaxArea(self):

def setPitch(self, val, updateBolParams=False, updateNumberDensityParams=True):
raise NotImplementedError(
"Directly setting the pitch of a cartesian block is currently "
"not supported"
"Directly setting the pitch of a cartesian block is currently not supported."
)

def getSymmetryFactor(self):
Expand Down
9 changes: 7 additions & 2 deletions armi/reactor/converters/uniformMesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
from armi import runLog
from armi import utils
from armi.utils import iterables
from armi.utils import plotting
from armi.reactor import grids
from armi.reactor.flags import Flags
from armi.reactor.converters.geometryConverters import GeometryConverter
Expand Down Expand Up @@ -210,8 +211,12 @@ def _buildAllUniformAssemblies(self):
def plotConvertedReactor(self):
assemsToPlot = self.convReactor.core[:12]
for plotNum, assemBatch in enumerate(iterables.chunk(assemsToPlot, 6), start=1):
self.convReactor.core.plotAssemblyTypes(
assemBatch, plotNum, maxAssems=6, showBlockAxMesh=True
plotting.plotAssemblyTypes(
self.convReactor.core,
assemBatch,
plotNum,
maxAssems=6,
showBlockAxMesh=True,
)

def _setParamsToUpdate(self):
Expand Down
Loading