Skip to content

Commit

Permalink
Merge branch 'main' into compathelper/new_version/2024-09-09-00-58-02…
Browse files Browse the repository at this point in the history
…-628-00883591779
  • Loading branch information
oameye authored Oct 12, 2024
2 parents 126f469 + a507ddc commit ec3ef28
Show file tree
Hide file tree
Showing 40 changed files with 416 additions and 718 deletions.
42 changes: 37 additions & 5 deletions .github/workflows/Format.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,41 @@
name: Format suggestions
name: format-check

on: [pull_request]
on:
push:
branches:
- 'main'
tags: '*'
pull_request:

jobs:
code-style:
runs-on: ubuntu-latest
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1]
julia-arch: [x86]
os: [ubuntu-latest]
steps:
- uses: julia-actions/julia-format@v3
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}

- uses: actions/checkout@v4
- name: Install JuliaFormatter and format
# This will use the latest version by default but you can set the version like so:
#
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
julia -e 'using JuliaFormatter; format(".", verbose=true)'
- name: Format check
run: |
julia -e '
out = Cmd(`git diff`) |> read |> String
if out == ""
exit(0)
else
@error "Some files have not been formatted !!!"
write(stdout, out)
exit(1)
end'
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog for `CriticalTransitions.jl`

## v0.4.0
New `CoupledSDEs` design

