mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
bwd compatibility fix for reading filter elements
This commit is contained in:
parent
461fd54f11
commit
9803c26111
2 changed files with 2 additions and 23 deletions
|
|
@ -258,6 +258,8 @@ class Filter(IDManagerMixin, metaclass=FilterMeta):
|
|||
|
||||
"""
|
||||
filter_type = elem.get('type')
|
||||
if filter_type is None:
|
||||
filter_type = elem.find('type').text
|
||||
|
||||
# If the filter type matches this class's short_name, then
|
||||
# there is no overridden from_xml_element method
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
import openmc
|
||||
|
||||
import pytest
|
||||
|
||||
def test_restart(run_in_tmpdir):
|
||||
|
||||
pincell = openmc.examples.pwr_pin_cell()
|
||||
|
||||
# run the pincell
|
||||
sp_file = pincell.run()
|
||||
|
||||
# run a restart with the resulting statepoint
|
||||
# and the settings unchanged
|
||||
|
||||
with pytest.raises(RuntimeError, match='is smaller than the number of batches'):
|
||||
pincell.run(restart_file=sp_file)
|
||||
|
||||
# update the number of batches and run again
|
||||
pincell.settings.batches = 15
|
||||
sp_file = pincell.run(restart_file=sp_file)
|
||||
|
||||
sp = openmc.StatePoint(sp_file)
|
||||
assert sp.n_batches == 15
|
||||
Loading…
Add table
Add a link
Reference in a new issue