Skip to content

Commit be0b5c1

Browse files
authored
Merge branch 'main' into edit_tutorial_contents
2 parents de37a5c + 5fc2a26 commit be0b5c1

39 files changed

+4335
-459
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Cleanup stale doc Previews
2+
3+
on:
4+
schedule:
5+
- cron: '0 2 * * *' # Run daily at 2 AM UTC
6+
workflow_dispatch: # Allow manual trigger
7+
8+
concurrency:
9+
group: doc-preview-cleanup
10+
cancel-in-progress: false
11+
12+
jobs:
13+
cleanup-closed-pr-previews:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
pull-requests: read
18+
steps:
19+
- name: Checkout gh-pages branch
20+
uses: actions/checkout@v4
21+
with:
22+
ref: gh-pages
23+
fetch-depth: 0
24+
25+
- name: Clean up closed PR previews
26+
run: |
27+
echo "Starting preview cleanup..."
28+
29+
deleted_previews=""
30+
31+
# Find all preview directories
32+
if [ -d "previews" ]; then
33+
shopt -s nullglob
34+
for preview_dir in previews/PR*; do
35+
if [ -d "$preview_dir" ]; then
36+
# Extract PR number
37+
pr_number=$(echo "$preview_dir" | sed 's/previews\/PR//')
38+
39+
# Validate PR number is numeric
40+
if ! [[ "$pr_number" =~ ^[0-9]+$ ]]; then
41+
echo "Skipping invalid directory: $preview_dir"
42+
continue
43+
fi
44+
45+
# Check PR state via GitHub API
46+
api_response=$(curl -s -w "%{http_code}" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
47+
"https://api.github.com/repos/${{ github.repository }}/pulls/$pr_number")
48+
49+
http_code="${api_response: -3}"
50+
json_response="${api_response%???}"
51+
52+
if [ "$http_code" != "200" ] && [ "$http_code" != "404" ]; then
53+
echo "API error for PR #$pr_number: HTTP $http_code"
54+
echo "Response: $json_response"
55+
exit 1
56+
fi
57+
58+
pr_state=$(echo "$json_response" | jq -r '.state // "not_found"')
59+
60+
if [ "$pr_state" = "closed" ] || [ "$pr_state" = "not_found" ]; then
61+
echo "Delete $preview_dir (PR #$pr_number is $pr_state)"
62+
deleted_previews="$deleted_previews $preview_dir"
63+
64+
git rm -rf "$preview_dir"
65+
else
66+
echo "Keeping $preview_dir (PR #$pr_number is open)"
67+
fi
68+
69+
sleep 1
70+
fi
71+
done
72+
shopt -u nullglob
73+
fi
74+
75+
# Commit and clean history if any previews were deleted
76+
if [ -n "$deleted_previews" ]; then
77+
echo "Clean up history for:$deleted_previews"
78+
79+
git config user.name "Documenter.jl"
80+
git config user.email "[email protected]"
81+
git commit -m "delete previews"
82+
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
83+
echo "Force push changes to upstream repo"
84+
git push --force origin gh-pages-new:gh-pages
85+
else
86+
echo "No previews to clean up"
87+
fi

.github/workflows/docpreviewcleanup.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ jobs:
145145
permissions:
146146
actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created
147147
contents: write
148+
pull-requests: read
148149
strategy:
149150
fail-fast: false
150151
matrix:
@@ -164,9 +165,36 @@ jobs:
164165
- name: Load Julia packages from cache
165166
id: julia-cache
166167
uses: julia-actions/cache@v2
168+
- name: Extract OpPoDyn branch from PR
169+
id: extract-branch
170+
run: |
171+
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
172+
PR_DATA=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
173+
-H "Accept: application/vnd.github.v3+json" \
174+
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
175+
PR_TITLE=$(echo "$PR_DATA" | jq -r '.title')
176+
PR_BODY=$(echo "$PR_DATA" | jq -r '.body')
177+
# Combine title and body for searching
178+
PR_TEXT="$PR_TITLE $PR_BODY"
179+
180+
# Look for [oppodyn:branch-name] pattern (case insensitive)
181+
BRANCH_MATCH=$(echo "$PR_TEXT" | grep -i -o "\[oppodyn:[^]]*\]" | head -n1)
182+
if [[ -n "$BRANCH_MATCH" ]]; then
183+
BRANCH_NAME=$(echo "$BRANCH_MATCH" | sed 's/\[[Oo][Pp][Pp][Oo][Dd][Yy][Nn]:\([^]]*\)\]/\1/i')
184+
echo "Found OpPoDyn branch specification: $BRANCH_NAME"
185+
echo "oppodyn_branch=$BRANCH_NAME" >> $GITHUB_OUTPUT
186+
else
187+
echo "No OpPoDyn branch specified, using main"
188+
echo "oppodyn_branch=main" >> $GITHUB_OUTPUT
189+
fi
190+
else
191+
echo "Not a pull request, using main branch"
192+
echo "oppodyn_branch=main" >> $GITHUB_OUTPUT
193+
fi
167194
- uses: actions/checkout@v4
168195
with:
169196
repository: JuliaEnergy/OpPoDyn.jl
197+
ref: ${{ steps.extract-branch.outputs.oppodyn_branch }}
170198
path: OpPoDyn
171199
- name: Run OpPoDyn tests
172200
shell: julia --project=testenv --color=yes {0}

