mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Apply suggestions from code review
Incorporating suggestions from @paulromano Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
1e7dbe99cf
commit
d034e1de9c
4 changed files with 11 additions and 15 deletions
|
|
@ -256,7 +256,7 @@ class Geometry:
|
|||
----------
|
||||
path : str, optional
|
||||
Path to geometry XML file
|
||||
materials : dict
|
||||
materials : dict
|
||||
Dictionary mapping material ID strings to :class:`openmc.Material`
|
||||
instances (defined in :math:`openmc.Geometry.from_xml`)
|
||||
|
||||
|
|
|
|||
|
|
@ -228,8 +228,7 @@ class Model:
|
|||
model.settings = openmc.Settings.from_xml_element(root.find('settings'))
|
||||
model.materials = openmc.Materials.from_xml_element(root.find('materials'))
|
||||
materials = {str(m.id): m for m in model.materials}
|
||||
model.geometry = \
|
||||
openmc.Geometry.from_xml_element(root.find('geometry'), materials)
|
||||
model.geometry = .Geometry.from_xml_element(root.find('geometry'), materials)
|
||||
|
||||
# gather meshses from other classes before reading the tally node
|
||||
meshes = {}
|
||||
|
|
@ -542,8 +541,7 @@ class Model:
|
|||
materials = openmc.Materials(self.geometry.get_all_materials()
|
||||
.values())
|
||||
|
||||
with open(d, 'w', encoding='utf-8',
|
||||
errors='xmlcharrefreplace') as fh:
|
||||
with open(d, 'w', encoding='utf-8', errors='xmlcharrefreplace') as fh:
|
||||
# write the XML header
|
||||
fh.write("<?xml version='1.0' encoding='utf-8'?>\n")
|
||||
fh.write("<model>\n")
|
||||
|
|
|
|||
|
|
@ -55,16 +55,16 @@ class ModelXMLTestHarness(PyAPITestHarness):
|
|||
|
||||
|
||||
models = [
|
||||
'adj_cell_rotation_model',
|
||||
'lattice_mult_model',
|
||||
'energy_laws_model',
|
||||
'photon_prod_model'
|
||||
'adj_cell_rotation_model',
|
||||
'lattice_mult_model',
|
||||
'energy_laws_model',
|
||||
'photon_prod_model'
|
||||
]
|
||||
paths = [
|
||||
'../adj_cell_rotation',
|
||||
'../lattice_multiple',
|
||||
'../energy_laws',
|
||||
'../photon_production'
|
||||
'../adj_cell_rotation',
|
||||
'../lattice_multiple',
|
||||
'../energy_laws',
|
||||
'../photon_production'
|
||||
]
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@ import pytest
|
|||
import openmc
|
||||
import openmc.lib
|
||||
|
||||
from .. import cdtemp
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def pin_model_attributes():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue