Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nvaytet committed Nov 21, 2023
1 parent 7797731 commit cd8876a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ess/dream/io/geant4.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def group(key: str, da: sc.DataArray) -> sc.DataArray:
else:
elems = elements
res = da.group(*elems)
if 'sector' in elems:
if 'sector' not in elems:
res.bins.coords.pop('sector', None)
return res

Expand Down
2 changes: 2 additions & 0 deletions tests/dream/io/geant4_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def test_load_geant4_csv_endcap_backward_has_expected_coords(file):
assert_index_coord(endcap.coords['counter'])
assert_index_coord(endcap.coords['wire'], values=set(range(1, 17)))
assert_index_coord(endcap.coords['strip'], values=set(range(1, 17)))
assert_index_coord(endcap.coords['sumo'], values=set(range(3, 7)))
assert 'sector' not in endcap.coords

assert 'sector' not in endcap.bins.coords
Expand All @@ -104,6 +105,7 @@ def test_load_geant4_csv_endcap_forward_has_expected_coords(file):
assert_index_coord(endcap.coords['counter'])
assert_index_coord(endcap.coords['wire'], values=set(range(1, 17)))
assert_index_coord(endcap.coords['strip'], values=set(range(1, 17)))
assert_index_coord(endcap.coords['sumo'], values=set(range(3, 7)))
assert 'sector' not in endcap.coords

assert 'sector' not in endcap.bins.coords
Expand Down

0 comments on commit cd8876a

Please sign in to comment.