Skip to content

Commit 64956fd

Browse files
authored
Feature transformations (#188)
* light-curve-feature 0.5.4 -> 0.5.5 * Init impl of tranform=None * Downgrade enum-iterator for MSRV * Changelog * Reimpl default transformer * Revert "Downgrade enum-iterator for MSRV" We require MSRV 1.62 instead of 1.60 This reverts commit b899278. * Python 3.7 compat * More Python 3.7 compat
1 parent b523316 commit 64956fd

File tree

8 files changed

+716
-167
lines changed

8 files changed

+716
-167
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- Feature transformations via `transoform` constructor keyword. For most of the features it could accept string with a transformation name such as 'arcsinh' or 'clipped_lg', `True` or 'default' for the default transformation, `None` or `False` for no transformation https://github.com/light-curve/light-curve-python/issues/184 https://github.com/light-curve/light-curve-python/pull/188
1213
- Binary wheels for x86_64 Windows built with no Ceres nor GSL features https://github.com/light-curve/light-curve-python/issues/12 https://github.com/light-curve/light-curve-python/pull/185
14+
- `enum-iterator` crate dependency https://github.com/light-curve/light-curve-python/pull/188
1315
- CI: code coverage with `codecov` https://github.com/light-curve/light-curve-python/pull/197
1416
- Development: now project has extras for testing (`test`) and development (`dev`) https://github.com/light-curve/light-curve-python/pull/197
1517

1618
### Changed
1719

20+
- **Build breaking**: minimum supported Rust version (MSRV) is bump from 1.60 to 1.62
21+
- Bump `light-curve-feature` 0.5.4 -> 0.5.5
1822
- Bump `pyO3` 0.18.1 -> 0.18.2
1923
- Most of the parametric features have default values for their parameters now, which, due to `pyO3` limitations, are not presented in the signatures, but documented in the docstrings. It also makes Python and Rust implementations more consistent https://github.com/light-curve/light-curve-python/issues/194 https://github.com/light-curve/light-curve-python/pull/195
2024
- Development: switch from `pytest-markdown` to `markdown-pytest` which allowed us to use up-to-date pytest https://github.com/light-curve/light-curve-python/pull/198
@@ -30,7 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3034

3135
### Fixed
3236

33-
--
37+
- `Bins` feature had non-optimal lower boundary check for time series length: it checked if it is at least unity for any underlying features. Now it takes underlying feature requirements into account. It was fixed by updating `light-curve-feature` to v0.5.5.
3438

3539
### Security
3640

light-curve/Cargo.lock

Lines changed: 139 additions & 20 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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ readme = "README.md"
77
repository = "https://github.com/light-curve/light-curve-python"
88
license = "GPL-3.0-or-later"
99
edition = "2021"
10-
rust-version = "1.60"
10+
rust-version = "1.62"
1111

1212
[lib]
1313
name = "light_curve"
@@ -32,14 +32,15 @@ gsl = ["light-curve-feature/gsl"]
3232
anyhow = "<1.0.49"
3333
const_format = "0.2.30"
3434
conv = "0.3.3"
35+
enum-iterator = "1.1.0,<1.2.0" # 1.2.0 requires MSRV 1.63
3536
enumflags2 = { version = "0.7.5", features = ["serde"] }
3637
itertools = "0.10.5"
3738
macro_const = "0.1.0"
3839
ndarray = { version = "0.15.3", features = ["rayon"] }
3940
numpy = "0.18.0"
4041
num_cpus = "1.13.0"
4142
num-traits = "0.2"
42-
pyo3 = {version = "0.18.2", features = ["extension-module"]}
43+
pyo3 = {version = "0.18.2", features = ["extension-module", "multiple-pymethods"]}
4344
rand = "0.8.5"
4445
rand_xoshiro = "0.6.0"
4546
thiserror = "1.0.37"
@@ -53,5 +54,5 @@ version = "0.7.1"
5354
features = ["serde"]
5455

5556
[dependencies.light-curve-feature]
56-
version = "0.5.4"
57+
version = "0.5.5"
5758
default_features = false

light-curve/src/errors.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import_exception!(pickle, PicklingError);
1111
import_exception!(pickle, UnpicklingError);
1212

1313
#[allow(clippy::enum_variant_names)]
14-
#[derive(Clone, Error, Debug)]
14+
#[derive(Error, Debug)]
1515
#[error("{0}")]
1616
pub(crate) enum Exception {
1717
// builtins
@@ -23,6 +23,8 @@ pub(crate) enum Exception {
2323
// pickle
2424
PicklingError(String),
2525
UnpicklingError(String),
26+
// some exception from pyo3 which we need to handle
27+
PyO3(#[from] PyErr),
2628
}
2729

2830
impl From<Exception> for PyErr {
@@ -37,6 +39,8 @@ impl From<Exception> for PyErr {
3739
// pickle
3840
Exception::PicklingError(err) => PicklingError::new_err(err),
3941
Exception::UnpicklingError(err) => UnpicklingError::new_err(err),
42+
// pyo3
43+
Exception::PyO3(err) => err,
4044
}
4145
}
4246
}

0 commit comments

Comments
 (0)