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
56 stars 14 forks source link

Deprecate passing `m` as keyword; use type parameter in cases where embeddings occur #309

Closed Datseris closed 11 months ago

Datseris commented 1 year ago

At the moment things like OrdinalPatterns accept m as a keyword. This "parameter" m is then cast into a type parameter. However, because m corresponds to the length of a static vector, it is better to provide it explicitly as a type paraemter, rather than deciding the type by the value of m.

So, this means, change

OrdinalPattern(; m, kwargs...)

to

OrdinalPattern{m}(; kwargs...)

this ensures that the type m of OrdinalPattern can be statically deduced and propagated without a type instability.

The method with m as keyword needs to be deprecated and throw a deprecation warning.

This change will increase performance and compilation speed.