From dc25e7672537b422635e0b529f8b4eb2d498d389 Mon Sep 17 00:00:00 2001 From: James Kerns Date: Mon, 4 Nov 2024 08:42:09 -0600 Subject: [PATCH] don't plot for lack of axis images --- pylinac/winston_lutz.py | 2 ++ tests_basic/test_winstonlutz.py | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pylinac/winston_lutz.py b/pylinac/winston_lutz.py index 86b66361..e73311eb 100644 --- a/pylinac/winston_lutz.py +++ b/pylinac/winston_lutz.py @@ -1875,6 +1875,8 @@ def plotly_analyzed_images( for image in self.images if image.variable_axis in (variable_axis, Axis.REFERENCE) ] + if not imgs: + continue angles = [ getattr(image, f"{variable_axis.value.lower()}_angle") for image in imgs ] diff --git a/tests_basic/test_winstonlutz.py b/tests_basic/test_winstonlutz.py index b3acbf61..95c83874 100644 --- a/tests_basic/test_winstonlutz.py +++ b/tests_basic/test_winstonlutz.py @@ -1506,10 +1506,12 @@ class WLDontUseFileNames(WinstonLutzMixin, TestCase): } -class WLUseFileNames(WinstonLutzMixin, TestCase): +class WLUseFileNames(WinstonLutzMixin, PlotlyTestMixin, TestCase): file_name = "Naming.zip" use_filenames = True num_images = 4 + # For below, note that gantry, couch, and epid POV plots are not made due to lack of isolated-axis images. This is on purpose. + num_figs = 7 collimator_iso_size = 1.2 cax2bb_max_distance = 0.9 cax2bb_median_distance = 0.8 @@ -1522,6 +1524,9 @@ class WLUseFileNames(WinstonLutzMixin, TestCase): 3: Axis.COLLIMATOR, } + def setUp(self) -> None: + self.instance = self.wl + class WLBadFilenames(TestCase): def test_bad_filenames(self):