JuliaDynamics / ComplexityMeasures.jl

Estimators for probabilities, entropies, and other complexity measures derived from data in the context of nonlinear dynamics and complex systems
MIT License
53 stars 12 forks source link

fix binning when max point in range #263

Closed Datseris closed 1 year ago

Datseris commented 1 year ago

While working on some fractal dimension estimators, I encountered this bug. If the maximum along a direction is exactly the end point of a range, our code does not extend the range for one more. This is wrong however as by our definition of the Fixed Binning, the end point of the range is NOT included in the histogram, and hence the point itself is NOT included in the histogram, which is wrong.

This fixes it and adds a test.

codecov[bot] commented 1 year ago

Codecov Report

Merging #263 (7f94091) into main (6837b8b) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #263   +/-   ##
=======================================
  Coverage   81.97%   81.97%           
=======================================
  Files          50       50           
  Lines        1298     1298           
=======================================
  Hits         1064     1064           
  Misses        234      234           
Impacted Files Coverage Δ
...rc/encoding_implementations/rectangular_binning.jl 90.24% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more