Skip to content

Commit 4c1740f

Browse files
Merge pull request #4063 from SciML/as/simplify-ci
ci: do not `dev` packages in CI script
2 parents 45a79a7 + d8cc069 commit 4c1740f

30 files changed

+1066
-1057
lines changed

.github/workflows/Tests.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,26 +74,16 @@ jobs:
7474
if PKG == "ModelingToolkitBase"
7575
@info "Testing ModelingToolkitBase"
7676
Pkg.activate("lib/ModelingToolkitBase")
77-
@info "`dev`ing SciCompDSL"
78-
Pkg.develop(; path = "lib/SciCompDSL")
7977
@info "Running tests" GROUP
8078
Pkg.test()
8179
elseif PKG == "ModelingToolkit"
8280
@info "Testing ModelingToolkit"
8381
Pkg.activate(".")
84-
@info "`dev`ing ModelingToolkitBase"
85-
Pkg.develop(; path = "lib/ModelingToolkitBase")
86-
@info "`dev`ing SciCompDSL"
87-
Pkg.develop(; path = "lib/SciCompDSL")
8882
@info "Running tests" GROUP
8983
Pkg.test()
9084
elseif PKG == "SciCompDSL"
9185
@info "Testing SciCompDSL"
9286
Pkg.activate("lib/SciCompDSL")
93-
@info "`dev`ing ModelingToolkitBase"
94-
Pkg.develop(; path = "lib/ModelingToolkitBase")
95-
@info "`dev`ing ModelingToolkit"
96-
Pkg.develop(; path = ".")
9787
@info "Running tests" GROUP
9888
Pkg.test()
9989
else

Project.toml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ subdir = "lib/ModelingToolkitBase"
5454
rev = "as/mtk-v11"
5555
url = "https://github.com/SciML/ModelingToolkitStandardLibrary.jl"
5656

57-
[sources.ModelingToolkitTearing]
58-
rev = "main"
59-
subdir = "lib/ModelingToolkitTearing"
60-
url = "https://github.com/JuliaComputing/StateSelection.jl/"
61-
6257
[sources.Optimization]
6358
rev = "as/symbolics-v7"
6459
url = "https://github.com/AayushSabharwal/Optimization.jl"
@@ -76,10 +71,6 @@ url = "https://github.com/AayushSabharwal/Optimization.jl"
7671
[sources.SciCompDSL]
7772
subdir = "lib/SciCompDSL"
7873

79-
[sources.StateSelection]
80-
rev = "main"
81-
url = "https://github.com/JuliaComputing/StateSelection.jl/"
82-
8374
[extensions]
8475
MTKFMIExt = "FMI"
8576

lib/ModelingToolkitBase/test/analysis_points.jl

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ using Test
66
using ModelingToolkitBase: t_nounits as t, D_nounits as D, AnalysisPoint, AbstractSystem
77
import ModelingToolkitBase as MTK
88
import ControlSystemsBase as CS
9-
using SciCompDSL
109
using ModelingToolkitStandardLibrary
1110

1211
using Symbolics: NAMESPACE_SEPARATOR
@@ -693,17 +692,26 @@ using DynamicQuantities
693692

694693
@testset "AnalysisPoint is ignored when verifying units" begin
695694
# no units first
696-
@mtkmodel FirstOrderTest begin
697-
@components begin
695+
@component function FirstOrderTest(; name)
696+
pars = @parameters begin
697+
end
698+
699+
systems = @named begin
698700
in = Step()
699701
fb = Feedback()
700702
fo = SecondOrder(k = 1, w = 1, d = 0.1)
701703
end
702-
@equations begin
704+
705+
vars = @variables begin
706+
end
707+
708+
equations = Equation[
703709
connect(in.output, :u, fb.input1)
704710
connect(fb.output, :e, fo.input)
705711
connect(fo.output, :y, fb.input2)
706-
end
712+
]
713+
714+
return System(equations, t, vars, pars; name, systems)
707715
end
708716
@named model = FirstOrderTest()
709717
@test model isa System
@@ -735,38 +743,48 @@ using DynamicQuantities
735743
]
736744
return System(eqs, t, [], pars; systems, name)
737745
end
738-
@mtkmodel TestAPAroundUnits begin
739-
@components begin
746+
@component function TestAPAroundUnits(; name)
747+
pars = @parameters begin
748+
end
749+
750+
systems = @named begin
740751
input = UnitfulInput()
752+
ub = UnitfulBlock()
741753
end
742-
@variables begin
754+
755+
vars = @variables begin
743756
output(t), [output=true, unit=u"m^2"]
744757
end
745-
@components begin
746-
ub = UnitfulBlock()
747-
end
748-
@equations begin
758+
759+
equations = Equation[
749760
connect(ub.output, :ap, input)
750761
output ~ input.u^2
751-
end
762+
]
763+
764+
return System(equations, t, vars, pars; name, systems)
752765
end
753766
@named sys = TestAPAroundUnits()
754767
@test sys isa System
755768

756-
@mtkmodel TestAPWithNoOutputs begin
757-
@components begin
769+
@component function TestAPWithNoOutputs(; name)
770+
pars = @parameters begin
771+
end
772+
773+
systems = @named begin
758774
input = UnitfulInput()
775+
ub = UnitfulBlock()
759776
end
760-
@variables begin
777+
778+
vars = @variables begin
761779
output(t), [output=true, unit=u"m^2"]
762780
end
763-
@components begin
764-
ub = UnitfulBlock()
765-
end
766-
@equations begin
781+
782+
equations = Equation[
767783
connect(ub.output, :ap, input)
768784
output ~ input.u^2
769-
end
785+
]
786+
787+
return System(equations, t, vars, pars; name, systems)
770788
end
771789
@named sys2 = TestAPWithNoOutputs()
772790
@test sys2 isa System

