Skip to content

Commit 4697e7d

Browse files
committed
fix docstring of stability_measures_along_continuation
1 parent 9bdcd50 commit 4697e7d

File tree

2 files changed

+27
-21
lines changed

2 files changed

+27
-21
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "Attractors"
22
uuid = "f3fd9213-ca85-4dba-9dfd-7fc91308fec7"
33
authors = ["George Datseris <[email protected]>", "Kalel Rossi", "Alexandre Wagemakers"]
44
repo = "https://github.com/JuliaDynamics/Attractors.jl.git"
5-
version = "1.26.1"
5+
version = "1.26.2"
66

77

88
[deps]

src/continuation/continuation_stability_measures.jl

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -102,41 +102,46 @@ more rirogously and is estimated more accurately for a proximity mapper.
102102
103103
## Keyword arguments
104104
105-
- `ε, metric`: As in `AttractorsViaProximity`.
105+
Keywords `ε, finite_time, weighting_distribution` are allowed to be `Vector`s
106+
with the same length as `pcurve` for providing different values for different
107+
continuation steps.
108+
109+
- `ε = nothing`: given to [`AttractorsViaProximity`](@ref).
106110
- `proximity_mapper_options = NamedTuple()`: extra keywords for `AttractorsViaProximity`.
107-
- All keywords are propagated to [`StabilityMeasuresAccumulator`](@ref).
111+
- `metric, finite_time, weighting_distribution`: given to [`StabilityMeasuresAccumulator`](@ref).
112+
- `samples_per_parameter = 1000`: how many samples to use when estimating stability measures
113+
via [`StabilityMeasuresAccumulator`](@ref). Ignored when `ics` is not a function.
108114
"""
109115
function stability_measures_along_continuation(
110-
ds::DynamicalSystem,
111-
attractors_cont,
112-
pcurve,
113-
ics;
114-
ε = nothing,
115-
weighting_distribution = EverywhereUniform(),
116-
finite_time = 1.0,
117-
samples_per_parameter = 1000,
118-
metric=Euclidean(),
119-
proximity_mapper_options=NamedTuple(),
120-
show_progress=true
121-
)
122-
N = samples_per_parameter
116+
ds::DynamicalSystem,
117+
attractors_cont,
118+
pcurve,
119+
ics;
120+
ε = nothing,
121+
weighting_distribution = EverywhereUniform(),
122+
finite_time = 1.0,
123+
samples_per_parameter = 1000,
124+
metric = Euclidean(),
125+
proximity_mapper_options = NamedTuple(),
126+
show_progress=true
127+
)
123128
progress = ProgressMeter.Progress(
124129
length(pcurve); desc = "Continuing stability measures:", enabled=show_progress
125130
)
126131
measures_cont = []
127132
for (i, p) in enumerate(pcurve)
128133
ε_ = ε isa AbstractVector ? ε[i] : ε # if its a vector, get i-th entry
129-
weighting_distribution = weighting_distribution isa AbstractVector ?
134+
weighting_distribution_ = weighting_distribution isa AbstractVector ?
130135
weighting_distribution[i] : weighting_distribution
131-
finite_time = finite_time isa AbstractVector ? finite_time[i] : finite_time
136+
finite_time_ = finite_time isa AbstractVector ? finite_time[i] : finite_time
132137
set_parameters!(ds, p)
133138
attractors = attractors_cont[i]
134139
accumulator = StabilityMeasuresAccumulator(
135140
AttractorsViaProximity(ds, attractors; ε = ε_, proximity_mapper_options...);
136-
weighting_distribution=weighting_distribution, finite_time=finite_time,
137-
metric=metric
141+
weighting_distribution = weighting_distribution_, finite_time = finite_time_,
142+
metric = metric
138143
)
139-
N = ics isa Function ? N : length(ics)
144+
N = ics isa Function ? samples_per_parameter : length(ics)
140145
for i 1:N
141146
ic = _get_ic(ics, i)
142147
id = accumulator(ic) # accumulate stability measures for given i.c.
@@ -145,6 +150,7 @@ function stability_measures_along_continuation(
145150
ProgressMeter.next!(progress)
146151
end
147152

153+
# change the measures format to the expected output
148154
transposed = Dict{String, Vector{Dict{Int64, Float64}}}()
149155
for measure in measures_cont[1]
150156
measure_name = measure[1]

0 commit comments

Comments
 (0)