Skip to content

Commit aec246b

Browse files
committed
Rename Tracks.write_tracks_to_vtk --> Tracks.write_to_vtk
1 parent 409263b commit aec246b

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

docs/source/releasenotes/0.13.1.rst

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

openmc/tracks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def plot(self):
271271
track.plot(ax)
272272
return ax
273273

274-
def write_tracks_to_vtk(self, filename=Path('tracks.vtp')):
274+
def write_to_vtk(self, filename=Path('tracks.vtp')):
275275
"""Creates a VTP file of the tracks
276276
277277
Parameters

scripts/openmc-track-to-vtk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def main():
3535

3636
# Write coordinate values to points array.
3737
track_file = openmc.Tracks(args.input)
38-
track_file.write_tracks_to_vtk(args.out)
38+
track_file.write_to_vtk(args.out)
3939

4040
if __name__ == '__main__':
4141
main()

tests/unit_tests/test_tracks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def test_filter(sphere_model, run_in_tmpdir):
143143
assert matches == []
144144

145145

146-
def test_write_tracks_to_vtk(sphere_model):
146+
def test_write_to_vtk(sphere_model):
147147
vtk = pytest.importorskip('vtk')
148148
# Set maximum number of tracks per process to write
149149
sphere_model.settings.max_tracks = 25
@@ -153,7 +153,7 @@ def test_write_tracks_to_vtk(sphere_model):
153153
generate_track_file(sphere_model, tracks=True)
154154

155155
tracks = openmc.Tracks('tracks.h5')
156-
polydata = tracks.write_tracks_to_vtk('tracks.vtp')
156+
polydata = tracks.write_to_vtk('tracks.vtp')
157157

158158
assert isinstance(polydata, vtk.vtkPolyData)
159159
assert Path('tracks.vtp').is_file()

0 commit comments

Comments
 (0)