Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Approx 0.5 #1380

Merged
merged 2 commits into from Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions Cargo.toml
Expand Up @@ -34,8 +34,7 @@ num-complex = { version = "0.4", default-features = false }
# Use via the `rayon` crate feature!
rayon_ = { version = "1.0.3", optional = true, package = "rayon" }

approx = { version = "0.4", optional = true , default-features = false }
approx-0_5 = { package = "approx", version = "0.5", optional = true , default-features = false }
approx = { version = "0.5", optional = true , default-features = false }

# Use via the `blas` crate feature!
cblas-sys = { version = "0.1.4", optional = true, default-features = false }
Expand All @@ -49,7 +48,7 @@ rawpointer = { version = "0.2" }
[dev-dependencies]
defmac = "0.2"
quickcheck = { version = "1.0", default-features = false }
approx = "0.4"
approx = "0.5"
itertools = { version = "0.10.0", default-features = false, features = ["use_std"] }

[features]
Expand All @@ -66,7 +65,7 @@ serde-1 = ["serde"]
test = []

# This feature is used for docs
docs = ["approx", "approx-0_5", "serde", "rayon"]
docs = ["approx", "serde", "rayon"]

std = ["num-traits/std", "matrixmultiply/std"]
rayon = ["rayon_", "std"]
Expand Down
4 changes: 0 additions & 4 deletions README.rst
Expand Up @@ -85,10 +85,6 @@ your `Cargo.toml`.

- ``approx``

- Implementations of traits from version 0.4 of the [`approx`] crate.

- ``approx-0_5``

- Implementations of traits from version 0.5 of the [`approx`] crate.

- ``blas``
Expand Down
3 changes: 0 additions & 3 deletions src/array_approx.rs
Expand Up @@ -193,6 +193,3 @@ macro_rules! impl_approx_traits {

#[cfg(feature = "approx")]
impl_approx_traits!(approx, "**Requires crate feature `\"approx\"`.**");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you want to keep the macro around for the time when approx 0.6 is relevant?

From a code maintenance perspective, getting the code out of the macro would be preferable IMHO.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just adapting necessary changes with as low overhead as possible, unfortunately. I'm going for less than perfect for this release 🙂

Keeping the macro doesn't sound so useful no, approx doesn't look like it's going to have a release soon. If you want to fix this, it would be welcome too.


#[cfg(feature = "approx-0_5")]
impl_approx_traits!(approx_0_5, "**Requires crate feature `\"approx-0_5\"`.**");
5 changes: 1 addition & 4 deletions src/doc/crate_feature_flags.rs
Expand Up @@ -19,10 +19,7 @@
//! - Implies std
//!
//! ## `approx`
//! - Enables implementations of traits from version 0.4 of the [`approx`] crate.
//!
//! ## `approx-0_5`
//! - Enables implementations of traits from version 0.5 of the [`approx`] crate.
//! - Enables implementations of traits of the [`approx`] crate.
//!
//! ## `blas`
//! - Enable transparent BLAS support for matrix multiplication.
Expand Down
5 changes: 2 additions & 3 deletions src/lib.rs
Expand Up @@ -81,8 +81,7 @@
//! - `std`: Rust standard library-using functionality (enabled by default)
//! - `serde`: serialization support for serde 1.x
//! - `rayon`: Parallel iterators, parallelized methods, the [`parallel`] module and [`par_azip!`].
//! - `approx` Implementations of traits from version 0.4 of the [`approx`] crate.
//! - `approx-0_5`: Implementations of traits from version 0.5 of the [`approx`] crate.
//! - `approx` Implementations of traits from the [`approx`] crate.
//! - `blas`: transparent BLAS support for matrix multiplication, needs configuration.
//! - `matrixmultiply-threading`: Use threading from `matrixmultiply`.
//!
Expand Down Expand Up @@ -1600,7 +1599,7 @@ pub mod linalg;
mod impl_ops;
pub use crate::impl_ops::ScalarOperand;

#[cfg(any(feature = "approx", feature = "approx-0_5"))]
#[cfg(feature = "approx")]
mod array_approx;

// Array view methods
Expand Down
2 changes: 1 addition & 1 deletion xtest-blas/Cargo.toml
Expand Up @@ -8,7 +8,7 @@ publish = false
test = false

[dev-dependencies]
approx = "0.4"
approx = "0.5"
defmac = "0.2"
num-traits = "0.2"
num-complex = { version = "0.4", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion xtest-numeric/Cargo.toml
Expand Up @@ -6,7 +6,7 @@ publish = false
edition = "2018"

[dependencies]
approx = "0.4"
approx = "0.5"
ndarray = { path = "..", features = ["approx"] }
ndarray-rand = { path = "../ndarray-rand" }
rand_distr = "0.4"
Expand Down