diff --git a/armi/mpiActions.py b/armi/mpiActions.py index 34767faf4..4d78b761d 100644 --- a/armi/mpiActions.py +++ b/armi/mpiActions.py @@ -707,7 +707,7 @@ def _diagnosePickleError(o): class Multiprocessor: """ This is useful for running a function in parallel using multiple available processors. - + Notes ----- This solution is taken from https://stackoverflow.com/a/45829852 diff --git a/armi/reactor/converters/uniformMesh.py b/armi/reactor/converters/uniformMesh.py index cc72ddc7d..4ec7e9668 100644 --- a/armi/reactor/converters/uniformMesh.py +++ b/armi/reactor/converters/uniformMesh.py @@ -97,11 +97,13 @@ def convert(self, r=None): self._computeAverageAxialMesh() self._buildAllUniformAssemblies() self._clearStateOnReactor(self.convReactor) - self._mapStateFromReactorToOther(self._sourceReactor, self.convReactor) + self._mapStateFromReactorToOther(self._sourceReactor, self.convReactor) self.convReactor.core.updateAxialMesh() self._checkConversion() completeEndTime = timer() - runLog.extra(f"Reactor core conversion time: {completeEndTime-completeStartTime} seconds") + runLog.extra( + f"Reactor core conversion time: {completeEndTime-completeStartTime} seconds" + ) return self.convReactor def _checkConversion(self): @@ -165,7 +167,7 @@ def makeAssemWithUniformMesh(sourceAssem, newMesh): newAssem = UniformMeshGeometryConverter._createNewAssembly(sourceAssem) runLog.debug(f"Creating a uniform mesh of {newAssem}") bottom = 0.0 - + for topMeshPoint in newMesh: overlappingBlockInfo = sourceAssem.getBlocksBetweenElevations( bottom, topMeshPoint @@ -220,7 +222,7 @@ def makeAssemWithUniformMesh(sourceAssem, newMesh): _setNumberDensitiesFromOverlaps(block, overlappingBlockInfo) newAssem.add(block) bottom = topMeshPoint - + newAssem.reestablishBlockOrder() newAssem.calculateZCoords() return newAssem @@ -305,7 +307,9 @@ def applyStateToOriginal(self): self._clearStateOnReactor(self._sourceReactor) self._mapStateFromReactorToOther(self.convReactor, self._sourceReactor) completeEndTime = timer() - runLog.extra(f"Parameter remapping time: {completeEndTime-completeStartTime} seconds") + runLog.extra( + f"Parameter remapping time: {completeEndTime-completeStartTime} seconds" + ) def _mapStateFromReactorToOther(self, sourceReactor, destReactor): """ @@ -504,6 +508,7 @@ def _setNumberDensitiesFromOverlaps(block, overlappingBlockInfo): ) block.setNumberDensities(totalDensities) + def _setStateFromOverlaps( sourceAssembly, destinationAssembly, setter, getter, paramNames ): @@ -593,9 +598,7 @@ def _setStateFromOverlaps( sourceBlockVals = getter(sourceBlock, paramNames) sourceBlockHeight = sourceBlock.getHeight() - for paramName, sourceBlockVal in zip( - paramNames, sourceBlockVals - ): + for paramName, sourceBlockVal in zip(paramNames, sourceBlockVals): # The value can be `None` if it has not been set yet. In this case, # the mapping should be skipped. if sourceBlockVal is None: @@ -609,15 +612,15 @@ def _setStateFromOverlaps( # If the parameter is volume integrated (e.g., flux, linear power) # then calculate the fractional contribution from the source block. if isVolIntegrated: - integrationFactor = ( - sourceBlockOverlapHeight / sourceBlockHeight - ) + integrationFactor = sourceBlockOverlapHeight / sourceBlockHeight # If the parameter is not volume integrated (e.g., volumetric reaction rate) # then calculate the fraction contribution on the destination block. # This smears the parameter over the destination block. else: - integrationFactor = sourceBlockOverlapHeight / destinationBlockHeight + integrationFactor = ( + sourceBlockOverlapHeight / destinationBlockHeight + ) updatedDestVals[paramName] += sourceBlockVal * integrationFactor diff --git a/armi/reactor/reactorParameters.py b/armi/reactor/reactorParameters.py index a6d380f69..0b8bcb757 100644 --- a/armi/reactor/reactorParameters.py +++ b/armi/reactor/reactorParameters.py @@ -549,7 +549,6 @@ def detailedNucKeys(self, value): description="Decay power from decaying radionuclides", ) - pb.defParam("medAbsCore", units="?", description="?") pb.defParam("medFluxCore", units="?", description="?")