Rename Tracks.write_tracks_to_vtk --> Tracks.write_to_vtk

This commit is contained in:
Paul Romano 2022-08-16 22:09:58 -05:00
parent 409263b71f
commit aec246be72
4 changed files with 6 additions and 5 deletions

View file

@ -101,7 +101,8 @@ New Features
a corresponding Python binding :func:`openmc.lib.sample_external_source`.
- The track file generation capability has been completely overhauled. Track
files now include much more information, and a new :class:`~openmc.Tracks`
class allows access to track file information from the Python API. Multiple
class allows access to track file information from the Python API and has a
:meth:`~openmc.Tracks.write_to_vtk` method for writing a VTK file. Multiple
tracks are now written to a single file (one per MPI rank).
- A new :func:`openmc.wwinp_to_wws` function that converts weight windows from a
``wwinp`` file to a list of :class:`~openmc.WeightWindows` objects.

View file

@ -271,7 +271,7 @@ class Tracks(list):
track.plot(ax)
return ax
def write_tracks_to_vtk(self, filename=Path('tracks.vtp')):
def write_to_vtk(self, filename=Path('tracks.vtp')):
"""Creates a VTP file of the tracks
Parameters

View file

@ -35,7 +35,7 @@ def main():
# Write coordinate values to points array.
track_file = openmc.Tracks(args.input)
track_file.write_tracks_to_vtk(args.out)
track_file.write_to_vtk(args.out)
if __name__ == '__main__':
main()

View file

@ -143,7 +143,7 @@ def test_filter(sphere_model, run_in_tmpdir):
assert matches == []
def test_write_tracks_to_vtk(sphere_model):
def test_write_to_vtk(sphere_model):
vtk = pytest.importorskip('vtk')
# Set maximum number of tracks per process to write
sphere_model.settings.max_tracks = 25
@ -153,7 +153,7 @@ def test_write_tracks_to_vtk(sphere_model):
generate_track_file(sphere_model, tracks=True)
tracks = openmc.Tracks('tracks.h5')
polydata = tracks.write_tracks_to_vtk('tracks.vtp')
polydata = tracks.write_to_vtk('tracks.vtp')
assert isinstance(polydata, vtk.vtkPolyData)
assert Path('tracks.vtp').is_file()