Applied suggested changes per @paulromano's code review

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Adam Nelson 2021-10-01 06:09:24 -05:00 committed by GitHub
parent e8081207d7
commit e1365bd036
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 16 additions and 16 deletions

View file

@ -22,7 +22,7 @@ from uncertainties import ufloat
from openmc.data import DataLibrary
from openmc.lib import MaterialFilter, Tally
from openmc.checkvalue import check_type, check_greater_than
from openmc import comm
from openmc.mpi import comm
from .results import Results
from .chain import Chain
from .results_list import ResultsList

View file

@ -10,7 +10,7 @@ import sys
from numpy import dot, zeros, newaxis, asarray
from openmc import comm
from openmc.mpi import comm
from openmc.checkvalue import check_type, check_greater_than
from openmc.data import JOULE_PER_EV, REACTION_MT
from openmc.lib import (

View file

@ -20,7 +20,7 @@ from uncertainties import ufloat
import openmc
from openmc.checkvalue import check_value
import openmc.lib
from openmc import comm
from openmc.mpi import comm
from .abc import TransportOperator, OperatorResult
from .atom_number import AtomNumber
from .reaction_rates import ReactionRates

View file

@ -9,7 +9,7 @@ import copy
import h5py
import numpy as np
from openmc import comm, MPI
from openmc.mpi import comm, MPI
from .reaction_rates import ReactionRates
VERSION_RESULTS = (1, 1)

View file

@ -363,6 +363,7 @@ def plot_geometry(output=True):
"""Plot geometry
.. versionchanged:: 0.13.0
The *output* argument was added.
Parameters
----------
@ -388,6 +389,7 @@ def run(output=True):
"""Run simulation
.. versionchanged:: 0.13.0
The *output* argument was added.
Parameters
----------

View file

@ -109,15 +109,13 @@ class Model:
self._cells_by_name = {}
for cell in cells.values():
if cell.name not in self._cells_by_name:
self._cells_by_name[cell.name] = [cell]
else:
self._cells_by_name[cell.name].append(cell)
self._cells_by_name[cell.name] = set()
self._cells_by_name[cell.name].add(cell)
self._materials_by_name = {}
for mat in mats:
if mat.name not in self._materials_by_name:
self._materials_by_name[mat.name] = [mat]
else:
self._materials_by_name[mat.name].append(mat)
self._materials_by_name[mat.name] = set()
self._materials_by_name[mat.name].add(mat)
@property
def geometry(self):
@ -196,8 +194,7 @@ class Model:
def from_xml(cls, geometry='geometry.xml', materials='materials.xml',
settings='settings.xml'):
"""Create model from existing XML files
When initializing this way, the user must manually load plots, tallies,
the chain_file and fission_q attributes.
When initializing this way, the user must manually load plots and tallies.
Parameters
----------
@ -288,6 +285,8 @@ class Model:
"""Deplete model using specified timesteps/power
.. versionchanged:: 0.13.0
The *final_step*, *operator_kwargs*, *directory*, and *output*
arguments were added.
Parameters
----------
@ -319,8 +318,7 @@ class Model:
elif isinstance(operator_kwargs, dict):
op_kwargs = operator_kwargs
else:
msg = "operator_kwargs must be a dict or None"
raise ValueError(msg)
raise ValueError("operator_kwargs must be a dict or None")
# Import openmc.deplete here so the Model can be used even if the
# shared library is unavailable.

View file

@ -7,7 +7,7 @@ import os
from pathlib import Path
import numpy as np
from openmc import comm
from openmc.mpi import comm
from openmc.deplete import Chain, reaction_rates, nuclide, cram, pool
import pytest

View file

@ -14,7 +14,7 @@ import numpy as np
from uncertainties import ufloat
import pytest
from openmc import comm
from openmc.mpi import comm
from openmc.deplete import (
ReactionRates, Results, ResultsList, OperatorResult, PredictorIntegrator,
CECMIntegrator, CF4Integrator, CELIIntegrator, EPCRK4Integrator,