From 7ba45aaa35a839be0dfe1be622d8b499f56a1419 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Mon, 8 Aug 2022 22:21:37 +0100 Subject: [PATCH] [skip ci] review comments from @paulromano Co-authored-by: Paul Romano --- openmc/filter.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openmc/filter.py b/openmc/filter.py index 0d68ff8d9f..d7ab3f27e7 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -1324,7 +1324,8 @@ class EnergyFilter(RealFilter): cv.check_greater_than('filter value', v0, 0., equality=True) cv.check_greater_than('filter value', v1, 0., equality=True) - def bin_lethargy(self): + @property + def lethargy_bin_width(self): """Calculates the base 10 log width of energy bins which is useful when plotting the normalized flux. @@ -1333,9 +1334,7 @@ class EnergyFilter(RealFilter): numpy.array Array of bin widths """ - bin_edges = np.unique(self.bins) - log_width = np.log10(bin_edges[1:]/bin_edges[:-1]) - return log_width + return np.log10(self.bins[:, 1]/self.bins[:, 0]) @classmethod def from_group_structure(cls, group_structure):