From a76bd56ecd8f606b2b782805721bc52178971ddf Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 11 Mar 2022 11:56:15 -0600 Subject: [PATCH] Adding check that energy bounds are set --- openmc/weight_windows.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openmc/weight_windows.py b/openmc/weight_windows.py index b96908747..36c3932fc 100644 --- a/openmc/weight_windows.py +++ b/openmc/weight_windows.py @@ -192,6 +192,8 @@ class WeightWindows(IDManagerMixin): @property def num_energy_bins(self): + if self.energy_bounds is None: + raise ValueError('Energy bounds are not set') return self.energy_bounds.size - 1 @property