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
49 stars 11 forks source link

`decode` should work generically with any type `I <: Integer`, not just `Int64` #311

Closed kahaaga closed 10 months ago

kahaaga commented 10 months ago

Currently, we unnecessarily restrict decode to only work for symbols of type Int, which defaults to Int32 or Int64 depending on system architecture. There's no reason why it shouldn't be possible to decode a symbol with type e.g. Int16. If the maximum symbol number is known, then it may be useful to use an integer with a smaller typemax.

Making this possible will, for example, enable reducing memory usage when writing code that repeatedly construct large arrays of integer symbols.

Fixing this is just a matter of changing the ::Int annotation in the various decode methods to ::Integer instead.

Jay-sanjay commented 10 months ago

Hello sir I have made the necessary changes , below is the link to the PR https://github.com/JuliaDynamics/ComplexityMeasures.jl/pull/315