Skip to content

Commit

Permalink
Add support for Python 3.13 to the Python interface
Browse files Browse the repository at this point in the history
  • Loading branch information
cschwan committed Jan 22, 2025
1 parent 18f1acf commit e5793e9
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ jobs:
3.9
3.11
3.12
3.13
3.10
- name: Install dependencies
run: |
Expand Down Expand Up @@ -379,6 +380,7 @@ jobs:
3.9
3.11
3.12
3.13
3.10
- name: Build wheels
uses: PyO3/maturin-action@v1
Expand Down Expand Up @@ -429,6 +431,7 @@ jobs:
3.9
3.11
3.12
3.13
3.10
architecture: ${{ matrix.target }}
- name: Build wheels
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## Added

- added support for Python 3.13 to the Python interface

## [0.8.6] - 18/10/2024

### Fixed
Expand Down
87 changes: 27 additions & 60 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pineappl_py/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ crate-type = ["cdylib"]
[dependencies]
itertools = "0.10.1"
ndarray = "0.15.4"
numpy = "0.21.0"
numpy = "0.22.0"
pineappl = { path = "../pineappl", version = "=0.8.6" }
pyo3 = { features = ["extension-module"], version = "0.21.2" }
pyo3 = { features = ["extension-module", "gil-refs"], version = "0.22.0" }
2 changes: 1 addition & 1 deletion pineappl_py/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ classifiers = [
"Programming Language :: Rust",
"Topic :: Scientific/Engineering :: Physics",
]
dependencies = ["numpy>=1.16.0,<2.0.0"]
dependencies = ["numpy>=1.16.0"]
dynamic = ["version"]

[project.optional-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions pineappl_py/src/fk_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ impl PyFkTable {
bin_indices: Option<PyReadonlyArray1<usize>>,
lumi_mask: Option<PyReadonlyArray1<bool>>,
py: Python<'py>,
) -> &'py PyArray1<f64> {
) -> Bound<'py, PyArray1<f64>> {
let mut xfx1 = |id, x, q2| f64::extract(xfx1.call1((id, x, q2)).unwrap()).unwrap();
let mut xfx2 = |id, x, q2| f64::extract(xfx2.call1((id, x, q2)).unwrap()).unwrap();
let mut alphas = |_| 1.0;
Expand All @@ -285,7 +285,7 @@ impl PyFkTable {
&bin_indices.map_or(vec![], |b| b.to_vec().unwrap()),
&lumi_mask.map_or(vec![], |l| l.to_vec().unwrap()),
)
.into_pyarray(py)
.into_pyarray_bound(py)
}

/// Optimize FK table storage
Expand Down

0 comments on commit e5793e9

Please sign in to comment.