From 979317f6145f56ea95e3d76f81077b81a8a9cd6b Mon Sep 17 00:00:00 2001 From: Miriam Date: Sun, 19 Jul 2020 20:52:25 +0000 Subject: [PATCH] Added surfaces to the reordering of pandas dataframe --- openmc/mgxs/mgxs.py | 11 +++-- .../mgxs_library_mesh/results_true.dat | 48 +++++++++---------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index 9081fcc9e3..fb72cc9fc4 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -6240,13 +6240,14 @@ class SurfaceMGXS(MGXS): mesh_str = 'mesh {0}'.format(self.domain.id) if len(self.domain.dimension) == 1: - df.sort_values(by=[(mesh_str, 'x')] + columns, inplace=True) + df.sort_values(by=[(mesh_str, 'x'), (mesh_str, 'surf')] + + columns, inplace=True) elif len(self.domain.dimension) == 2: - df.sort_values(by=[(mesh_str, 'x'), - (mesh_str, 'y')] + columns, inplace=True) + df.sort_values(by=[(mesh_str, 'x'), (mesh_str, 'y'), + (mesh_str, 'surf')] + columns, inplace=True) elif len(self.domain.dimension) == 3: - df.sort_values(by=[(mesh_str, 'x'), - (mesh_str, 'y'), (mesh_str, 'z')] + columns, inplace=True) + df.sort_values(by=[(mesh_str, 'x'), (mesh_str, 'y'), + (mesh_str, 'z'), (mesh_str, 'surf')] + columns, inplace=True) return df diff --git a/tests/regression_tests/mgxs_library_mesh/results_true.dat b/tests/regression_tests/mgxs_library_mesh/results_true.dat index 1af47cf76d..cbcbcb239b 100644 --- a/tests/regression_tests/mgxs_library_mesh/results_true.dat +++ b/tests/regression_tests/mgxs_library_mesh/results_true.dat @@ -180,38 +180,38 @@ 3 2 2 1 1 1 total 0.031336 0.001614 mesh 1 group in nuclide mean std. dev. x y surf -0 1 1 x-min out 1 total 0.0000 0.000000 -1 1 1 x-min in 1 total 0.0000 0.000000 -2 1 1 x-max out 1 total 0.2738 0.093735 3 1 1 x-max in 1 total 0.1892 0.011302 -4 1 1 y-min out 1 total 0.0000 0.000000 -5 1 1 y-min in 1 total 0.0000 0.000000 -6 1 1 y-max out 1 total 0.2358 0.041204 +2 1 1 x-max out 1 total 0.2738 0.093735 +1 1 1 x-min in 1 total 0.0000 0.000000 +0 1 1 x-min out 1 total 0.0000 0.000000 7 1 1 y-max in 1 total 0.1724 0.009114 -16 1 2 x-min out 1 total 0.0000 0.000000 -17 1 2 x-min in 1 total 0.0000 0.000000 -18 1 2 x-max out 1 total 0.1778 0.010514 +6 1 1 y-max out 1 total 0.2358 0.041204 +5 1 1 y-min in 1 total 0.0000 0.000000 +4 1 1 y-min out 1 total 0.0000 0.000000 19 1 2 x-max in 1 total 0.1822 0.011922 -20 1 2 y-min out 1 total 0.1724 0.009114 -21 1 2 y-min in 1 total 0.2358 0.041204 -22 1 2 y-max out 1 total 0.0000 0.000000 +18 1 2 x-max out 1 total 0.1778 0.010514 +17 1 2 x-min in 1 total 0.0000 0.000000 +16 1 2 x-min out 1 total 0.0000 0.000000 23 1 2 y-max in 1 total 0.0000 0.000000 -8 2 1 x-min out 1 total 0.1892 0.011302 -9 2 1 x-min in 1 total 0.2738 0.093735 -10 2 1 x-max out 1 total 0.0000 0.000000 +22 1 2 y-max out 1 total 0.0000 0.000000 +21 1 2 y-min in 1 total 0.2358 0.041204 +20 1 2 y-min out 1 total 0.1724 0.009114 11 2 1 x-max in 1 total 0.0000 0.000000 -12 2 1 y-min out 1 total 0.0000 0.000000 -13 2 1 y-min in 1 total 0.0000 0.000000 -14 2 1 y-max out 1 total 0.2290 0.038756 +10 2 1 x-max out 1 total 0.0000 0.000000 +9 2 1 x-min in 1 total 0.2738 0.093735 +8 2 1 x-min out 1 total 0.1892 0.011302 15 2 1 y-max in 1 total 0.1894 0.012331 -24 2 2 x-min out 1 total 0.1822 0.011922 -25 2 2 x-min in 1 total 0.1778 0.010514 -26 2 2 x-max out 1 total 0.0244 0.024400 +14 2 1 y-max out 1 total 0.2290 0.038756 +13 2 1 y-min in 1 total 0.0000 0.000000 +12 2 1 y-min out 1 total 0.0000 0.000000 27 2 2 x-max in 1 total 0.0000 0.000000 -28 2 2 y-min out 1 total 0.1894 0.012331 -29 2 2 y-min in 1 total 0.2290 0.038756 -30 2 2 y-max out 1 total 0.0236 0.023600 +26 2 2 x-max out 1 total 0.0244 0.024400 +25 2 2 x-min in 1 total 0.1778 0.010514 +24 2 2 x-min out 1 total 0.1822 0.011922 31 2 2 y-max in 1 total 0.0000 0.000000 +30 2 2 y-max out 1 total 0.0236 0.023600 +29 2 2 y-min in 1 total 0.2290 0.038756 +28 2 2 y-min out 1 total 0.1894 0.012331 mesh 1 delayedgroup group in nuclide mean std. dev. x y z 0 1 1 1 1 1 total 0.000007 4.734745e-07