diff --git a/ndhistogram/CHANGELOG.md b/ndhistogram/CHANGELOG.md index 79d30e1..60378aa 100644 --- a/ndhistogram/CHANGELOG.md +++ b/ndhistogram/CHANGELOG.md @@ -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`. diff --git a/ndhistogram/src/axis/uniform.rs b/ndhistogram/src/axis/uniform.rs index 0b30b9d..be9b6de 100644 --- a/ndhistogram/src/axis/uniform.rs +++ b/ndhistogram/src/axis/uniform.rs @@ -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 diff --git a/ndhistogram/src/axis/uniformcyclic.rs b/ndhistogram/src/axis/uniformcyclic.rs index 160cd43..03c5537 100644 --- a/ndhistogram/src/axis/uniformcyclic.rs +++ b/ndhistogram/src/axis/uniformcyclic.rs @@ -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 diff --git a/ndhistogram/src/axis/uniformnoflow.rs b/ndhistogram/src/axis/uniformnoflow.rs index 13be4d5..bfcc538 100644 --- a/ndhistogram/src/axis/uniformnoflow.rs +++ b/ndhistogram/src/axis/uniformnoflow.rs @@ -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 diff --git a/ndhistogram/src/axis/variable.rs b/ndhistogram/src/axis/variable.rs index 02e2625..2cedd20 100644 --- a/ndhistogram/src/axis/variable.rs +++ b/ndhistogram/src/axis/variable.rs @@ -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 diff --git a/ndhistogram/src/axis/variablecyclic.rs b/ndhistogram/src/axis/variablecyclic.rs index 8c6076a..f76c53b 100644 --- a/ndhistogram/src/axis/variablecyclic.rs +++ b/ndhistogram/src/axis/variablecyclic.rs @@ -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. /// ``` diff --git a/ndhistogram/src/axis/variablenoflow.rs b/ndhistogram/src/axis/variablenoflow.rs index 77b7c0d..dd4e170 100644 --- a/ndhistogram/src/axis/variablenoflow.rs +++ b/ndhistogram/src/axis/variablenoflow.rs @@ -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