Skip to content

Commit

Permalink
Fix a whole bunch of issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanaelbosch committed Dec 23, 2023
1 parent 727ddcb commit ffb2412
Show file tree
Hide file tree
Showing 3 changed files with 365 additions and 362 deletions.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
SimpleUnPack = "ce78b400-467f-4804-87d8-8f486da07d0a"

[compat]
julia = "1.6"
ComponentArrays = "0.15"
JSON = "0.21"
LinearAlgebra = "1"
Markdown = "1"
SciMLBase = "1,2"
Test = "1"
julia = "1.6"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
27 changes: 19 additions & 8 deletions src/ChaoticDynamicalSystemLibrary.jl
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
module ChaoticDynamicalSystemLibrary

using Base: nothing_sentinel
using JSON, Markdown
using LinearAlgebra
using SciMLBase
using ComponentArrays
using SimpleUnPack

function dict_with_string_keys_to_symbol_keys(d::Dict)
new_d = Dict()
for (k, v) in d
new_d[Symbol(k)] = v
vecvec2mat(vv) = hcat(vv...)

function format_parameters(params::Dict)
if isempty(params)
return nothing
end
return new_d
end

function dict_to_componentarray(d::Dict)
return ComponentArray(dict_with_string_keys_to_symbol_keys(d))
intermediate_dict = Dict()
for (k, v) in params
val = if (v isa Vector) && (v[1] isa Vector)
vecvec2mat(v)
else
v
end
intermediate_dict[Symbol(k)] = val
end

return ComponentArray(intermediate_dict)
end


function make_docstring(f)
data = ATTRACTOR_DATA[string(f)]
header = """
Expand Down
Loading

0 comments on commit ffb2412

Please sign in to comment.