Skip to content

Commit

Permalink
Dont error at non existing parameters in trajectory GUI (#234)
Browse files Browse the repository at this point in the history
* Dont error at non existing parameters

* bump version
  • Loading branch information
Datseris committed Apr 25, 2024
1 parent 19882cf commit 53251cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DynamicalSystems"
uuid = "61744808-ddfa-5f27-97ff-6e42cc95d634"
repo = "https://github.com/JuliaDynamics/DynamicalSystems.jl.git"
version = "3.3.12"
version = "3.3.13"

[deps]
Attractors = "f3fd9213-ca85-4dba-9dfd-7fc91308fec7"
Expand Down
10 changes: 9 additions & 1 deletion ext/src/interactive_trajectory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,19 @@ end

# Parameter handling
function _add_ds_param_controls!(ds, paramlayout, parameter_sliders, pnames, p0)
parameter_sliders = deepcopy(parameter_sliders) # so we can modify it for wrong parameters
slidervals = Dict{keytype(parameter_sliders), Observable}() # directly has the slider observables
sliders = Dict{keytype(parameter_sliders), Any}() # for updating via reset parameters
tuples_for_slidergrid = []
for (l, vals) in parameter_sliders # dictionary
startvalue = current_parameter(ds, l, p0)
startvalue = NaN
try
startvalue = current_parameter(ds, l, p0)
catch err
@warn "Could not obtain parameter with index $(l). Got error: $(err). Skipping."
delete!(parameter_sliders, l)
continue
end
label = string(pnames[l])
push!(tuples_for_slidergrid, (;label, range = vals, startvalue))
end
Expand Down

0 comments on commit 53251cb

Please sign in to comment.