mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Update plots.py for PathLike to string handling error (#3261)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
32662b409a
commit
bd874f1b3e
2 changed files with 3 additions and 2 deletions
|
|
@ -250,9 +250,10 @@ def voxel_to_vtk(voxel_file: PathLike, output: PathLike = 'plot.vti'):
|
|||
writer.SetInputData(grid)
|
||||
else:
|
||||
writer.SetInput(grid)
|
||||
output = str(output)
|
||||
if not output.endswith(".vti"):
|
||||
output += ".vti"
|
||||
writer.SetFileName(str(output))
|
||||
writer.SetFileName(output)
|
||||
writer.Write()
|
||||
|
||||
return output
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ def test_voxel_plot(run_in_tmpdir):
|
|||
assert Path('test_voxel_plot.vti').is_file()
|
||||
|
||||
vox_plot.filename = 'h5_voxel_plot'
|
||||
vox_plot.to_vtk('another_test_voxel_plot.vti')
|
||||
vox_plot.to_vtk(Path('another_test_voxel_plot.vti'))
|
||||
|
||||
assert Path('h5_voxel_plot.h5').is_file()
|
||||
assert Path('another_test_voxel_plot.vti').is_file()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue