Skip to content

Commit

Permalink
Merge branch 'main' into Downgrade-CI
Browse files Browse the repository at this point in the history
  • Loading branch information
oameye authored Apr 18, 2024
2 parents 4e9fd01 + c5865c2 commit d569358
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@v1
uses: julia-actions/setup-julia@v2
with:
version: '1'
arch: ${{ runner.arch }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/setup-julia@v2
with:
show-versioninfo: true
version: ${{ matrix.version }}
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/doc-preview-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Doc Preview Cleanup

on:
pull_request:
types: [closed]

# Ensure that only one "Doc Preview Cleanup" workflow is force pushing at a time
concurrency:
group: doc-preview-cleanup
cancel-in-progress: false

jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Delete preview and history + push changes
run: |
if [ -d "${preview_dir}" ]; then
git config user.name "Documenter.jl"
git config user.email "[email protected]"
git rm -rf "${preview_dir}"
git commit -m "delete preview"
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
git push --force origin gh-pages-new:gh-pages
fi
env:
preview_dir: previews/PR${{ github.event.number }}
27 changes: 15 additions & 12 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
name: Documenter
name: Documentation

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

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
Documenter:
build:
permissions:
contents: write
pull-requests: read
statuses: write
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/setup-julia@v2
with:
version: '1.10'
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-docdeploy@latest
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key
run: julia --project=docs/ docs/make.jl
8 changes: 5 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ makedocs(;
modules=[CriticalTransitions],
doctest=false,
format = Documenter.HTML(
prettyurls = get(ENV, "CI", nothing) == "true",
canonical="https://juliadynamics.github.io/CriticalTransitions.jl/",
prettyurls = true,
mathengine = Documenter.MathJax2()
),
linkcheck = true,
Expand All @@ -34,9 +35,10 @@ makedocs(;
"Predefined systems" => "man/systems.md",
"Development stage" => "man/dev.md"
],
plugins=[bib],
plugins=[bib]
)

deploydocs(
repo = "github.com/juliadynamics/CriticalTransitions.jl.git",
repo = "github.com/JuliaDynamics/CriticalTransitions.jl.git",
push_preview = false
)
15 changes: 7 additions & 8 deletions systems/fitzhughnagumo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Dynamical systems specification file
"""

# fitzhugh_nagumo model

"""
fitzhugh_nagumo!(du, u, p, t)
In-place definition of the FitzHugh-Nagumo system.
Expand Down Expand Up @@ -41,32 +40,32 @@ FitzHughNagumo!(u,p,t) = fitzhugh_nagumo!(u,p,t)

"""
fhn_ϵσ(ϵ,σ)
A shortcut command for returning a StochSystem of the FitzHugh Nagumo system in a default setup with additive isotropic noise.
A shortcut command for returning a StochSystem of the FitzHugh Nagumo system in a default setup with additive isotropic noise.
This setup fixes the parameters β = 3, α = γ = κ = 1, I = 0 and leaves the value of the time-scale parameter ϵ as a function argument. The prescribed noise process is additive and isotropic: the variables are peturbed by independently drawn identical Gaussian white noise realisations, with standard deviation σ (the other function argument).
"""
function fhn_ϵσ(ϵ, σ) # a convenient two-parameter version of the FitzHugh Nagumo system
function fhn_ϵσ(ϵ, σ) # a convenient two-parameter version of the FitzHugh Nagumo system
# defining the StochSystem
f(u,p,t) = fitzhugh_nagumo(u,p,t);
β = 3; α = γ = κ = 1; I = 0; # standard parameters without ϵ (time-scale separation parameter)
pf_wo_ϵ = [β, α, γ, κ, I]; # parameter vector without ϵ
dim = 2;
g = idfunc;
pg = nothing;
pg = nothing;
Σ = [1 0; 0 1];
process = "WhiteGauss";
StochSystem(f, vcat([ϵ], pf_wo_ϵ), dim, σ, g, pg, Σ, process)
end;

function fhn_ϵσ_backward(ϵ, σ) # a convenient two-parameter version of the FitzHugh Nagumo system
function fhn_ϵσ_backward(ϵ, σ) # a convenient two-parameter version of the FitzHugh Nagumo system
# defining the StochSystem
f(u,p,t) = -fitzhugh_nagumo(u,p,t);
β = 3; α = γ = κ = 1; I = 0; # standard parameters without ϵ (time-scale separation parameter)
pf_wo_ϵ = [β, α, γ, κ, I]; # parameter vector without ϵ
dim = 2;
g = idfunc;
pg = nothing;
pg = nothing;
Σ = [1 0; 0 1];
process = "WhiteGauss";
StochSystem(f, vcat([ϵ], pf_wo_ϵ), dim, σ, g, pg, Σ, process)
end;
end;

0 comments on commit d569358

Please sign in to comment.