Skip to content

Commit

Permalink
Reduce-deps (#366)
Browse files Browse the repository at this point in the history
* CI

* pkg

* replace DiffEq

* mention OrdinaryDiffEq

* fix
  • Loading branch information
sosiristseng authored Oct 18, 2024
1 parent ad745fb commit f271ee0
Show file tree
Hide file tree
Showing 28 changed files with 71 additions and 184 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ concurrency:
cancel-in-progress: true

env:
NBCONVERT_JOBS: '3'
LITERATE_PROC: '3'
NBCONVERT_JOBS: '2'
LITERATE_PROC: '2'
JULIA_NUM_THREADS: '2'
ALLOWERRORS: 'false'
JULIA_CONDAPKG_BACKEND: 'Null'
JULIA_CI: 'true'
NBCACHE: '.cache'
UV_SYSTEM_PYTHON: 1

jobs:
CI:
Expand All @@ -34,13 +34,10 @@ jobs:
- name: Install Python dependencies
run: |
pip install uv
uv pip install -r requirements.txt
uv pip install --system -r requirements.txt
- name: Read Julia version
uses: SebRollen/[email protected]
id: read_toml
with:
file: 'Manifest.toml'
field: 'julia_version'
run: echo value=$(python -c 'import tomllib; from pathlib import Path; print(tomllib.loads(Path("Manifest.toml").read_text())["julia_version"])') >> "$GITHUB_OUTPUT"
- name: Get environment hash
id: hash
run: |
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
linkcheck:
env:
DIR: 'docs'
UV_SYSTEM_PYTHON: 1
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -46,9 +45,9 @@ jobs:
id: setup-python
with:
python-version: '3.x'
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install Python dependencies
run: uv pip install -r requirements.txt
run: |
pip install uv
uv pip install --system -r requirements.txt
- name: Build website
run: jupyter-book build ${DIR} --builder linkcheck
107 changes: 6 additions & 101 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.11.1"
manifest_format = "2.0"
project_hash = "7e5807e059f83e7dc9033cceb2df5b3a68479e06"
project_hash = "a5120a3c8f5dc351457c968d8af338aebf0e50c7"

[[deps.ADTypes]]
git-tree-sha1 = "eea5d80188827b35333801ef97a40c2ed653b081"
Expand Down Expand Up @@ -120,16 +120,6 @@ git-tree-sha1 = "01b8ccb13d68535d73d2b0c23e39bd23155fb712"
uuid = "13072b0f-2c55-5437-9ae7-d433b7a33950"
version = "1.1.0"

[[deps.BandedMatrices]]
deps = ["ArrayLayouts", "FillArrays", "LinearAlgebra", "PrecompileTools"]
git-tree-sha1 = "a2c85f53ddcb15b4099da59867868bd40f005579"
uuid = "aae01518-5342-5314-be14-df237901396f"
version = "1.7.5"
weakdeps = ["SparseArrays"]

[deps.BandedMatrices.extensions]
BandedMatricesSparseArraysExt = "SparseArrays"

[[deps.Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
version = "1.11.0"
Expand All @@ -155,34 +145,19 @@ deps = ["ArrayLayouts", "FillArrays", "LinearAlgebra"]
git-tree-sha1 = "d434647f798823bcae510aee0bc0401927f64391"
uuid = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
version = "1.1.1"
weakdeps = ["BandedMatrices"]

[deps.BlockArrays.extensions]
BlockArraysBandedMatricesExt = "BandedMatrices"

[[deps.BoundaryValueDiffEq]]
deps = ["ADTypes", "Adapt", "ArrayInterface", "BandedMatrices", "ConcreteStructs", "DiffEqBase", "FastAlmostBandedMatrices", "FastClosures", "ForwardDiff", "LineSearch", "LineSearches", "LinearAlgebra", "LinearSolve", "Logging", "NonlinearSolve", "OrdinaryDiffEq", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "Setfield", "SparseArrays", "SparseDiffTools"]
git-tree-sha1 = "8dba4ea86fce8ed94977ed9e56cf5c6d67c494e5"
uuid = "764a87c0-6b3e-53db-9096-fe964310641d"
version = "5.11.0"

[deps.BoundaryValueDiffEq.extensions]
BoundaryValueDiffEqODEInterfaceExt = "ODEInterface"

[deps.BoundaryValueDiffEq.weakdeps]
ODEInterface = "54ca160b-1b9f-5127-a996-1867f4bc2a2c"
[deps.BlockArrays.weakdeps]
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"

[[deps.Bzip2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "9e2a6b69137e6969bab0152632dcb3bc108c8bdd"
uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0"
version = "1.0.8+1"

[[deps.CEnum]]
git-tree-sha1 = "389ad5c84de1ae7cf0e28e381131c98ea87d54fc"
uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82"
version = "0.5.0"

[[deps.CPUSummary]]
deps = ["CpuId", "IfElse", "PrecompileTools", "Static"]
git-tree-sha1 = "5a97e67919535d6841172016c9530fd69494e5ec"
Expand Down Expand Up @@ -404,12 +379,6 @@ git-tree-sha1 = "fc173b380865f70627d7dd1190dc2fce6cc105af"
uuid = "ee1fde0b-3d02-5ea6-8484-8dfef6360eab"
version = "1.14.10+0"

[[deps.DelayDiffEq]]
deps = ["ArrayInterface", "DataStructures", "DiffEqBase", "LinearAlgebra", "Logging", "OrdinaryDiffEq", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SimpleNonlinearSolve", "SimpleUnPack"]
git-tree-sha1 = "066f60231c1b0ae2905ffd2651e207accd91f627"
uuid = "bcd4f6db-9728-5f36-b5f7-82caef46ccdb"
version = "5.48.1"

[[deps.DelimitedFiles]]
deps = ["Mmap"]
git-tree-sha1 = "9e2f36d3c96a820c678f2f1f1782582fcf685bae"
Expand Down Expand Up @@ -451,11 +420,10 @@ version = "6.158.1"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[[deps.DiffEqCallbacks]]
deps = ["DataStructures", "DiffEqBase", "ForwardDiff", "Functors", "LinearAlgebra", "Markdown", "NonlinearSolve", "Parameters", "RecipesBase", "RecursiveArrayTools", "SciMLBase", "StaticArraysCore"]
git-tree-sha1 = "19dbd44d18bbfdfcf5e56c99cea9b0ed23df350a"
deps = ["ConcreteStructs", "DataStructures", "DiffEqBase", "DifferentiationInterface", "Functors", "LinearAlgebra", "Markdown", "RecipesBase", "RecursiveArrayTools", "SciMLBase", "StaticArraysCore"]
git-tree-sha1 = "7f700fa4fb6e55f4672f8218ef228107245a2e9d"
uuid = "459566f4-90b8-5000-8ac3-15dfb0a30def"
version = "3.9.1"
weakdeps = ["OrdinaryDiffEq", "OrdinaryDiffEqCore", "Sundials"]
version = "4.0.0"

[[deps.DiffEqNoiseProcess]]
deps = ["DiffEqBase", "Distributions", "GPUArraysCore", "LinearAlgebra", "Markdown", "Optim", "PoissonRandom", "QuadGK", "Random", "Random123", "RandomNumbers", "RecipesBase", "RecursiveArrayTools", "ResettableStacks", "SciMLBase", "StaticArraysCore", "Statistics"]
Expand All @@ -481,12 +449,6 @@ git-tree-sha1 = "23163d55f885173722d1e4cf0f6110cdbaf7e272"
uuid = "b552c78f-8df3-52c6-915a-8e097449b14b"
version = "1.15.1"

[[deps.DifferentialEquations]]
deps = ["BoundaryValueDiffEq", "DelayDiffEq", "DiffEqBase", "DiffEqCallbacks", "DiffEqNoiseProcess", "JumpProcesses", "LinearAlgebra", "LinearSolve", "NonlinearSolve", "OrdinaryDiffEq", "Random", "RecursiveArrayTools", "Reexport", "SciMLBase", "SteadyStateDiffEq", "StochasticDiffEq", "Sundials"]
git-tree-sha1 = "d851f2ca05f3cec9988f081b047a778a58b48aaf"
uuid = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
version = "7.14.0"

[[deps.DifferentiationInterface]]
deps = ["ADTypes", "LinearAlgebra"]
git-tree-sha1 = "16611777adf4a818f18c33210895947814180964"
Expand Down Expand Up @@ -540,17 +502,6 @@ weakdeps = ["ChainRulesCore", "EnzymeCore"]
DispatchDoctorChainRulesCoreExt = "ChainRulesCore"
DispatchDoctorEnzymeCoreExt = "EnzymeCore"

[[deps.Distances]]
deps = ["LinearAlgebra", "Statistics", "StatsAPI"]
git-tree-sha1 = "66c4c81f259586e8f002eacebc177e1fb06363b0"
uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
version = "0.10.11"
weakdeps = ["ChainRulesCore", "SparseArrays"]

[deps.Distances.extensions]
DistancesChainRulesCoreExt = "ChainRulesCore"
DistancesSparseArraysExt = "SparseArrays"

[[deps.Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Expand Down Expand Up @@ -680,12 +631,6 @@ git-tree-sha1 = "466d45dc38e15794ec7d5d63ec03d776a9aff36e"
uuid = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5"
version = "4.4.4+1"

[[deps.FastAlmostBandedMatrices]]
deps = ["ArrayInterface", "ArrayLayouts", "BandedMatrices", "ConcreteStructs", "LazyArrays", "LinearAlgebra", "MatrixFactorizations", "PrecompileTools", "Reexport"]
git-tree-sha1 = "3f03d94c71126b6cfe20d3cbcc41c5cd27e1c419"
uuid = "9d29842c-ecb8-4973-b1e9-a27b1157504e"
version = "0.1.4"

[[deps.FastBroadcast]]
deps = ["ArrayInterface", "LinearAlgebra", "Polyester", "Static", "StaticArrayInterface", "StrideArraysCore"]
git-tree-sha1 = "ab1b34570bcdf272899062e1a56285a53ecaae08"
Expand Down Expand Up @@ -1110,12 +1055,6 @@ deps = ["Artifacts", "Pkg"]
uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
version = "1.11.0"

[[deps.LevyArea]]
deps = ["LinearAlgebra", "Random", "SpecialFunctions"]
git-tree-sha1 = "56513a09b8e0ae6485f34401ea9e2f31357958ec"
uuid = "2d8b4e74-eb68-11e8-0fb9-d5eb67b50637"
version = "1.0.0"

[[deps.LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
Expand Down Expand Up @@ -1314,16 +1253,6 @@ deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
version = "1.11.0"

[[deps.MatrixFactorizations]]
deps = ["ArrayLayouts", "LinearAlgebra", "Printf", "Random"]
git-tree-sha1 = "16a726dba99685d9e94c8d0a8f655383121fc608"
uuid = "a3b82374-2e81-5b9e-98ce-41277c0e4c87"
version = "3.0.1"
weakdeps = ["BandedMatrices"]

[deps.MatrixFactorizations.extensions]
MatrixFactorizationsBandedMatricesExt = "BandedMatrices"

[[deps.MaybeInplace]]
deps = ["ArrayInterface", "LinearAlgebra", "MacroTools"]
git-tree-sha1 = "54e2fdc38130c05b42be423e90da3bade29b74bd"
Expand Down Expand Up @@ -1405,12 +1334,6 @@ git-tree-sha1 = "a0b464d183da839699f4c79e7606d9d186ec172c"
uuid = "d41bc354-129a-5804-8e4c-c37616107c6c"
version = "7.8.3"

[[deps.NLsolve]]
deps = ["Distances", "LineSearches", "LinearAlgebra", "NLSolversBase", "Printf", "Reexport"]
git-tree-sha1 = "019f12e9a1a7880459d0173c182e6a99365d7ac1"
uuid = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
version = "4.5.1"

[[deps.NaNMath]]
deps = ["OpenLibm_jll"]
git-tree-sha1 = "0877504529a3e5c3343c6f8b4c0381e57e4387e4"
Expand Down Expand Up @@ -2310,12 +2233,6 @@ git-tree-sha1 = "920acf6ae36c86f23969fea1d317e040dbfccf53"
uuid = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f"
version = "2.4.1"

[[deps.StochasticDiffEq]]
deps = ["Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DiffEqNoiseProcess", "DocStringExtensions", "FiniteDiff", "ForwardDiff", "JumpProcesses", "LevyArea", "LinearAlgebra", "Logging", "MuladdMacro", "NLsolve", "OrdinaryDiffEq", "Random", "RandomNumbers", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SparseArrays", "SparseDiffTools", "StaticArrays", "UnPack"]
git-tree-sha1 = "b49030a24847e8c3e85eed3359825297ffb70dfa"
uuid = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0"
version = "6.69.1"

[[deps.StrideArraysCore]]
deps = ["ArrayInterface", "CloseOpenIntervals", "IfElse", "LayoutPointers", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface", "ThreadingUtilities"]
git-tree-sha1 = "f35f6ab602df8413a50c4a25ca14de821e8605fb"
Expand All @@ -2341,18 +2258,6 @@ deps = ["Artifacts", "Libdl", "libblastrampoline_jll"]
uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c"
version = "7.7.0+0"

[[deps.Sundials]]
deps = ["CEnum", "DataStructures", "DiffEqBase", "Libdl", "LinearAlgebra", "Logging", "PrecompileTools", "Reexport", "SciMLBase", "SparseArrays", "Sundials_jll"]
git-tree-sha1 = "e87efb31e5360cb223a151c2398903dc2faeb32b"
uuid = "c3572dad-4567-51f8-b174-8c6c989267f4"
version = "4.26.0"

[[deps.Sundials_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "SuiteSparse_jll", "libblastrampoline_jll"]
git-tree-sha1 = "91db7ed92c66f81435fe880947171f1212936b14"
uuid = "fb77eaff-e24c-56d4-86b1-d163f2edb164"
version = "5.2.3+0"

[[deps.SymbolicIndexingInterface]]
deps = ["Accessors", "ArrayInterface", "RuntimeGeneratedFunctions", "StaticArraysCore"]
git-tree-sha1 = "4bc96df5d71515b1cb86dd626915f06f4c0d46f5"
Expand Down
13 changes: 4 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Catalyst = "479239e8-5488-4da2-87a7-35f2df7eef83"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
JumpProcesses = "ccbc3e58-028d-4f4c-8cd5-9ae44345cda5"
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SimpleUnPack = "ce78b400-467f-4804-87d8-8f486da07d0a"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"

[preferences.BoundaryValueDiffEq]
PrecompileMIRK = false
PrecompileMIRKNLLS = false
PrecompileMultipleShooting = false
PrecompileMultipleShootingNLLS = false
PrecompileShooting = false
PrecompileShootingNLLS = false
SteadyStateDiffEq = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f"
10 changes: 4 additions & 6 deletions docs/figs/ch1-07.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ Collins toggle switch
For Figures 1.7, 7.13, 7.14, 7.15
===#

using DifferentialEquations
using OrdinaryDiffEq
using ModelingToolkit
using Plots
Plots.default(linewidth=2)
Expand All @@ -25,8 +24,8 @@ function build_collins(;name)
γ=4.0
end

@independent_variables t
@variables begin
t
s1(t)=0.075
s2(t)=2.5
i1(t)
Expand All @@ -41,12 +40,11 @@ function build_collins(;name)
i2 ~ 10 * (10 < t) * (t < 20),
i1 ~ 10 * (30 < t) * (t < 40),
]
sys = ODESystem(eqs, t; name)
return structural_simplify(sys)
return ODESystem(eqs, t; name)
end

#---
@named sys = build_collins()
@mtkbuild sys = build_collins()

# Solve the problem
tspan = (0.0, 50.0)
Expand Down
11 changes: 5 additions & 6 deletions docs/figs/ch1-09.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
Hodgkin-Huxley model
===#

using DifferentialEquations
using OrdinaryDiffEq
using ModelingToolkit
using Plots
Plots.default(linewidth=2)
Expand All @@ -27,8 +26,9 @@ function build_hh(;name)
C_M = 1.0 ## membrane capacitance (uF/cm^2))
end

@independent_variables t

@variables begin
t
(t)
(t)
(t)
Expand Down Expand Up @@ -64,13 +64,12 @@ function build_hh(;name)
D(n) ~ -(nα + nβ) * n + nα,
]

sys = ODESystem(eqs, t; name)
return structural_simplify(sys)
return ODESystem(eqs, t; name)
end

#---
tend = 100.0
@named sys = build_hh()
@mtkbuild sys = build_hh()
prob = ODEProblem(sys, [], tend, [])

#---
Expand Down
2 changes: 1 addition & 1 deletion docs/figs/ch2-09.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Metabolic network simulation
Using `Catalyst.jl` to simulate a metabolic network.
===#
using DifferentialEquations
using OrdinaryDiffEq
using Catalyst
using ModelingToolkit
using Plots
Expand Down
Loading

0 comments on commit f271ee0

Please sign in to comment.