From 07fb1bcd7f042c51bd6a010b6e7cbe910fcff970 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Sat, 14 Jan 2017 08:57:53 -0500 Subject: [PATCH] bug fixes based on testing the new capability --- openmc/mgxs/library.py | 9 +++++++++ openmc/mgxs/mgxs.py | 14 +++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index a73d82a21..650373508 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -995,6 +995,15 @@ class Library(object): xsdata = openmc.XSdata(name, self.energy_groups, representation=representation) xsdata.num_delayed_groups = self.num_delayed_groups + if self.num_polar or self.num_azimuthal: + if self.num_polar: + xsdata.num_polar = self.num_polar + else: + xsdata.num_polar = 1 + if self.num_azimuthal: + xsdata.num_azimuthal = self.num_azimuthal + else: + xsdata.num_azimuthal = 1 if nuclide != 'total': xsdata.atomic_weight_ratio = self._nuclides[nuclide][1] diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index d9c55b697..672b882cd 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -4332,13 +4332,13 @@ class ScatterMatrixXS(MatrixMGXS): dont_squeeze = (1, 2, 3) else: dont_squeeze = (1, 2) - # Squeeze will return a ValueError if the axis has a size - # greater than 1, so try each axis in axes one at a time, - # and do our own check to preclude the ValueError - initial_shape = len(xs.shape) - for axis in range(initial_shape - 1, -1, -1): - if axis not in dont_squeeze and xs.shape[axis] == 1: - xs = np.squeeze(xs, axis=axis) + # Squeeze will return a ValueError if the axis has a size + # greater than 1, so try each axis in axes one at a time, + # and do our own check to preclude the ValueError + initial_shape = len(xs.shape) + for axis in range(initial_shape - 1, -1, -1): + if axis not in dont_squeeze and xs.shape[axis] == 1: + xs = np.squeeze(xs, axis=axis) return xs def get_pandas_dataframe(self, groups='all', nuclides='all', moment='all',