JuliaDynamics / Attractors.jl

Find attractors of dynamical systems, their basins, and continue them across parameters. Study global stability (a.k.a. non-local, or resilience). Also tipping points functionality.
MIT License
27 stars 5 forks source link

Rematch, v2: a new dawn #90

Closed Datseris closed 11 months ago

Datseris commented 11 months ago

This re-works the way matching works in RAFM to account for a crucial mistake. Previously, if an attractor dissapeared, and a new one appeared later, then they would both be assigned the same ID even though they would have never been compared with each other.

This new continuation matching allows for two options:

  1. Never compare vanished attractors, but still ensure that they get different ids
  2. Compare vanished attractors by keeping track of their latest ghosts, and do the formal matching with the ghosts and new attractors

@kalelR this should be highly relevant for you if you use RAFM in scientific work.

@kalelR or @awage please review.

KalelR commented 11 months ago

Hey, excellent! Yup, I encountered this some time ago, and I fixed it with a similar idea to this next_id way, but with much hackier way, and didn't have the time to improve the code to submit a PR.

This is very important, as you said. Glad it'll be fixed now! Thanks for the work :)

codecov-commenter commented 11 months ago

Codecov Report

Merging #90 (1a99990) into main (cd0e857) will increase coverage by 5.19%. Report is 4 commits behind head on main. The diff coverage is 92.03%.

@@            Coverage Diff             @@
##             main      #90      +/-   ##
==========================================
+ Coverage   68.61%   73.81%   +5.19%     
==========================================
  Files          22       21       -1     
  Lines        1128     1199      +71     
==========================================
+ Hits          774      885     +111     
+ Misses        354      314      -40     
Files Changed Coverage Δ
ext/plotting.jl 0.00% <0.00%> (ø)
src/Attractors.jl 100.00% <ø> (ø)
src/basins/basins_utilities.jl 100.00% <ø> (ø)
src/basins/fractality_of_basins.jl 96.62% <ø> (-0.08%) :arrow_down:
src/continuation/continuation_grouping.jl 97.72% <ø> (ø)
src/mapping/attractor_mapping_featurizing.jl 62.29% <ø> (ø)
src/mapping/attractor_mapping_recurrences.jl 90.24% <ø> (+8.78%) :arrow_up:
src/mapping/grouping/cluster_config.jl 66.19% <ø> (ø)
src/tipping/tipping_probabilities.jl 100.00% <ø> (ø)
src/continuation/continuation_recurrences.jl 79.31% <50.00%> (-2.23%) :arrow_down:
... and 3 more

... and 2 files with indirect coverage changes

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