Skip to content

Commit d8afa78

Browse files
committed
Initial pyO3 0.27 support
1 parent 235f7d1 commit d8afa78

File tree

5 files changed

+22
-19
lines changed

5 files changed

+22
-19
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Changed
1515

16-
- Bump `pyO3` and `rust-numpy` to 0.26.0: introduce Python build 3.14/3.14t support https://github.com/light-curve/light-curve-python/pull/553
17-
- **Breaking** macOS x86\_64 binary wheel now requires macOS 15 instead of 13 https://github.com/light-curve/light-curve-python/issues/587
16+
- Bump `pyO3` and `rust-numpy` from 0.25.0 to 0.27.0: introduce Python build 3.14/3.14t
17+
support https://github.com/light-curve/light-curve-python/pull/553 https://github.com/light-curve/light-curve-python/pull/590
18+
- **Breaking** macOS x86\_64 binary wheel now requires macOS 15 instead of
19+
13 https://github.com/light-curve/light-curve-python/issues/587
1820

1921
### Deprecated
2022

light-curve/Cargo.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

light-curve/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ mimalloc = { version = "0.1.48", features = [
4747
"local_dynamic_tls",
4848
], optional = true }
4949
ndarray = { version = "0.16.1", features = ["rayon"] }
50-
numpy = "0.26.0"
50+
numpy = "0.27.0"
5151
num_cpus = "1.17.0"
5252
num-traits = "0.2"
5353
once_cell = "1"
54-
pyo3 = { version = "0.26.0", features = [
54+
pyo3 = { version = "0.27.1", features = [
5555
"extension-module",
5656
"multiple-pymethods",
5757
] }

light-curve/src/features.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,7 +1684,7 @@ impl Periodogram {
16841684
const STEP_SIZE_TOLLERANCE: f64 = 10.0 * f32::EPSILON as f64;
16851685

16861686
// It is more likely for users to give f64 array
1687-
let freqs_f64 = PyArrayLike1::<f64, AllowTypeChange>::extract_bound(&freqs)?;
1687+
let freqs_f64 = PyArrayLike1::<f64, AllowTypeChange>::extract(freqs.as_borrowed())?;
16881688
let freqs_f64 = freqs_f64.readonly();
16891689
let freqs_f64 = freqs_f64.as_array();
16901690
let size = freqs_f64.len();
@@ -1726,7 +1726,8 @@ impl Periodogram {
17261726

17271727
let freq_grid_f32 = match &freq_grid_f64 {
17281728
FreqGrid::Arbitrary(_) => {
1729-
let freqs_f32 = PyArrayLike1::<f32, AllowTypeChange>::extract_bound(&freqs)?;
1729+
let freqs_f32 =
1730+
PyArrayLike1::<f32, AllowTypeChange>::extract(freqs.as_borrowed())?;
17301731
let freqs_f32 = freqs_f32.readonly();
17311732
let freqs_f32 = freqs_f32.as_array();
17321733
FreqGrid::from_array(freqs_f32)

light-curve/src/np_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ fn try_downcast_to_f64_array<'py>(
150150
) -> Option<PyReadonlyArray1<'py, f64>> {
151151
match (obj.downcast::<PyArray1<f64>>(), cast) {
152152
(Ok(py_array), _) => Some(py_array.readonly()),
153-
(Err(_), true) => match PyArrayLike1::<f64, AllowTypeChange>::extract_bound(obj) {
153+
(Err(_), true) => match PyArrayLike1::<f64, AllowTypeChange>::extract(obj.as_borrowed()) {
154154
Ok(py_array) => Some(py_array.readonly()),
155155
Err(_) => None,
156156
},

0 commit comments

Comments
 (0)