Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change Dataset name #336

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ChaosTools"
uuid = "608a59af-f2a3-5ad4-90b4-758bdf3122a7"
repo = "https://github.com/JuliaDynamics/ChaosTools.jl.git"
version = "3.2.0"
version = "3.2.1"

[deps]
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
Expand Down
2 changes: 1 addition & 1 deletion src/chaosdetection/lyapunovs/local_growth_rates.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export local_growth_rates

"""
local_growth_rates(ds::DynamicalSystem, points::Dataset; kwargs...) → λlocal
local_growth_rates(ds::DynamicalSystem, points::StateSpaceSet; kwargs...) → λlocal

Compute the local exponential growth rate(s) of perturbations of the dynamical system
`ds` for initial conditions given in `points`. For each initial condition `u ∈ points`,
Expand Down
4 changes: 2 additions & 2 deletions src/chaosdetection/lyapunovs/lyapunov_from_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export lyapunov_from_data
export Euclidean, FirstElement

"""
lyapunov_from_data(R::Dataset, ks; kwargs...)
lyapunov_from_data(R::StateSpaceSet, ks; kwargs...)

For the given dataset `R`, which is expected to represent a trajectory of a dynamical
system, calculate and return `E(k)`, which is the average logarithmic
Expand Down Expand Up @@ -64,7 +64,7 @@ the absolute distance of *only the first elements* of the points of `R`

[^Kantz1994]: Kantz, H., Phys. Lett. A **185**, pp 77–87 (1994)
"""
function lyapunov_from_data(R::AbstractDataset{D, T}, ks;
function lyapunov_from_data(R::AbstractStateSpaceSet{D, T}, ks;
refstates = 1:(length(R) - ks[end]), w = 1,
distance = FirstElement(), ntype = NeighborNumber(1),
) where {D, T}
Expand Down
2 changes: 1 addition & 1 deletion src/dimreduction/dyca.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ is projected onto.
10.1109/mlsp.2018.8517024, 2018 IEEE 28th International Workshop on Machine Learning
for Signal Processing (MLSP)
"""
dyca(A::AbstractDataset, e) = dyca(Matrix(A), e)
dyca(A::AbstractStateSpaceSet, e) = dyca(Matrix(A), e)

function dyca(data, eig_threshold::AbstractFloat; norm_eigenvectors::Bool=false)
derivative_data = matrix_gradient(data) #get the derivative of the data
Expand Down
8 changes: 4 additions & 4 deletions src/periodicity/periodicorbits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ a random permutation will be chosen for them, with `λ=0.001`.
the next one is `≤ disttol` then it has converged to a fixed point.
* `inftol = 10.0`: If a state reaches `norm(state) ≥ inftol` it is assumed that
it has escaped to infinity (and is thus abandoned).
* `abstol = 1e-8`: A detected fixed point isn't stored if it is in `abstol`
neighborhood of some previously detected point. Distance is measured by
* `abstol = 1e-8`: A detected fixed point isn't stored if it is in `abstol`
neighborhood of some previously detected point. Distance is measured by
euclidian norm. If you are getting duplicate fixed points, decrease this value.

## Description
Expand Down Expand Up @@ -78,7 +78,7 @@ function periodicorbits(
Λ = lambdamatrix(λ, inds, sings)
_periodicorbits!(FP, ds, o, ics, Λ, maxiters, disttol, inftol, abstol)
end
return Dataset(collect(FP))
return StateSpaceSet(collect(FP))
end

function periodicorbits(
Expand All @@ -99,7 +99,7 @@ function periodicorbits(
FP = Set{type}()
Λ = lambdamatrix(0.001, dimension(ds))
_periodicorbits!(FP, ds, o, ics, Λ, maxiters, disttol, inftol, abstol)
return Dataset(collect(FP))
return StateSpaceSet(collect(FP))
end

function _periodicorbits!(FP, ds, o, ics, Λ, maxiter, disttol, inftol, abstol)
Expand Down
2 changes: 1 addition & 1 deletion test/rareevents/return_time_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function visual_guidance(ro, times, u0, diffeq, εs, crossing_method)
step!(integ)
push!(tr4, current_state(integ))
end
tr4 = Dataset(tr4)
tr4 = StateSpaceSet(tr4)
else
tr4 = trajectory(ro, times[4], u0; diffeq)
end
Expand Down
3 changes: 2 additions & 1 deletion test/stability/fixedpoints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ using ChaosTools, Test

@testset "J=$(J)" for J in (nothing, henon_jacob)
fp, eigs, stable = fixedpoints(ds, box, J)
@test size(fp) == (2,2)
@test length(fp) == 2
@test dimension(fp) == 2
@test stable == [false, false]
@test (henon_fp ≈ fp[1]) || (henon_fp ≈ fp[2])
end
Expand Down
Loading