Skip to content

Commit

Permalink
Remove the "geometry" prefix from features.
Browse files Browse the repository at this point in the history
  • Loading branch information
olson-sean-k committed Nov 23, 2024
1 parent bda9ac5 commit 2066c1b
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
args: --features geometry-nalgebra --no-default-features --verbose
args: --features nalgebra --no-default-features --verbose
- uses: actions-rs/cargo@v1
with:
command: test
Expand Down
14 changes: 8 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,19 @@ rustdoc-args = [
]

[features]
default = ["geometry-nalgebra"]
geometry-cgmath = ["dep:cgmath"]
geometry-glam = ["dep:glam"]
geometry-mint = ["dep:mint"]
geometry-nalgebra = ["dep:nalgebra"]
geometry-ultraviolet = ["dep:ultraviolet"]
default = ["nalgebra"]
lapack = [
"dep:ndarray",
"dep:ndarray-linalg",
]

# Integrations.
cgmath = ["dep:cgmath"]
glam = ["dep:glam"]
mint = ["dep:mint"]
nalgebra = ["dep:nalgebra"]
ultraviolet = ["dep:ultraviolet"]

[dependencies]
approx = "^0.5.0"
decorum = "^0.4.0"
Expand Down
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,19 @@ Theon provides reverse integrations with commonly used linear algebra crates in
the Rust ecosystem, including [`glam`] and [`ultraviolet`]. These
implementations can be enabled using Cargo features.

| Feature | Default | Crate |
|------------------------|---------|-----------------|
| `geometry-cgmath` | No | [`cgmath`] |
| `geometry-glam` | No | [`glam`] |
| `geometry-mint` | No | [`mint`] |
| `geometry-nalgebra` | Yes | [`nalgebra`] |
| `geometry-ultraviolet` | No | [`ultraviolet`] |
| Feature | Default | Crate |
|---------------|---------|-----------------|
| `cgmath` | No | [`cgmath`] |
| `glam` | No | [`glam`] |
| `mint` | No | [`mint`] |
| `nalgebra` | Yes | [`nalgebra`] |
| `ultraviolet` | No | [`ultraviolet`] |

Because a given version of Theon implements traits for specific versions of
integrated crates, care must be taken to resolve to these supported versions.
Ideally, integrations would be implemented in these linear algebra crates, but
Theon is still under development and may not be ready for forward integration.
integrated crates, **care must be taken to resolve to these supported
versions**. Ideally, integrations would be implemented in these linear algebra
crates, but Theon is still under development and may not be ready for forward
integration.

## Spatial Queries

Expand Down
2 changes: 1 addition & 1 deletion src/adjunct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//!
//! Implementations for adjunct traits are provided for integrated foreign types when enabling
//! geometry features. For example, implementations of `Adjunct` and other traits are provided for
//! `nalgebra` types when the `geometry-nalgebra` feature is enabled.
//! `nalgebra` types when the `nalgebra` feature is enabled.
use decorum::cmp::{self, EmptyOrd};
use num::traits::{Bounded, One, Zero};
Expand Down
2 changes: 1 addition & 1 deletion src/integration/cgmath.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg(feature = "geometry-cgmath")]
#![cfg(feature = "cgmath")]

use approx::AbsDiffEq;
use cgmath::{BaseFloat, BaseNum, Point2, Point3, Vector2, Vector3, Vector4};
Expand Down
2 changes: 1 addition & 1 deletion src/integration/glam.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg(feature = "geometry-glam")]
#![cfg(feature = "glam")]

use decorum::R64;
use glam::{Vec2, Vec3, Vec3A, Vec4};
Expand Down
2 changes: 1 addition & 1 deletion src/integration/mint.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg(feature = "geometry-mint")]
#![cfg(feature = "mint")]

// TODO: It is not possible to implement vector space traits for `mint` types, because they require
// foreign traits on foreign types.
Expand Down
2 changes: 1 addition & 1 deletion src/integration/nalgebra.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg(feature = "geometry-nalgebra")]
#![cfg(feature = "nalgebra")]

use approx::AbsDiffEq;
use decorum::R64;
Expand Down
2 changes: 1 addition & 1 deletion src/integration/ultraviolet.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg(feature = "geometry-ultraviolet")]
#![cfg(feature = "ultraviolet")]

use decorum::R64;
use typenum::consts::{U2, U3, U4};
Expand Down
2 changes: 1 addition & 1 deletion src/lapack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ where
}
}

#[cfg(all(test, feature = "geometry-nalgebra"))]
#[cfg(all(test, feature = "nalgebra"))]
mod tests {
use approx::assert_abs_diff_eq;
use nalgebra::Point3;
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! **Theon** abstracts Euclidean spaces and geometric queries with support for popular linear
//! algebra and spatial crates in the Rust ecosystem.
// TODO: Require the `geometry-nalgebra` feature for doc tests.
// TODO: Require the `nalgebra` feature for doc tests.
//
// See https://github.com/rust-lang/rust/issues/43781

Expand Down
2 changes: 1 addition & 1 deletion src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ where
}
impl_symmetrical_intersection!(Plane, Ray);

#[cfg(all(test, feature = "geometry-nalgebra"))]
#[cfg(all(test, feature = "nalgebra"))]
mod tests {
use decorum::real::UnaryRealFunction;
use decorum::ExtendedReal;
Expand Down

0 comments on commit 2066c1b

Please sign in to comment.