Skip to content

Commit

Permalink
Add support for numpy 2.0 (#226)
Browse files Browse the repository at this point in the history
* try upping the numpy version for test requirements

* up the matplotlib version to one that supports numpy 2.0

* Update the version of scipy to be compatible with numpy2

* change CI to use python version specific requirements

* fix 3.8 reqs

* add myself to credits

* fix changes in solve with numpy2.0
  • Loading branch information
DomFijan authored Jun 24, 2024
1 parent e9f5716 commit 5cae590
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .github/requirements3.10.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
hypothesis==6.86.2
matplotlib==3.8.4
miniball==1.2.0
numpy==2.0.0
plato-draw==1.12.0
pytest==7.4.2
pytest-cov==4.1.0
rowan==1.2
scipy==1.13.0
9 changes: 9 additions & 0 deletions .github/requirements3.11.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
hypothesis==6.86.2
matplotlib==3.8.4
miniball==1.2.0
numpy==2.0.0
plato-draw==1.12.0
pytest==7.4.2
pytest-cov==4.1.0
rowan==1.2
scipy==1.13.0
9 changes: 9 additions & 0 deletions .github/requirements3.12.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
hypothesis==6.86.2
matplotlib==3.8.4
miniball==1.2.0
numpy==2.0.0
plato-draw==1.12.0
pytest==7.4.2
pytest-cov==4.1.0
rowan==1.2
scipy==1.13.0
File renamed without changes.
9 changes: 9 additions & 0 deletions .github/requirements3.9.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
hypothesis==6.86.2
matplotlib==3.8.4
miniball==1.2.0
numpy==2.0.0
plato-draw==1.12.0
pytest==7.4.2
pytest-cov==4.1.0
rowan==1.2
scipy==1.13.0
4 changes: 2 additions & 2 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8","3.9","3.10","3.11"]
python-version: ["3.8","3.9","3.10","3.11","3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -31,7 +31,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -r .github/requirements.txt
python -m pip install -r .github/requirements${{matrix.python-version}}.txt
- name: Install package
run: |
python --version
Expand Down
1 change: 1 addition & 0 deletions Credits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ Domagoj Fijan
* Pre-commit now uses ruff instead of flake8, pydocstyle, pyupgrade and isort.
* Ported CI to github actions.
* Ported docs to Furo.
* Added support for Python 3.12 and numpy 2.0.

Source code
-----------
Expand Down
4 changes: 3 additions & 1 deletion coxeter/families/plane_shape_families.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ def make_vertices(cls, a, b, c):
# those cases.
dets = np.linalg.det(coeffs)
solution_indices = np.abs(dets) > thresh
xs = np.linalg.solve(coeffs[solution_indices], bs[solution_indices])
xs = np.linalg.solve(coeffs[solution_indices], bs[solution_indices][..., None])[
..., 0
]

# Reject any solutions that are intersections that lie beyond at least
# one of the bounding planes.
Expand Down

0 comments on commit 5cae590

Please sign in to comment.