diff --git a/.github/workflows/pypi_install.yml b/.github/workflows/pypi_install.yml index 79e5581db..52ea2b10b 100644 --- a/.github/workflows/pypi_install.yml +++ b/.github/workflows/pypi_install.yml @@ -14,7 +14,7 @@ jobs: - name: Setup python uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.12" - name: Checkout repo uses: actions/checkout@v4 - name: Install dependencies diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 0cba06e6d..39829fb64 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -21,11 +21,11 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11"] + python-version: ["3.10", "3.11", "3.12"] test: ["coveralls", "pytest"] # Installation on py3.10 is rather slow at the moment exclude: - - python-version: "3.11" + - python-version: "3.12" test: coveralls steps: - name: Checkout repo @@ -41,6 +41,9 @@ jobs: run: pip install git+https://github.com/XENONnT/base_environment.git@el7.2025.01.3 --force-reinstall - name: Install requirements for Python 3.11 if: matrix.python-version == '3.11' + run: pip install git+https://github.com/XENONnT/base_environment.git@el8.2026.02.2 --force-reinstall + - name: Install requirements for Python 3.12 + if: matrix.python-version == '3.12' run: pip install git+https://github.com/XENONnT/base_environment.git --force-reinstall - name: Install strax run: pip install . diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 1306c9c28..2e28f9f11 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11"] + python-version: ["3.10", "3.11", "3.12"] steps: - name: Setup python uses: actions/setup-python@v5 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e884a0ae5..607850c69 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,6 +20,7 @@ repos: rev: v1.7.6 hooks: - id: docformatter + language_version: python3.12 additional_dependencies: [tomli] args: [--config, pyproject.toml] diff --git a/strax/run_selection.py b/strax/run_selection.py index e3f328774..e06fb1793 100644 --- a/strax/run_selection.py +++ b/strax/run_selection.py @@ -193,7 +193,7 @@ def scan_runs( docs = new_docs else: # Keep only new runs (not found by earlier frontends) - mask = ~np.in1d(new_docs["name"], docs["name"]) + mask = ~np.isin(new_docs["name"], docs["name"]) if np.any(mask): docs = pd.concat([docs, new_docs[mask]], sort=False) docs.reset_index(drop=True, inplace=True) @@ -211,7 +211,7 @@ def scan_runs( desc="Checking data availability", disable=not len(check_available), ): - self.runs[d + "_available"] = np.in1d(self.runs.name.values, self.list_available(d)) + self.runs[d + "_available"] = np.isin(self.runs.name.values, self.list_available(d)) return self.runs @@ -305,7 +305,7 @@ def select_runs( desc="Checking data availability", disable=not len(check_available), ): - dsets[d + "_available"] = np.in1d( + dsets[d + "_available"] = np.isin( dsets.name.values, self.list_available(target=d, runs=dsets.name.values) ) @@ -315,7 +315,7 @@ def select_runs( for d in have_available: if not d + "_available" in dsets.columns: # Get extra availability info from the run db - d_available = np.in1d( + d_available = np.isin( dsets.name.values, self.list_available(target=d, runs=dsets.name.values) ) # Save both in the context and for this selection using diff --git a/tests/test_data_reduction.py b/tests/test_data_reduction.py index 552ea89ab..c50501679 100644 --- a/tests/test_data_reduction.py +++ b/tests/test_data_reduction.py @@ -13,7 +13,7 @@ def test_cut_outside_hits(records): for r in records: r["data"] = 0 r["data"][: r["length"]] = 1 - assert np.all(np.in1d(r["data"], [0, 1])) + assert np.all(np.isin(r["data"], [0, 1])) left_extension = 2 right_extension = 3