diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c30e4e..a21a39f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,6 +31,10 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Install non-python (homebrew) dependencies + if: ${{ matrix.os == 'macOS-latest' }} + run: | + brew install opencascade cgal gmp mpfr boost - name: Get dependencies and install reboost run: | python -m pip install --upgrade pip wheel setuptools diff --git a/src/reboost/core.py b/src/reboost/core.py index 11038bb..ccf1c41 100644 --- a/src/reboost/core.py +++ b/src/reboost/core.py @@ -172,10 +172,9 @@ def get_detectors_mapping( # if no package was imported its just a name try: - out_names.extend( - evaluate_object(output_detector_expression, local_dict={"OBJECTS": objects}) - ) - except NameError: + objs = evaluate_object(output_detector_expression, local_dict={"OBJECTS": objects}) + out_names.extend(objs) + except Exception: out_names.append(output_detector_expression) # simple one to one mapping diff --git a/tests/test_core.py b/tests/test_core.py index 6125dc6..9b89c98 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -146,6 +146,8 @@ def test_detector_mapping(): "2": ["2"], } + assert reboost.core.get_detectors_mapping("0") == {"0": ["0"]} + # with input name assert reboost.core.get_detectors_mapping( "[str(i) for i in range(3)]", input_detector_name="dets" @@ -159,4 +161,8 @@ def test_detector_mapping(): def test_remove_columns(): - pass + tab = Table({"a": Array([1, 2, 3]), "b": Array([1, 2, 3])}) + + tab = reboost.core.remove_columns(tab, ["a"]) + + assert next(iter(tab.keys())) == "a"