Skip to content
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
Next Next commit
Make sure path can be specified in Model.run()
  • Loading branch information
paulromano committed Mar 4, 2024
commit f51b954b26c7ff137a5acb6ffb752a5fcf6534b7
3 changes: 2 additions & 1 deletion openmc/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,9 +709,10 @@ def run(self, particles=None, threads=None, geometry_debug=False,
self.export_to_model_xml(**export_kwargs)
else:
self.export_to_xml(**export_kwargs)
path_input = export_kwargs.get("path", None)
openmc.run(particles, threads, geometry_debug, restart_file,
tracks, output, Path('.'), openmc_exec, mpi_args,
event_based)
event_based, path_input)

# Get output directory and return the last statepoint written
if self.settings.output and 'path' in self.settings.output:
Expand Down
3 changes: 3 additions & 0 deletions tests/unit_tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,3 +585,6 @@ def test_single_xml_exec(run_in_tmpdir):

with pytest.raises(RuntimeError, match='input_dir'):
openmc.run(path_input='input_dir/pincell.xml')

# Make sure path can be specified with run
pincell_model.run(path='my_model.xml')