Skip to content

Commit

Permalink
Document changes to NAN behaviour.
Browse files Browse the repository at this point in the history
  • Loading branch information
davehadley committed Dec 3, 2023
1 parent 63a1d53 commit a31b56e
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ndhistogram/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.10.0 (2023-12-03)

- Fix issue 33: Filling a histogram where the axis value is NaN not longer panics. NaN is mapped to no bin so those values are not filled in histograms.
- Fix new clippy and compiler warnings.
- Minimum supported rust version is increased to 1.63.0.

# 0.9.0 (2023-05-19)

- Make serde an optional dependency. This is a breaking change. If you were using serde with this crate's types you will have to enable the "serde" feature flag in your `Cargo/toml`.
Expand Down
3 changes: 3 additions & 0 deletions ndhistogram/src/axis/uniform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ use super::{Axis, BinInterval};
/// Below (above) this range is an underflow (overflow) bin.
/// Hence this axis has N+2 bins.
///
/// For floating point types, positive and negative infinities map to overflow
/// and underflow bins respectively. NaN does not map to any bin.
///
/// # Example
/// Create a 1D histogram with 10 uniform bins between -5.0 and 5.0, plus overflow and underflow bins.
/// ```rust
Expand Down
2 changes: 2 additions & 0 deletions ndhistogram/src/axis/uniformcyclic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ where
///
/// Only implemented for [Float]. Use [UniformCyclic::with_step_size] for integers.
///
/// For floating point types, infinities and NaN do not map to any bin.
///
/// # Panics
/// Panics under the same conditions as [Uniform::new].
pub fn new(nbins: usize, low: T, high: T) -> Self
Expand Down
2 changes: 2 additions & 0 deletions ndhistogram/src/axis/uniformnoflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use num_traits::{Float, Num, NumCast, NumOps};
/// Similar to [Uniform] but this axis has no over/underflow bins.
/// Hence it has N bins.
///
/// For floating point types, infinities and NaN do not map to any bin.
///
/// # Example
/// Create a 1D histogram with 10 uniformly spaced bins between -5.0 and 5.0.
/// ```rust
Expand Down
3 changes: 3 additions & 0 deletions ndhistogram/src/axis/variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ use super::{Axis, BinInterval};
/// Beyond the lowest (highest) bin edges is an underflow (overflow) bin.
/// Hence this axis has num edges + 1 bins.
///
/// For floating point types, positive and negative infinities map to overflow
/// and underflow bins respectively. NaN does not map to any bin.
///
/// # Example
/// Create a 1D histogram with 3 variable width bins between 0.0 and 7.0, plus overflow and underflow bins.
/// ```rust
Expand Down
2 changes: 2 additions & 0 deletions ndhistogram/src/axis/variablecyclic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use num_traits::Num;
/// A wrap-around axis with variable-sized bins, constructed from a list of bin
/// edges.
///
/// For floating point types, infinities and NaN do not map to any bin.
///
/// # Examples
/// 1D histogram with cyclic variable sized azimuthal angle binning.
/// ```
Expand Down
2 changes: 2 additions & 0 deletions ndhistogram/src/axis/variablenoflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use std::fmt::{Debug, Display};
/// An axis with variable sized bins constructed with a list of bin edges.
/// This axis has (num edges - 1) bins.
///
/// For floating point types, infinities and NaN do not map to any bin.
///
/// # Example
/// Create a 1D histogram with 3 variable width bins between 0.0 and 7.0.
/// ```rust
Expand Down

0 comments on commit a31b56e

Please sign in to comment.