JuliaDynamics / RecurrenceAnalysis.jl

Recurrence Quantification Analysis in Julia
https://juliadynamics.github.io/RecurrenceAnalysis.jl/stable/
MIT License
44 stars 12 forks source link

Display or return rqa results in the order shown in the docs #125

Closed rs7q5 closed 1 year ago

rs7q5 commented 2 years ago

I would like the rqa results to be shown or returned in the order that they are inserted because as it sits it currently makes sense (RR, then diagonal measures then vertical measures if desired) and it would also be consistent with how it is presented in the docs.

I understand why the exported version of it is a Dict, but to achieve the desired result the quickest way I can think of is to allow the rqa type specified to be an AbstractDict to allow for an OrderedDict to be specified and without adding a dependency for different types of collections.

In other words the proposed change is to change the rqa function to

function rqa(::Type{DT},R;kwargs...) where {DT<:AbstractDict} end

I would also be content with just editing Base.show, but I wasn't sure which would be preferred.

Datseris commented 2 years ago

What happens if you just do OrderedDict(rqa(...))?

Datseris commented 2 years ago

but sure, you can just do a pr that uses AbstractDict.

rs7q5 commented 2 years ago

If you just do OrderedDict you will get the default order that the dictionary displays it as because OrderedDict is the insertion order.

I'll submit a PR request though. thanks!