diff --git a/scopesim/optics/optical_element.py b/scopesim/optics/optical_element.py index 82b29ba7..a9a98e61 100644 --- a/scopesim/optics/optical_element.py +++ b/scopesim/optics/optical_element.py @@ -132,12 +132,13 @@ def get_z_order_effects(self, z_level: int, z_max: int = None): f"{z_max=} < {z_level=}.") else: z_max = z_min + 100 # range doesn't include final element -> 100 + z_range = range(z_min, z_max) for eff in self.effects: if not eff.include or "z_order" not in eff.meta: continue - if z_order_in_range(eff.meta["z_order"], range(z_min, z_max)): + if z_order_in_range(eff.meta["z_order"], z_range): yield eff @property