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
55 stars 13 forks source link

Binning unecessarily restricts to Float64 #150

Closed Datseris closed 11 months ago

Datseris commented 1 year ago

Our binnings, such as RectangularBinning or FixedRectangularBinning dispatch on either integers or Float64. However, any float could do. Therefore they should dispatch on Int or on AbstractFloat. Especially in the case of FixedRectangularBinning it is like that the ε will be computed from data. If that data were e.g. Float32, the dispatch would throw an error.

This is as simple as replacing the Float64 in the code with <:AbstractFloat.

Jay-sanjay commented 11 months ago

Hello sir I guess the issue will be fixed by replacing Float64 at https://github.com/JuliaDynamics/ComplexityMeasures.jl/blob/64dc46c86e4b0b3763e9c894e9a0c0b4b749ec40/src/encoding_implementations/rectangular_binning.jl#L163 I have started a PR for it

Datseris commented 11 months ago

Closed in #322