From 59617142048bce35000228a1d4e238ef58b8f949 Mon Sep 17 00:00:00 2001 From: George Datseris Date: Tue, 20 Aug 2024 12:58:05 +0100 Subject: [PATCH] Small additions to basin instability and tutorial (#147) * add notebook enhancements to the tutorial * tiny change in basin instab --- Project.toml | 2 +- docs/src/tutorial.jl | 14 ++++++++++++++ src/dict_utils.jl | 1 + src/matching/basin_enclosure.jl | 3 ++- src/matching/sssdistance.jl | 2 -- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index 3896193c..755a7981 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "Attractors" uuid = "f3fd9213-ca85-4dba-9dfd-7fc91308fec7" authors = ["George Datseris ", "Kalel Rossi", "Alexandre Wagemakers"] repo = "https://github.com/JuliaDynamics/Attractors.jl.git" -version = "1.19.3" +version = "1.19.4" [deps] BlackBoxOptim = "a134a8b2-14d6-55f6-9291-3336d3ab0209" diff --git a/docs/src/tutorial.jl b/docs/src/tutorial.jl index fc9e0398..3de773db 100644 --- a/docs/src/tutorial.jl +++ b/docs/src/tutorial.jl @@ -6,6 +6,8 @@ # # ``` +#nb @doc Attractors + # [`Attractors`](@ref) is a component of the **DynamicalSystems.jl** library. # This tutorial will walk you through its main functionality. # That is, given a `DynamicalSystem` instance, find all its attractors and their basins @@ -19,6 +21,18 @@ # but we won't cover anything else in this introductory tutorial. # See the [examples](@ref examples) page instead. + +# ### Package versions used + +import Pkg + +#nb # Activate an environment in the folder containing the notebook +#nb Pkg.activate(dirname(@__DIR__)) +#nb Pkg.add(["DynamicalSystems", "CairoMakie", "GLMakie", "OrdinaryDiffEq", "BenchmarkTools"]) + +Pkg.status(["Attractors", "CairoMakie", "OrdinaryDiffEq"]) + + # ## Tutorial - copy-pasteable version # _Gotta go fast!_ diff --git a/src/dict_utils.jl b/src/dict_utils.jl index c5d78425..fb765fd1 100644 --- a/src/dict_utils.jl +++ b/src/dict_utils.jl @@ -65,6 +65,7 @@ end """ retract_keys_to_consecutive(v::Vector{<:Dict}) → rmap + Given a vector of dictionaries with various positive integer keys, retract all keys so that consecutive integers are used. So if the dictionaries have overall keys 2, 3, 42, then they will transformed to 1, 2, 3. diff --git a/src/matching/basin_enclosure.jl b/src/matching/basin_enclosure.jl index 2f6d4c38..83c975d1 100644 --- a/src/matching/basin_enclosure.jl +++ b/src/matching/basin_enclosure.jl @@ -44,7 +44,8 @@ which is estimated with the `distance` keyword, which can be anything [`MatchBySSSetDistance`](@ref) accepts. The closest `₊` attractor gets the ID of the `₋` closest attractor that converge to it. -Basin enclosure is a concept similar to "basin instability" in [Ritchie2023](@cite). +Basin enclosure is a concept similar to "basin (in)stability" in [Ritchie2023](@cite): +attractors that quantify as "basin stable" are matched. """ @kwdef struct MatchByBasinEnclosure{E, D, S, T} <: IDMatcher ε::E = nothing diff --git a/src/matching/sssdistance.jl b/src/matching/sssdistance.jl index 14fc7d14..79fc7bf2 100644 --- a/src/matching/sssdistance.jl +++ b/src/matching/sssdistance.jl @@ -110,5 +110,3 @@ function _matching_map_distances(keys₊, keys₋, distances::Dict, threshold; return rmap end - -