Skip to content

Broken constructors #28

@csimal

Description

@csimal

Several constructors seem broken and return errors when called with default arguments.

Example:

julia> PredefinedDynamicalSystems.tentmap()
ERROR: MethodError: no method matching isless(::SVector{1, Float64}, ::Float64)
The function `isless` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  isless(::Missing, ::Any)
   @ Base missing.jl:87
  isless(::Any, ::Missing)
   @ Base missing.jl:88
  isless(::AbstractVector, ::AbstractVector)
   @ Base abstractarray.jl:3026
  ...

Stacktrace:
 [1] <(x::SVector{1, Float64}, y::Float64)
   @ Base ./operators.jl:353
 [2] tentmap_rule(x::SVector{1, Float64}, p::Vector{Float64}, n::Int64)
   @ PredefinedDynamicalSystems ~/.julia/dev/PredefinedDynamicalSystems/src/discrete_famous_systems.jl:414
 [3] DeterministicIteratedMap(f::typeof(PredefinedDynamicalSystems.tentmap_rule), u0::Float64, p::Vector{Float64}; t0::Int64)
   @ DynamicalSystemsBase ~/.julia/packages/DynamicalSystemsBase/PJv07/src/core_systems/discrete_time_map.jl:51
 [4] DeterministicIteratedMap(f::Function, u0::Float64, p::Vector{Float64})
   @ DynamicalSystemsBase ~/.julia/packages/DynamicalSystemsBase/PJv07/src/core_systems/discrete_time_map.jl:41
 [5] tentmap(u0::Float64, μ::Float64)
   @ PredefinedDynamicalSystems ~/.julia/dev/PredefinedDynamicalSystems/src/discrete_famous_systems.jl:410
 [6] top-level scope
   @ REPL[20]:1

julia> PredefinedDynamicalSystems.pomeau_manneville()
ERROR: UndefVarError: `pom_jac` not defined in `PredefinedDynamicalSystems`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
 [1] pomeau_manneville(u0::Float64, z::Float64)
   @ PredefinedDynamicalSystems ~/.julia/dev/PredefinedDynamicalSystems/src/discrete_famous_systems.jl:253
 [2] top-level scope
   @ REPL[19]:1

After a cursory glance through the source code, it seems most of these are due to mismatches between the types given to DeterministicIteratedMap and what it expects, i.e. DeterministicIteratedMap expects states to be represented by arrays/static arrays, and is being given a scalar.

There also seem to be a few errors due to the package not being updated to follow updates to DynamicalSystemsBase. For example, fixing the variable name in pomeau_manneville yields the following error

julia> PredefinedDynamicalSystems.pomeau_manneville()
ERROR: ArgumentError: Things have changed in DynamicalSystems.jl and now you cannot provide
a Jacobian function as a 4th argument to DeterministicIteratedMap. You have to
first initialize DeterministicIteratedMap without a Jacobian, and then pass the initialized
system and Jacobian into a `TangentDynamicalSystem`.

...

Minimal Working Example

using PredefinedDynamicalSystems: tentmap, pomeau_manneville

tentmap()

pomeau_manneville()

Package versions

Using PredefinedDynamicalSystems version 1.2.0, with Julia 1.11.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions