From 3dfc0d21e47ec6cd90f07ea26bb3a911e1429123 Mon Sep 17 00:00:00 2001 From: Ekin Developer Date: Mon, 12 Oct 2026 20:16:07 +0100 Subject: [PATCH 1/4] Fixed indexing of tuple returned by event detection and changed torch CUDA dependency to use CUDA 13.0 instead of 12.6 --- desolver/differential_system.py | 3 +-- pyproject.toml | 26 ++++++++++++++++++++------ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/desolver/differential_system.py b/desolver/differential_system.py index 1c2724a..a0d26c8 100644 --- a/desolver/differential_system.py +++ b/desolver/differential_system.py @@ -145,7 +145,7 @@ def __local_ev_f(t): down & (direction < 0) | either & (direction == 0)) - active_events = D.ar_numpy.reshape(D.ar_numpy.nonzero(mask), (-1,)) + active_events = D.ar_numpy.nonzero(mask)[0] roots = roots[active_events] evs = [events[idx] for idx in active_events] @@ -1253,4 +1253,3 @@ def __step_cb(ode_sys): y_events=ode_system.events, nfev=ode_system.nfev, njev=ode_system.njev, status=ode_system.integration_status, message=ode_system.integration_status, success=ode_system.success, ode_system=ode_system) - \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 11d0eeb..876f353 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,8 +65,8 @@ test = [ [tool.uv.sources] torch = [ - { index = "pytorch-cu126", marker = "sys_platform == 'win32'" }, - { index = "pytorch-cu126", marker = "sys_platform == 'linux'" }, + { index = "pytorch-cu130", marker = "sys_platform == 'win32'" }, + { index = "pytorch-cu130", marker = "sys_platform == 'linux'" }, { index = "pytorch-cpu", marker = "sys_platform == 'darwin'" }, ] @@ -76,10 +76,24 @@ url = "https://download.pytorch.org/whl/cpu" explicit = true [[tool.uv.index]] -name = "pytorch-cu126" -url = "https://download.pytorch.org/whl/cu126" +name = "pytorch-cu130" +url = "https://download.pytorch.org/whl/cu130" explicit = true +[tool.hatch.envs.default] +dependencies = [ + 'numpy>=2', + 'tqdm>=4.47.0', + 'scipy>=1.15.0', + 'autoray>=0.7.0', + 'einops>=0.8.0' +] + +[tool.hatch.envs.torch] +extra-dependencies = [ + "torch>=2.5.0" +] + [tool.hatch.envs.dev] installer = "uv" extra-dependencies = [ @@ -95,7 +109,7 @@ extra-dependencies = [ [tool.hatch.envs.hatch-test] installer = "uv" -parallel = true +#parallel = true default-args = ["desolver"] features = [ "test" @@ -133,7 +147,7 @@ exclude = [ packages = ["desolver/"] [tool.coverage.run] -parallel = true +#parallel = true branch = true relative_files = true source = ["desolver"] From abab01216235f9fb79879cef4e8221e047d4d183 Mon Sep 17 00:00:00 2001 From: Ekin Developer Date: Mon, 12 Oct 2026 21:31:59 +0100 Subject: [PATCH 2/4] Codecov workflow change --- .github/workflows/pytest-ubuntu.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pytest-ubuntu.yml b/.github/workflows/pytest-ubuntu.yml index d4da438..a705ed6 100644 --- a/.github/workflows/pytest-ubuntu.yml +++ b/.github/workflows/pytest-ubuntu.yml @@ -29,15 +29,15 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Set up Python ${{ matrix.python-version }} - uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1 pinned commit + uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0 pinned commit continue-on-error: true with: miniforge-version: latest use-mamba: true auto-update-conda: true - channels: conda-forge, defaults + channels: conda-forge python-version: ${{ matrix.python-version }} - name: Output conda info run: | @@ -55,7 +55,7 @@ jobs: - name: Rename file run: mv coverage/.coverage coverage/.coverage.${{ matrix.python-version }}.${{ matrix.os }} - name: Upload coverage data - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: .coverage.${{ matrix.python-version }}.${{ matrix.os }} path: coverage/.coverage.${{ matrix.python-version }}.${{ matrix.os }} @@ -72,16 +72,16 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: actions/setup-python@v5 with: # Use latest Python, so it understands all syntax. python-version: "3.12" - name: Install a specific version of uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0 with: version: "0.4.4" - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v8 with: pattern: .coverage.* - name: Install coverage.py @@ -95,16 +95,17 @@ jobs: coverage xml -o desolver-coverage.xml - name: Upload XML report if check failed - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: xml-report path: desolver-coverage.xml - name: Upload coverage report to codecov - uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1 + uses: codecov/codecov-action@v7 + if: ${{ !cancelled() }} with: fail_ci_if_error: true # optional (default = false) flags: pr-tests-${{ github.head_ref }} # optional name: desolver-combined-reports # optional token: ${{ secrets.CODECOV_TOKEN }} verbose: true # optional (default = false) - \ No newline at end of file + From 0c5e3d49f2d1060db4bb61ba4c953cdb0d4f65a9 Mon Sep 17 00:00:00 2001 From: Ekin Developer Date: Fri, 16 Oct 2026 17:10:31 +0100 Subject: [PATCH 3/4] Modify testing to include xml output --- .github/workflows/pytest-ubuntu.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pytest-ubuntu.yml b/.github/workflows/pytest-ubuntu.yml index a705ed6..5b106b7 100644 --- a/.github/workflows/pytest-ubuntu.yml +++ b/.github/workflows/pytest-ubuntu.yml @@ -51,14 +51,12 @@ jobs: python -m pip install --upgrade pip python -m pip install --requirement build-requirements.txt - name: Test All backend - run: hatch test --all --cover -- -vx - - name: Rename file - run: mv coverage/.coverage coverage/.coverage.${{ matrix.python-version }}.${{ matrix.os }} + run: hatch test --all --cover-xml --cover-xml-output coverage/.coverage.${{ matrix.python-version }}.${{ matrix.os }}.xml -- -vx - name: Upload coverage data uses: actions/upload-artifact@v7 with: - name: .coverage.${{ matrix.python-version }}.${{ matrix.os }} - path: coverage/.coverage.${{ matrix.python-version }}.${{ matrix.os }} + name: .coverage.${{ matrix.python-version }}.${{ matrix.os }}.xml + path: coverage/.coverage.${{ matrix.python-version }}.${{ matrix.os }}.xml include-hidden-files: true if-no-files-found: ignore coverage: @@ -88,7 +86,7 @@ jobs: run: uv tool install 'coverage[toml]' - name: Combine coverage run: | - coverage combine .coverage.* + coverage combine .coverage.*.xml # Report and write to summary. coverage report --format=markdown >> $GITHUB_STEP_SUMMARY From 899fd8d9867b435978bf62da649a45cffde4eaa1 Mon Sep 17 00:00:00 2001 From: Ekin Developer Date: Fri, 16 Oct 2026 18:28:45 +0100 Subject: [PATCH 4/4] Add CI env probe --- .github/workflows/pytest-ubuntu.yml | 31 ++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pytest-ubuntu.yml b/.github/workflows/pytest-ubuntu.yml index 5b106b7..fb1253b 100644 --- a/.github/workflows/pytest-ubuntu.yml +++ b/.github/workflows/pytest-ubuntu.yml @@ -50,17 +50,38 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install --requirement build-requirements.txt + - name: Probe Windows PyTorch environment + if: ${{ matrix.os == 'windows-latest' }} + shell: pwsh + run: | + hatch --env hatch-test.torch run python -c "import sys, torch; print('Python:', sys.version); print('Torch:', torch.__version__); print('CUDA build:', torch.version.cuda); print('CUDA available:', torch.cuda.is_available()); print('CUDA devices:', torch.cuda.device_count()); print(torch.__config__.show())" + Get-CimInstance Win32_Processor | + Select-Object Name, Manufacturer, NumberOfCores, NumberOfLogicalProcessors + - name: Probe bfloat16 add + if: ${{ matrix.os == 'windows-latest' }} + run: hatch --env hatch-test.torch run python -c "import torch; print(torch.ones(4,4,dtype=torch.bfloat16) + 1)" + - name: Probe bfloat16 matmul + if: ${{ matrix.os == 'windows-latest' }} + run: hatch --env hatch-test.torch run python -c "import torch; print(torch.ones(4,4,dtype=torch.bfloat16) @ torch.ones(4,4,dtype=torch.bfloat16))" + - name: Show installed packages + if: ${{ matrix.os == 'windows-latest' }} + shell: pwsh + run: | + hatch --env hatch-test.torch run uv pip show torch + hatch --env hatch-test.torch run uv pip freeze | Select-String "torch|numpy|scipy" - name: Test All backend - run: hatch test --all --cover-xml --cover-xml-output coverage/.coverage.${{ matrix.python-version }}.${{ matrix.os }}.xml -- -vx + run: hatch test --all --cover + - name: Rename file + run: mv coverage/.coverage coverage/.coverage.${{ matrix.python-version }}.${{ matrix.os }} - name: Upload coverage data uses: actions/upload-artifact@v7 with: - name: .coverage.${{ matrix.python-version }}.${{ matrix.os }}.xml - path: coverage/.coverage.${{ matrix.python-version }}.${{ matrix.os }}.xml + name: .coverage.${{ matrix.python-version }}.${{ matrix.os }} + path: coverage/.coverage.${{ matrix.python-version }}.${{ matrix.os }} include-hidden-files: true if-no-files-found: ignore coverage: - name: Combine & check coverage + name: Upload coverage if: always() needs: tests runs-on: ubuntu-latest @@ -86,7 +107,7 @@ jobs: run: uv tool install 'coverage[toml]' - name: Combine coverage run: | - coverage combine .coverage.*.xml + coverage combine .coverage.* # Report and write to summary. coverage report --format=markdown >> $GITHUB_STEP_SUMMARY