From 7c4ed737afe8b9ece0b35523bd7c7030962548a6 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Sun, 13 Nov 2016 14:38:57 -0500 Subject: [PATCH] Fixing failing tests --- openmc/mgxs/mgxs.py | 9 ++++- tests/1d_mgxs.h5 | Bin 128136 -> 134280 bytes tests/test_tallies/inputs_true.dat | 2 +- tests/test_tallies/results_true.dat | 2 +- tests/test_tallies/test_tallies.py | 51 ++++++++++------------------ 5 files changed, 28 insertions(+), 36 deletions(-) diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index 036feac74a..1337b1fa7f 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -3784,7 +3784,14 @@ class ScatterMatrixXS(MatrixMGXS): axes = (5, 4, 0) else: axes = (4, 3, 0) - xs = np.squeeze(xs, axis=axes) + # Squeeze will return a ValueError if the axis has a size greater + # than 1, so try each axis in axes one at a time, catching the + # ValueError as needed. + for axis in axes: + try: + xs = np.squeeze(xs, axis=axis) + except ValueError: + pass return xs diff --git a/tests/1d_mgxs.h5 b/tests/1d_mgxs.h5 index e3b85c24163fe4020435db5c5d674575f2b65be0..8f28e02cbcfb2d51e94d81bafdd97ba1220313d3 100644 GIT binary patch delta 1872 zcmeBp$=)%OV}d3V57S2N^&FEQ>6%Udp}}a#>mD2Jt{xlhUzCzs6ua4vGeiZ4-1K|- zj82;)^o%5MDA@eZZ3$2=9-G0F{Wz^Q2P9mQ!66SZ{6_67aU2T31{6%Yh12qV>!0Z0 za2V9(cRwlOP_TL5e;Z947H`kfWc=fbOA;6+XDo0@%B^I~@($)<@L*tJU|?Wm;A0SB z;9w|DPAn-&Es8JBNGwPNic2ywG6(=^5M~5o2A~=cfUp^Wx)>Nb{y=yTQefgiQK}lt z1h$as#xm2!SWsXBgNxdMz)Blq*=S=dJ8g`GBt5E!EhlYU%S9VwxoKl855(Aw2cI); zyx_-J@9ymH1J2N(oDT%Z86L!sMk$&Z7$CV6QXpWHhh#V0@{oK3m#@dL0FndX3NYj$ zNg201Bu(O$ha@hTd_ATQA;|=$08<_k-?-%=5rp3P1aq9E?7p0^Y#YVdWk$Nlx!{i0J7L%_jOHI7Mwz+`Q zNQHo!$qHHunepMj*Zq&XK z$FB-xR>8De1YPxD{UIF!E{FK=?k7b8>NY?4FQtjsRof?MGTw5