Skip to content

Commit e3ef9b4

Browse files
committed
Switch from JuliaFormatter to Runic.jl for code formatting
- Update CI workflow to use fredrikekre/runic-action@v1 - Remove .JuliaFormatter.toml configuration - Format all source files with Runic.jl 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ea6821d commit e3ef9b4

File tree

4 files changed

+51
-29
lines changed

4 files changed

+51
-29
lines changed

.JuliaFormatter.toml

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

.github/workflows/FormatCheck.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: format-check
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
- 'main'
8+
- 'release-'
9+
tags: '*'
10+
pull_request:
11+
12+
jobs:
13+
runic:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: fredrikekre/runic-action@v1
18+
with:
19+
version: '1'

src/MATLABDiffEq.jl

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,30 @@ _is_matlab_compatible_eltype(::Type) = false
1414
function _check_matlab_compatible(u0, tspan)
1515
T = eltype(u0)
1616
if !_is_matlab_compatible_eltype(T)
17-
throw(ArgumentError(
18-
"MATLABDiffEq.jl requires Float64-compatible element types. " *
19-
"Got eltype(u0) = $T. MATLAB does not support arbitrary precision " *
20-
"(BigFloat) or GPU arrays (JLArrays, CuArrays). Please convert your " *
21-
"initial conditions to Float64: u0 = Float64.(u0)"
22-
))
17+
throw(
18+
ArgumentError(
19+
"MATLABDiffEq.jl requires Float64-compatible element types. " *
20+
"Got eltype(u0) = $T. MATLAB does not support arbitrary precision " *
21+
"(BigFloat) or GPU arrays (JLArrays, CuArrays). Please convert your " *
22+
"initial conditions to Float64: u0 = Float64.(u0)"
23+
)
24+
)
2325
end
2426
tT = eltype(tspan)
2527
if !_is_matlab_compatible_eltype(tT)
26-
throw(ArgumentError(
27-
"MATLABDiffEq.jl requires Float64-compatible time span types. " *
28-
"Got eltype(tspan) = $tT. MATLAB does not support arbitrary precision " *
29-
"(BigFloat). Please use Float64 for tspan: tspan = Float64.(tspan)"
30-
))
28+
throw(
29+
ArgumentError(
30+
"MATLABDiffEq.jl requires Float64-compatible time span types. " *
31+
"Got eltype(tspan) = $tT. MATLAB does not support arbitrary precision " *
32+
"(BigFloat). Please use Float64 for tspan: tspan = Float64.(tspan)"
33+
)
34+
)
3135
end
3236
# Check that the array type itself is a standard Julia array
3337
if !(u0 isa Array || u0 isa Number)
3438
@warn "MATLABDiffEq.jl works best with standard Julia Arrays. " *
35-
"Got $(typeof(u0)). The array will be converted to a standard Array " *
36-
"before being sent to MATLAB."
39+
"Got $(typeof(u0)). The array will be converted to a standard Array " *
40+
"before being sent to MATLAB."
3741
end
3842
return nothing
3943
end
@@ -63,11 +67,11 @@ function DiffEqBase.__solve(
6367
ks = [];
6468
saveat = eltype(tupType)[],
6569
timeseries_errors = true,
66-
reltol = 1e-3,
67-
abstol = 1e-6,
70+
reltol = 1.0e-3,
71+
abstol = 1.0e-6,
6872
callback = nothing,
6973
kwargs...
70-
) where {uType, tupType, isinplace, AlgType <: MATLABAlgorithm}
74+
) where {uType, tupType, isinplace, AlgType <: MATLABAlgorithm}
7175
# Validate that input types are MATLAB-compatible
7276
_check_matlab_compatible(prob.u0, prob.tspan)
7377

@@ -144,7 +148,7 @@ function DiffEqBase.__solve(
144148

145149
stats = buildDEStats(solstats)
146150

147-
DiffEqBase.build_solution(
151+
return DiffEqBase.build_solution(
148152
prob,
149153
alg,
150154
ts,
@@ -170,7 +174,7 @@ function buildDEStats(solverstats::Dict{String, <:Any})::DiffEqBase.Stats
170174
destats.nsolve = Int(get(solverstats, "nsolves", 0))
171175
destats.njacs = Int(get(solverstats, "npds", 0))
172176
destats.nw = Int(get(solverstats, "ndecomps", 0))
173-
destats
177+
return destats
174178
end
175179

176180
@setup_workload begin

test/runtests.jl

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,22 @@ sol = solve(prob, MATLABDiffEq.ode45())
1919
function lorenz(du, u, p, t)
2020
du[1] = 10.0(u[2] - u[1])
2121
du[2] = u[1] * (28.0 - u[3]) - u[2]
22-
du[3] = u[1] * u[2] - (8 / 3) * u[3]
22+
return du[3] = u[1] * u[2] - (8 / 3) * u[3]
2323
end
2424
u0 = [1.0; 0.0; 0.0]
2525
tspan = (0.0, 100.0)
2626
prob = ODEProblem(lorenz, u0, tspan)
2727
sol = solve(prob, MATLABDiffEq.ode45())
2828

29-
algs = [MATLABDiffEq.ode23
30-
MATLABDiffEq.ode45
31-
MATLABDiffEq.ode113
32-
MATLABDiffEq.ode23s
33-
MATLABDiffEq.ode23t
34-
MATLABDiffEq.ode23tb
35-
MATLABDiffEq.ode15s]
29+
algs = [
30+
MATLABDiffEq.ode23
31+
MATLABDiffEq.ode45
32+
MATLABDiffEq.ode113
33+
MATLABDiffEq.ode23s
34+
MATLABDiffEq.ode23t
35+
MATLABDiffEq.ode23tb
36+
MATLABDiffEq.ode15s
37+
]
3638

3739
for alg in algs
3840
sol = solve(prob, alg())

0 commit comments

Comments
 (0)