NEWS.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# NetworkDynamics Release Notes
22

3+
## v0.10.1 Changelog
4+
- [#294](https://github.com/JuliaDynamics/NetworkDynamics.jl/pull/294) add linear stability analysis functions: `isfixpoint`, `jacobian_eigenvals`, and `is_linear_stable` with support for both ODE and DAE systems
5+
- [#283](https://github.com/JuliaDynamics/NetworkDynamics.jl/pull/283) add automatic sparsity detection using `get_jac_prototype` and `set_jac_prototype!`
6+
- [#285](https://github.com/JuliaDynamics/NetworkDynamics.jl/pull/285) rename `delete_initconstraint!` -> `delete_initconstaints!` and `delete_initformula!` -> `delete_initformulas!`
7+
8+
## v0.10 Changelog
9+
- **BREAKING**: the interface initialization of components has changed: it is now split up in two versions, mutating and non mutating version. Also it errors now if the tolerance bounds are violated. See docs on initialization for more details.
10+
11+
- new `get_graph(::Network)` method to extract graph object from nw
12+
- **improved Initialization System**: Added comprehensive initialization formulas and constraints system:
13+
- added `@initformula` to add explicit algebraic init equations for specific variables
14+
- added `@initconstraint` to add additional constraints for the component initialization
15+
- allow access edges via Pairs, i.e. `EIndex(1=>2,:a)` references variable `:a` in edge from vertex 1 to 2. Works also with unique names of vertices like `EIndex(:a=>:b)` [#281](https://github.com/JuliaDynamics/NetworkDynamics.jl/pull/281).
16+
317
## v0.9 Changelog
418
### Main changes in this release
519
NetworkDynamics v0.9 is a complete overhaul of the previous releases of NetworkDynamics.

NetworkDynamicsInspector/Project.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "NetworkDynamicsInspector"
22
uuid = "0a4713f2-d58f-43f2-b63b-1b5d5ee4e65a"
33
authors = ["Hans Würfel <[email protected]>"]
4-
version = "0.1.6"
4+
version = "0.1.8"
55

66
[deps]
77
Bonito = "824d6782-a2ef-11e9-3a09-e5662e0c26f8"
@@ -32,12 +32,12 @@ ColorSchemes = "3.29.0"
3232
Colors = "0.13.0"
3333
Downloads = "1.6.0"
3434
Electron = "6"
35-
GraphMakie = "0.5.14"
35+
GraphMakie = "0.6"
3636
Graphs = "1.12.0"
37-
NetworkDynamics = "0.9.13"
37+
NetworkDynamics = "0.9.13, 0.10"
3838
Observables = "0.5.5"
3939
OrderedCollections = "1.8.0"
4040
PrecompileTools = "1.2.1"
4141
SciMLBase = "2.75.1"
42-
WGLMakie = "0.11"
42+
WGLMakie = "0.13"
4343
julia = "1.10"

Project.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "NetworkDynamics"
22
uuid = "22e9dc34-2a0d-11e9-0de0-8588d035468b"
33
authors = ["Frank Hellmann <[email protected]>, Michael Lindner <[email protected]>, Hans Würfel <[email protected]"]
4-
version = "0.9.18"
4+
version = "0.10.1"
55

66
[deps]
77
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
@@ -14,6 +14,7 @@ Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
1414
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
1515
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
1616
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
17+
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
1718
Mixers = "2a8e4939-dab8-5edc-8f64-72a8776f13de"
1819
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
1920
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
@@ -37,15 +38,17 @@ TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
3738
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
3839
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
3940
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
40-
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
4141
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
42+
RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47"
43+
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
4244
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
4345
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
4446

4547
[extensions]
4648
NetworkDynamicsCUDAExt = ["CUDA", "Adapt"]
4749
NetworkDynamicsDataFramesExt = ["DataFrames"]
4850
NetworkDynamicsMTKExt = ["ModelingToolkit", "SymbolicUtils", "Symbolics"]
51+
NetworkDynamicsSparsityExt = ["SparseConnectivityTracer", "RuntimeGeneratedFunctions"]
4952
NetworkDynamicsSymbolicsExt = ["Symbolics", "MacroTools"]
5053

5154
[compat]
@@ -74,8 +77,10 @@ PrecompileTools = "1.2.1"
7477
Printf = "1.10.0"
7578
Random = "1"
7679
RecursiveArrayTools = "3.27.0"
80+
RuntimeGeneratedFunctions = "0.5.15"
7781
SciMLBase = "2"
7882
SparseArrays = "1"
83+
SparseConnectivityTracer = "0.6, 1"
7984
Static = "1.1.1"
8085
StaticArrays = "1.9.4"
8186
SteadyStateDiffEq = "2.2.0"

benchmark/Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ NetworkDynamics = {path = ".."}
2626
AbstractTrees = "0.4.5"
2727
ArgParse = "1.2.0"
2828
CUDA = "≥0.0.1"
29-
CairoMakie = "0.13.1"
29+
CairoMakie = "0.15"
3030
Chairmarks = "1.3.1"
3131
Graphs = "≥0.0.1"
32-
Makie = "0.22.1"
32+
Makie = "0.24"
3333
NetworkDynamics = "≥0.0.1"
3434
OrderedCollections = "1.7.0"
3535
PkgBenchmark = "0.2.12"

docs/Project.toml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "ND.jl docs"
33
[deps]
44
Bonito = "824d6782-a2ef-11e9-3a09-e5662e0c26f8"
55
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
6+
Chairmarks = "0ca39b1e-fe0b-4e98-acfc-b1656634c4de"
67
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
78
DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0"
89
DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def"
@@ -27,24 +28,20 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
2728
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
2829
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
2930
SimpleWeightedGraphs = "47aef6b3-ad0c-573a-a1e2-d07658019622"
31+
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
3032
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
3133
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
3234
StyledStrings = "f489334b-da3d-4c2e-b8f0-e476e12c162b"
3335
SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
3436

35-
[sources.Bonito]
36-
rev = "master"
37-
url = "https://github.com/SimonDanisch/Bonito.jl"
38-
39-
[sources.NetworkDynamics]
40-
path = ".."
41-
42-
[sources.NetworkDynamicsInspector]
43-
path = "../NetworkDynamicsInspector"
37+
[sources]
38+
NetworkDynamics = {path = ".."}
39+
NetworkDynamicsInspector = {path = "../NetworkDynamicsInspector"}
4440

4541
[compat]
4642
Bonito = "≥0.0.1"
47-
CairoMakie = "0.13.1"
43+
CairoMakie = "0.15"
44+
Chairmarks = "1.3.1"
4845
DataFrames = "≥0.0.1"
4946
DataInterpolations = "7, 8"
5047
DiffEqCallbacks = "4.2.2"
@@ -53,7 +50,7 @@ Documenter = "1.8.0"
5350
DocumenterInterLinks = "1"
5451
DynamicQuantities = "1.4.0"
5552
Electron = "≥0.0.1"
56-
GraphMakie = "0.5.13"
53+
GraphMakie = "0.6"
5754
Graphs = "≥0.0.1"
5855
LaTeXStrings = "1.4.0"
5956
Literate = "2.20.1"
@@ -69,6 +66,7 @@ Printf = "≥0.0.1"
6966
Random = "≥0.0.1"
7067
SciMLBase = "≥0.0.1"
7168
SimpleWeightedGraphs = "1.4.0"
69+
SparseConnectivityTracer = "≥0.0.1"
7270
StableRNGs = "1.0.2"
7371
StaticArrays = "≥0.0.1"
7472
StyledStrings = "≥0.0.1"

0 commit comments

Comments
 (0)