suggestions from code review by @paulromano

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Jonathan Shimwell 2022-08-15 16:05:02 +01:00 committed by GitHub
parent 9847d053f3
commit 3a2d4a9138
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -7,6 +7,7 @@ from .checkvalue import check_filetype_version
from .source import SourceParticle, ParticleType
from pathlib import Path
ParticleTrack = namedtuple('ParticleTrack', ['particle', 'states'])
ParticleTrack.__doc__ = """\
Particle track information
@ -266,7 +267,7 @@ class Tracks(list):
track.plot(ax)
return ax
def write_tracks_to_vtk(self, filename=Path('tracks.vtk')):
def write_tracks_to_vtk(self, filename=Path('tracks.vtp')):
"""Creates a VTP file of the tracks
Parameters

View file

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