Skip to content

Commit

Permalink
Rename Tracks.write_tracks_to_vtk --> Tracks.write_to_vtk
Browse files Browse the repository at this point in the history
  • Loading branch information
paulromano committed Aug 17, 2022
1 parent 409263b commit aec246b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion docs/source/releasenotes/0.13.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion openmc/tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def plot(self):
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
Expand Down
2 changes: 1 addition & 1 deletion scripts/openmc-track-to-vtk
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 2 additions & 2 deletions tests/unit_tests/test_tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()

0 comments on commit aec246b

Please sign in to comment.