Skip to content

Commit

Permalink
Test corrections. Support handling separate XML files or a model XML …
Browse files Browse the repository at this point in the history
…file
  • Loading branch information
pshriwise committed Aug 22, 2024
1 parent ca47a90 commit 7af1707
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/openmc_cad_adapter/to_cubit_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,9 @@ def openmc_to_cad():
model_path = Path(args.input)

if model_path.is_dir():
model = openmc.Model.from_xml(model_path)
if not (model_path / 'settings.xml').exists():
raise IOError(f'Unable to locate settings.xml in {model_path}')
model = openmc.Model.from_xml(*[model_path / f for f in ('geometry.xml', 'materials.xml', 'settings.xml')])
else:
model = openmc.Model.from_model_xml(model_path)

Expand Down
3 changes: 2 additions & 1 deletion test/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ def test_examples_cli(example, request):
example_path = OPENMC_EXAMPLES_DIR / example
exec(open(example_path).read())

openmc.reset_auto_ids()
world = [500, 500, 500]
output = example_name(example)
cmd = ['openmc_to_cad', example_path.parent, '-o', output, '--world'] + [str(w) for w in world]
cmd = ['openmc_to_cad', '.', '-o', output, '--world'] + [str(w) for w in world]
pipe = subprocess.Popen(cmd)
pipe.wait()
if pipe.returncode != 0:
Expand Down

0 comments on commit 7af1707

Please sign in to comment.