This release upgrades CriticalTransitions.jl to be compatible with the re-design of `CoupledSDEs`, which has now been integrated in [`DynamicalSystemsBase.jl v3.11`](https://juliadynamics.github.io/DynamicalSystemsBase.jl/stable/CoupledSDEs/).

Since we have updated the syntax of defining a `CoupledSDEs` system, this is a breaking change.

#### Changed functions
- `CoupledSDEs` is now constructed with different args and kwargs
- `fw_action`, `geometric_action` and `om_action` now normalize the covariance matrix when computing the action functional
- `noise_strength` is not a function anymore but a kwarg for `CoupledSDEs` and other functions
- `om_action` now requires `noise_strength` as input argument
- `relax` was renamed to `deterministic_orbit`
- `trajectory` has been added to replace `simulate`

#### Deprecations
- `add_noise_strength`, `idfunc` and `idfunc!` are no longer needed and have been removed
- the function `noise_strength(::CoupledSDEs)` has been removed
- `simulate` has been removed

Full changelog [here](https://github.com/JuliaDynamics/CriticalTransitions.jl/compare/v0.3.0...v0.4.0).

## v0.3.0
Major overhaul introducing `CoupledSDEs`

Expand Down
16 changes: 9 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "CriticalTransitions"
uuid = "251e6cd3-3112-48a5-99dd-66efcfd18334"
authors = ["Reyk Börner, Ryan Deeley, Raphael Römer, Orjan Ameye"]
repo = "https://github.com/juliadynamics/CriticalTransitions.jl.git"
version = "0.3.0"
version = "0.4.0"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand All @@ -29,6 +29,7 @@ StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"

[weakdeps]
StateSpaceSets = "40b095a5-5852-4c12-98c7-d43bf788e795"
Attractors = "f3fd9213-ca85-4dba-9dfd-7fc91308fec7"
ChaosTools = "608a59af-f2a3-5ad4-90b4-758bdf3122a7"

Expand All @@ -38,31 +39,32 @@ CoupledSDEsBaisin = ["ChaosTools", "Attractors"]

[compat]
Aqua = "0.8.7"
Attractors = "1.18"
ChaosTools = "3.1"
Attractors = "1.19.12"
ChaosTools = "3.2.1"
Dates = ">=1.9.0"
Dierckx = "0.5.3"
DiffEqNoiseProcess = "5.22"
DocStringExtensions = "0.9.3"
Documenter = "^1.4.1"
DynamicalSystemsBase = "3.7.1"
DynamicalSystemsBase = "3.11.1"
ExplicitImports = "1.9"
Format = "1"
ForwardDiff = "0.10.36"
HDF5 = "0.17.1"
IntervalArithmetic = "0.20"
JET = "0.9"
JET = "0.9.9"
JLD2 = "0.4.46, 0.5"
Markdown = ">=1.9.0"
ModelingToolkit = "9.25"
Optim = "1.9.3"
OrdinaryDiffEq = "6.82"
OrdinaryDiffEq = "6.89"
ProgressBars = "1.5.1"
ProgressMeter = "1.10.0"
Reexport = "1.2.2"
StateSpaceSets = "2.1.2"
StaticArrays = "1.9.3"
Statistics = ">=1.9"
StochasticDiffEq = "6.65.1"
StochasticDiffEq = "6.69"
Symbolics = "5.32"
julia = "1.9"

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ function fitzhugh_nagumo(u, p, t)
dx = (-α * x^3 + γ * x - κ * y + I) / ϵ
dy = -β * y + x

return SA[dx, dy]
return SVector{2}([dx, dy])
end

# System parameters
p = [1., 3., 1., 1., 1., 0.]
params = [1., 3., 1., 1., 1., 0.]
noise_strength = 0.02
initial_state = zeros(2)

# Define stochastic system
sys = CoupledSDEs(fitzhugh_nagumo, id_func, zeros(2), p, noise_strength)
sys = CoupledSDEs(fitzhugh_nagumo, initial_state, params; noise_strength)

# Get stable fixed points
fps, eigs, stab = fixedpoints(sys, [-2,-2], [2,2])
fp1, fp2 = fps[stab]
# Run a sample trajectory
traj = trajectory(sys, 10.0)

# Generate noise-induced transition from one fixed point to the other
path, times, success = transition(sys, fp1, fp2)
# Compute minimum action path using gMAM algorithm
instanton = geometric_min_action_method(sys, initial_state, current_state(sys))

# ... and more, check out the documentation!
```
Expand Down
6 changes: 4 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
[deps]
Attractors = "f3fd9213-ca85-4dba-9dfd-7fc91308fec7"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
ChaosTools = "608a59af-f2a3-5ad4-90b4-758bdf3122a7"
CriticalTransitions = "251e6cd3-3112-48a5-99dd-66efcfd18334"
DiffEqNoiseProcess = "77a26b50-5914-5dd7-bc55-306e6241c503"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
DynamicalSystemsBase = "6e36e845-645a-534a-86f2-f5d4aa5a06b4"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0"

[compat]
Documenter = "1"
5 changes: 4 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ using DocumenterInterLinks
using Pkg

using CriticalTransitions, ChaosTools, Attractors
using DynamicalSystemsBase

project_toml = Pkg.TOML.parsefile(joinpath(@__DIR__, "..", "Project.toml"))
package_version = project_toml["version"]
Expand Down Expand Up @@ -45,10 +46,12 @@ makedocs(;
CriticalTransitions.DiffEqNoiseProcess,
Base.get_extension(CriticalTransitions, :ChaosToolsExt),
Base.get_extension(CriticalTransitions, :CoupledSDEsBaisin),
DynamicalSystemsBase,
Base.get_extension(DynamicalSystemsBase, :StochasticSystemsBase),
],
doctest=false,
format=Documenter.HTML(; html_options...),
warnonly=[:missing_docs],
warnonly=[:missing_docs, :linkcheck, :cross_references],
pages=pages,
plugins=[bib, links],
)
Expand Down
2 changes: 1 addition & 1 deletion docs/pages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pages = [
"Tutorial" => "tutorial.md",
"Manual" => Any[
"Define a CoupledSDEs system" => "man/CoupledSDEs.md",
"Stability analysis" => "man/systemanalysis.md",
#"Stability analysis" => "man/systemanalysis.md",
"Simulating the system" => "man/simulation.md",
"Sampling transitions" => "man/sampling.md",
"Large deviation theory" => "man/largedeviations.md",
Expand Down
7 changes: 3 additions & 4 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ Building on [DynamicalSystems.jl](https://juliadynamics.github.io/DynamicalSyste
![CT.jl infographic](./figs/CTjl_structure_v0.3_small.jpeg)

!!! info "Current features"
* **Stability analysis**: Fixed points, linear stability, basins of attraction, edge tracking
* **Stochastic simulation**: Gaussian noise, uncorrelated and correlated, additive and multiplicative
* **Transition path sampling**: Ensemble sampling by direct simulation and Pathspace Langevin MCMC
* **Large deviation theory**: Action functionals and minimization algorithms (MAM, gMAM)
* **Stochastic simulation** made easy: Gaussian noise, uncorrelated and correlated, additive and multiplicative
* **Transition path sampling**: Parallelized ensemble rejection sampling
* **Large deviation theory** tools: Action functionals and minimization algorithms (MAM, gMAM)

!!! ukw "Planned features"
* **Rare event simulation**: importance sampling, AMS
Expand Down
Loading

0 comments on commit ec3ef28

Please sign in to comment.