lib/ModelingToolkitBase/test/basic_transformations.jl

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ using ModelingToolkitStandardLibrary.Blocks: RealInput, RealOutput
33
using Symbolics: value
44
using SymbolicUtils: symtype, _iszero
55
using ModelingToolkitBase: SymbolicContinuousCallback
6-
using SciCompDSL
76

87
@independent_variables t
98
D = Differential(t)
@@ -256,48 +255,72 @@ end
256255

257256
@testset "Change independent variable, no equations" begin
258257
# make this "look" like the standard library RealInput
259-
@mtkmodel Input begin
260-
@variables begin
258+
@component function Input(; name)
259+
pars = @parameters begin
260+
end
261+
262+
systems = @named begin
263+
end
264+
265+
vars = @variables begin
261266
u(t)
262267
end
268+
269+
equations = Equation[]
270+
271+
return System(equations, t, vars, pars; name, systems)
263272
end
264273
@named input_sys = Input()
265274
input_sys = complete(input_sys)
266275
# test no failures
267276
@test change_independent_variable(input_sys, input_sys.u) isa System
268277

269-
@mtkmodel NestedInput begin
270-
@components begin
278+
@component function NestedInput(; name)
279+
pars = @parameters begin
280+
end
281+
282+
systems = @named begin
271283
in = Input()
272284
end
273-
@variables begin
285+
286+
vars = @variables begin
274287
x(t)
275288
end
276-
@equations begin
289+
290+
equations = Equation[
277291
D(x) ~ in.u
278-
end
292+
]
293+
294+
return System(equations, t, vars, pars; name, systems)
279295
end
280296
@named nested_input_sys = NestedInput()
281297
nested_input_sys = complete(nested_input_sys; flatten = false)
282298
@test change_independent_variable(nested_input_sys, nested_input_sys.x) isa System
283299
end
284300

285301
@testset "Change of variables, connections" begin
286-
@mtkmodel ConnectSys begin
287-
@components begin
302+
@component function ConnectSys(; name)
303+
pars = @parameters begin
304+
end
305+
306+
systems = @named begin
288307
in = RealInput()
289308
out = RealOutput()
290309
end
291-
@variables begin
310+
311+
vars = @variables begin
292312
x(t)
293313
y(t)
294314
end
295-
@equations begin
315+
316+
equations = Equation[
296317
connect(in, out)
297318
in.u ~ x
298319
D(x) ~ -out.u
299320
D(y) ~ 1
300-
end
321+
]
322+
323+
return System(equations, t, vars, pars; name, systems)
301324
end
302325
@named sys = ConnectSys()
303326
sys = complete(sys; flatten = false)

lib/ModelingToolkitBase/test/causal_variables_connection.jl

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using ModelingToolkitBase, ModelingToolkitStandardLibrary.Blocks
2-
using SciCompDSL
32
using ModelingToolkitBase: t_nounits as t, D_nounits as D
43
using Test
54

@@ -96,27 +95,44 @@ if @isdefined(ModelingToolkit)
9695
end
9796

9897
@testset "Outside input to inside input connection" begin
99-
@mtkmodel Inner begin
100-
@variables begin
98+
@component function Inner(; name)
99+
pars = @parameters begin
100+
end
101+
102+
systems = @named begin
103+
end
104+
105+
vars = @variables begin
101106
x(t), [input = true]
102107
y(t), [output = true]
103108
end
104-
@equations begin
109+
110+
equations = Equation[
105111
y ~ x
106-
end
112+
]
113+
114+
return System(equations, t, vars, pars; name, systems)
107115
end
108-
@mtkmodel Outer begin
109-
@variables begin
110-
u(t), [input = true]
111-
v(t), [output = true]
116+
117+
@component function Outer(; name)
118+
pars = @parameters begin
112119
end
113-
@components begin
120+
121+
systems = @named begin
114122
inner = Inner()
115123
end
116-
@equations begin
124+
125+
vars = @variables begin
126+
u(t), [input = true]
127+
v(t), [output = true]
128+
end
129+
130+
equations = Equation[
117131
connect(u, inner.x)
118132
connect(inner.y, v)
119-
end
133+
]
134+
135+
return System(equations, t, vars, pars; name, systems)
120136
end
121137
@named sys = Outer()
122138
ss = toggle_namespacing(sys, false)
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
import ModelingToolkitStandardLibrary.Electrical as El
22
import ModelingToolkitStandardLibrary.Blocks as Bl
3-
using SciCompDSL
43

5-
@mtkmodel RCModel begin
6-
@parameters begin
4+
@component function RCModel(; name)
5+
pars = @parameters begin
76
R = 1.0
87
C = 1.0
98
V = 1.0
109
end
11-
@components begin
10+
systems = @named begin
1211
resistor = El.Resistor(R = R)
1312
capacitor = El.Capacitor(C = C)
1413
shape = Bl.Constant(k = V)
1514
source = El.Voltage()
1615
ground = El.Ground()
1716
end
18-
@equations begin
17+
eqs = [
1918
connect(shape.output, source.V)
2019
connect(source.p, resistor.p)
2120
connect(resistor.n, capacitor.p)
2221
connect(capacitor.n, source.n)
2322
connect(capacitor.n, ground.g)
24-
end
23+
]
24+
System(eqs, t, [], pars; systems, name)
2525
end
2626

2727
@named rc_model = RCModel()

0 commit comments

Comments
 (0)