Skip to content

Commit 9d3c25e

Browse files
authored
build: fix compat Symbolics (#422)
* Update Project.toml * format with formatter v2 * ne CI tests * fix: update branch references from 'main' to 'master' in CI workflow * bump SciMLBase compat * bump ModelingToolkit * up compat SteadyStateDiffEq
1 parent 49eaa75 commit 9d3c25e

File tree

16 files changed

+68
-60
lines changed

16 files changed

+68
-60
lines changed

.github/workflows/CI.yml renamed to .github/workflows/Tests.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: Tests
22
on:
33
push:
44
tags:
@@ -13,6 +13,10 @@ concurrency:
1313
# Cancel intermediate builds: only if it is a pull request build.
1414
group: ${{ github.workflow }}-${{ github.ref }}
1515
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
16+
17+
env:
18+
JULIA_NUM_THREADS: 11
19+
1620
jobs:
1721
test:
1822
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
@@ -22,6 +26,7 @@ jobs:
2226
actions: write
2327
contents: read
2428
strategy:
29+
fail-fast: false
2530
matrix:
2631
version:
2732
- 'pre'
@@ -44,11 +49,10 @@ jobs:
4449
- uses: julia-actions/julia-buildpkg@v1
4550
- uses: julia-actions/julia-runtest@v1
4651
# - uses: julia-actions/julia-processcoverage@v1
47-
# - uses: codecov/codecov-action@v4
52+
# - uses: codecov/codecov-action@v5
4853
# with:
49-
# files: lcov.info
5054
# token: ${{ secrets.CODECOV_TOKEN }}
55+
# file: lcov.info
56+
# name: codecov-umbrella
5157
# fail_ci_if_error: false
52-
# - uses: julia-actions/julia-uploadcoveralls@v1
53-
# env:
54-
# COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
58+
# if: ${{ matrix.version == 'lts' }}

Project.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@ DocStringExtensions = "0.9.3"
4242
FunctionWrappers = "1.1.3"
4343
HomotopyContinuation = "2.12"
4444
LinearSolve = "2.39.0, 3"
45-
ModelingToolkit = "9.60"
45+
ModelingToolkit = "9.70.0"
4646
NaNMath = "1.1"
4747
OrderedCollections = "1.6"
4848
OrdinaryDiffEqTsit5 = "1.1"
4949
Plots = "1.40.9"
5050
PrecompileTools = "1.2"
5151
ProgressMeter = "1.7.2"
5252
QuantumCumulants = "0.3.7"
53-
SciMLBase = "2.72.0"
54-
SteadyStateDiffEq = "2.4.1"
55-
SymbolicUtils = "3.11"
56-
Symbolics = "6.23"
53+
SciMLBase = "2.83.1"
54+
SteadyStateDiffEq = "2.5.0"
55+
SymbolicUtils = "3.25.1"
56+
Symbolics = "~6.34"
5757
julia = "1.10.0"

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ makedocs(;
5252
pages=pages,
5353
source="src",
5454
build="build",
55-
draft=!CI,
55+
draft=(!CI),
5656
warnonly=if CI
5757
[:linkcheck, :cross_references]
5858
else

examples/ab_initio_noise.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ plot(freqω, psd; yscale=:log10, xlabel="Frequency", ylabel="Power")
6868

6969
# We will perform parameter sweep to generate noise spectra across the driving frequency $\omega$. For this we use the `EnsembleProblem` API from the SciML ecosystem.
7070
setter! = setp(sdesystem, ω)
71-
prob_func(prob, i, repeat) = (prob′ = remake(prob);
72-
setter!(prob′, ωrange[i]);
73-
prob′)
71+
prob_func(prob, i, repeat) = (prob′=remake(prob); setter!(prob′, ωrange[i]); prob′)
7472
output_func(sol, i) = (outputpsd(sol), false)
7573
prob_ensemble = EnsembleProblem(sdeproblem; prob_func=prob_func, output_func=output_func)
7674
sol_ensemble = solve(

examples/state_dependent_perturbation.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,9 @@ prob = HarmonicBalance.Problem(harmonic_tmp, varied, fixed)
205205
# We will sweep over the $\omega-\lambda$ plane and substitute the non-zero amplitude solution of the antisymmetric mode into the coupled equations of thesymmetric mode.
206206

207207
all_keys = cat(collect(keys(varied)), collect(keys(fixed)); dims=1)
208-
permutation =
209-
first.(
210-
filter(
211-
!isempty, [findall(x -> isequal(x, par), all_keys) for par in prob.parameters]
212-
)
213-
)
208+
permutation = first.(
209+
filter(!isempty, [findall(x -> isequal(x, par), all_keys) for par in prob.parameters])
210+
)
214211

215212
param_ranges = collect(values(varied))
216213
input_array = collect(Iterators.product(param_ranges..., values(fixed)...))

examples/steady_state_sweep.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ plot(time_soln.t, norm.(time_soln.u))
4848
# ## using follow_branch
4949

5050
followed_branch, Ys = follow_branch(1, result_HB; y="√(u1^2+v1^2)")
51-
Y_followed_gr =
52-
real.([Ys[param_idx][branch] for (param_idx, branch) in enumerate(followed_branch)]);
51+
Y_followed_gr = real.([
52+
Ys[param_idx][branch] for (param_idx, branch) in enumerate(followed_branch)
53+
]);
5354

5455
plot(result_HB, "sqrt(u1^2+v1^2)")
5556
plot!(ω_range, Y_followed_gr; c=:gray, ls=:dash)
@@ -64,8 +65,9 @@ plot!(ω_range, Y_followed_gr; c=:gray, ls=:dash)
6465

6566
@btime begin
6667
followed_branch, Ys = follow_branch(1, result_HB; y="√(u1^2+v1^2)")
67-
Y_followed_gr =
68-
real.([Ys[param_idx][branch] for (param_idx, branch) in enumerate(followed_branch)])
68+
Y_followed_gr = real.([
69+
Ys[param_idx][branch] for (param_idx, branch) in enumerate(followed_branch)
70+
])
6971
end
7072

7173
# Plotting them together gives:

ext/QuantumCumulantsExt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ function replace_to_reals(eqs::Vector{String}, ops_av::Vector{String}, conjugate
4949
conj_replace = map(eachindex(pair)) do i
5050
op = ops_av[pair[i]] # ∨ f(i) contains "+" or "-"
5151
op => if is_real
52-
"((" * op_r * ") / √(2))" #=prefactor * " " *=#
52+
"((" * op_r * ") / √(2))"
5353
else
54-
"((" * op_r * " $(f(i)) im*" * op_i * ") / √(2))" #=prefactor *=#
54+
"((" * op_r * " $(f(i)) im*" * op_i * ") / √(2))"
5555
end
5656
end
5757
if isequal(pair...)

ext/TimeEvolution/ODEProblem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function OrdinaryDiffEqTsit5.ODEProblem(
3737
unwrap.([
3838
substitute(eq, Dict(zip(keys(sweep), [sweep[p](T) for p in keys(sweep)])))
3939
for eq in eqs(v)
40-
])
40+
]),
4141
)
4242
end
4343

src/DifferentialEquation.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ $(TYPEDSIGNATURES)
115115
116116
Return the dependent variables of `diff_eom`.
117117
"""
118-
Symbolics.get_variables(diff_eom::DifferentialEquation)::Vector{Num} =
119-
collect(keys(diff_eom.equations))
118+
Symbolics.get_variables(diff_eom::DifferentialEquation)::Vector{Num} = collect(
119+
keys(diff_eom.equations)
120+
)
120121

121122
"""
122123
$(TYPEDSIGNATURES)
@@ -125,8 +126,9 @@ Check if all equations in `diff_eom` are harmonic with respect to `t`. The funct
125126
differential equation system `diff_eom` and a variable `t`, and returns `true` if all equations
126127
are harmonic with respect to `t`, otherwise it returns `false`.
127128
"""
128-
ExprUtils.is_harmonic(diff_eom::DifferentialEquation, t::Num)::Bool =
129-
all([is_harmonic(eq, t) for eq in values(diff_eom.equations)])
129+
ExprUtils.is_harmonic(diff_eom::DifferentialEquation, t::Num)::Bool = all([
130+
is_harmonic(eq, t) for eq in values(diff_eom.equations)
131+
])
130132

131133
"""
132134
$(TYPEDSIGNATURES)

src/HarmonicEquation.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ mutable struct HarmonicEquation
2121
# use a self-referential constructor with _parameters
2222
function HarmonicEquation(equations, variables, nat_eq)
2323
return (
24-
x = new(
24+
x=new(
2525
equations,
2626
variables,
2727
Num[],
2828
nat_eq,
2929
dummy_symbolic_Jacobian(length(variables)),
3030
);
31-
x.parameters = _parameters(x);
31+
x.parameters=_parameters(x);
3232
x
3333
)
3434
end

0 commit comments

Comments
 (0)