From 38676476c39d806b513f167df554337792b69049 Mon Sep 17 00:00:00 2001 From: "wbinventor@gmail.com" Date: Mon, 4 Jan 2016 19:40:49 -0500 Subject: [PATCH] Removed manual tuple construction for tally shape in place of new shape property --- openmc/mgxs/mgxs.py | 12 ++++-------- openmc/tallies.py | 6 ------ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index e9ce00254d..968504a06d 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -789,10 +789,8 @@ class MGXS(object): std_dev = np.sqrt(std_dev) # Reshape condensed data arrays with one dimension for all filters - new_shape = \ - (tally.num_filter_bins, tally.num_nuclides, tally.num_scores,) - mean = np.reshape(mean, new_shape) - std_dev = np.reshape(std_dev, new_shape) + mean = np.reshape(mean, tally.shape) + std_dev = np.reshape(std_dev, tally.shape) # Override tally's data with the new condensed data tally._mean = mean @@ -873,10 +871,8 @@ class MGXS(object): domain_filter.num_bins = 1 # Reshape averaged data arrays with one dimension for all filters - new_shape = \ - (tally.num_filter_bins, tally.num_nuclides, tally.num_scores,) - mean = np.reshape(mean, new_shape) - std_dev = np.reshape(std_dev, new_shape) + mean = np.reshape(mean, tally.shape) + std_dev = np.reshape(std_dev, tally.shape) # Override tally's data with the new condensed data tally._mean = mean diff --git a/openmc/tallies.py b/openmc/tallies.py index 8764e2e17c..3a8f102ce3 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -2841,12 +2841,6 @@ class Tally(object): new_tally = copy.deepcopy(self) new_tally.add_filter(new_filter) - # Determine the shape of data in the new diagonalized Tally - num_filter_bins = new_tally.num_filter_bins - num_nuclides = new_tally.num_nuclides - num_scores = new_tally.num_scores - new_shape = (num_filter_bins, num_nuclides, num_scores) - # Determine "base" indices along the new "diagonal", and the factor # by which the "base" indices should be repeated to account for all # other filter bins in the diagonalized tally