Skip to content

Commit ebe7818

Browse files
qa: enforce strict SciMLTesting 2.4 checks (#497)
Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com>
1 parent c2ee11b commit ebe7818

28 files changed

Lines changed: 232 additions & 218 deletions

File tree

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ModelingToolkitStandardLibrary"
22
uuid = "16a59e39-deab-5bd0-87e4-056b12336739"
3-
version = "2.29.5"
3+
version = "2.29.6"
44
authors = ["Chris Rackauckas and Julia Computing"]
55

66
[deps]
@@ -34,7 +34,7 @@ SafeTestsets = "0.1"
3434
SciCompDSL = "1"
3535
SciMLBase = "2, 3"
3636
SciMLStructures = "1.7.0"
37-
SciMLTesting = "2.1"
37+
SciMLTesting = "2.4"
3838
SymbolicIndexingInterface = "0.3.39"
3939
SymbolicUtils = "4.38.1"
4040
Symbolics = "7.4.1"

docs/make.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ makedocs(
2121
sitename = "ModelingToolkitStandardLibrary.jl",
2222
authors = "Julia Computing",
2323
modules = [
24-
ModelingToolkit,
2524
ModelingToolkitStandardLibrary,
2625
ModelingToolkitStandardLibrary.Blocks,
2726
ModelingToolkitStandardLibrary.Mechanical,
@@ -33,9 +32,10 @@ makedocs(
3332
ModelingToolkitStandardLibrary.Hydraulic,
3433
ModelingToolkitStandardLibrary.Hydraulic.IsothermalCompressible,
3534
],
36-
clean = true, doctest = false, linkcheck = true,
37-
linkcheck_ignore = ["https://www.mathworks.com/help/simscape/ug/basic-principles-of-modeling-physical-networks.html#bq89sba-6"],
38-
warnonly = [:docs_block, :missing_docs, :cross_references],
35+
clean = true,
36+
checkdocs = :exports,
37+
doctest = true,
38+
linkcheck = true,
3939
format = Documenter.HTML(
4040
assets = ["assets/favicon.ico"],
4141
canonical = "https://docs.sciml.ai/ModelingToolkitStandardLibrary/stable/"

docs/pages.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,7 @@ pages = [
1919
"Thermal Components" => "API/thermal.md",
2020
"Hydraulic Components" => "API/hydraulic.md",
2121
"Linear Analysis" => "API/linear_analysis.md",
22+
"API Reference" => "API/reference.md",
23+
"Domain API Reference" => "API/domain_reference.md",
2224
],
2325
]

docs/src/API/domain_reference.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Domain API Reference
2+
3+
```@autodocs
4+
Modules = [
5+
ModelingToolkitStandardLibrary.Mechanical.Rotational,
6+
ModelingToolkitStandardLibrary.Mechanical.Translational,
7+
ModelingToolkitStandardLibrary.Mechanical.TranslationalModelica,
8+
ModelingToolkitStandardLibrary.Mechanical.TranslationalPosition,
9+
ModelingToolkitStandardLibrary.Mechanical.MultiBody2D,
10+
ModelingToolkitStandardLibrary.Thermal,
11+
ModelingToolkitStandardLibrary.Electrical,
12+
ModelingToolkitStandardLibrary.Hydraulic.IsothermalCompressible,
13+
]
14+
Private = false
15+
```

docs/src/API/electrical.md

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ Capacitor
3232
Inductor
3333
IdealOpAmp
3434
Diode
35-
HeatingDiode
3635
VariableResistor
3736
NMOS
3837
PMOS
@@ -56,35 +55,3 @@ MultiSensor
5655
Voltage
5756
Current
5857
```
59-
60-
## Digital Gates
61-
62-
```@docs
63-
Not
64-
And
65-
Nand
66-
Or
67-
Nor
68-
Xor
69-
Xnor
70-
```
71-
72-
## Digital Components
73-
74-
```@docs
75-
HalfAdder
76-
FullAdder
77-
MUX
78-
DEMUX
79-
Encoder
80-
Decoder
81-
```
82-
83-
## Digital Sources
84-
85-
```@docs
86-
PulseDiff
87-
Set
88-
Reset
89-
Pulse
90-
```

docs/src/API/hydraulic.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# [ModelingToolkit Standard Library: Hydraulic Components](@id hydraulic)
22

3+
```@docs
4+
ModelingToolkitStandardLibrary.Hydraulic
5+
```
6+
37
```@contents
48
Pages = ["hydraulic.md"]
59
Depth = 3

docs/src/API/linear_analysis.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
The interface described here is currently experimental and at any time subject to breaking changes not respecting semantic versioning.
66

7-
Linear analysis refers to the process of linearizing a nonlinear model and analysing the resulting linear dynamical system. To facilitate linear analysis, ModelingToolkitStandardLibrary provides the concept of an [`AnalysisPoint`](@ref), which can be inserted in-between two causal blocks (such as those from the `Blocks` sub module). Once a model containing analysis points is built, several operations are available:
7+
Linear analysis refers to the process of linearizing a nonlinear model and analysing the resulting linear dynamical system. To facilitate linear analysis, ModelingToolkitStandardLibrary provides the concept of an `AnalysisPoint`, which can be inserted in-between two causal blocks (such as those from the `Blocks` sub module). Once a model containing analysis points is built, several operations are available:
88

9-
- [`get_sensitivity`](@ref) get the [sensitivity function (wiki)](https://en.wikipedia.org/wiki/Sensitivity_(control_systems)), $S(s)$, as defined in the field of control theory.
10-
- [`get_comp_sensitivity`](@ref) get the complementary sensitivity function $T(s) : S(s)+T(s)=1$.
11-
- [`get_looptransfer`](@ref) get the (open) loop-transfer function where the loop starts and ends in the analysis point. For a typical simple feedback connection with a plant $P(s)$ and a controller $C(s)$, the loop-transfer function at the plant output is $P(s)C(s)$.
12-
- [`linearize`](@ref) can be called with two analysis points denoting the input and output of the linearized system.
13-
- [`open_loop`](@ref) return a new (nonlinear) system where the loop has been broken in the analysis point, i.e., the connection the analysis point usually implies has been removed.
9+
- `get_sensitivity` gets the [sensitivity function (wiki)](https://en.wikipedia.org/wiki/Sensitivity_(control_systems)), $S(s)$, as defined in the field of control theory.
10+
- `get_comp_sensitivity` gets the complementary sensitivity function $T(s) : S(s)+T(s)=1$.
11+
- `get_looptransfer` gets the (open) loop-transfer function where the loop starts and ends in the analysis point. For a typical simple feedback connection with a plant $P$ and a controller $C$, the loop-transfer function at the plant output is $P(s)C(s)$.
12+
- `linearize` can be called with two analysis points denoting the input and output of the linearized system.
13+
- `open_loop` returns a new nonlinear system where the loop has been broken at the analysis point.
1414

15-
An analysis point can be created explicitly using the constructor [`AnalysisPoint`](@ref), or automatically when connecting two causal components using `connect`:
15+
An analysis point can be created explicitly using the `AnalysisPoint` constructor, or automatically when connecting two causal components using `connect`:
1616

1717
```julia
1818
connect(comp1.output, :analysis_point_name, comp2.input)
@@ -34,7 +34,7 @@ The directionality of an analysis point can be thought of as an arrow in a block
3434

3535
This is signified by the name being the middle argument to `connect`.
3636

37-
Of the above mentioned functions, all except for [`open_loop`](@ref) return the output of [`ModelingToolkit.linearize`](@ref), which is
37+
Of the above mentioned functions, all except for `open_loop` return the output of `ModelingToolkit.linearize`, which is
3838

3939
```julia
4040
matrices, simplified_sys = linearize(...)
@@ -148,7 +148,3 @@ Pages = ["Blocks/analysis_points.jl"]
148148
Order = [:function, :type]
149149
Private = false
150150
```
151-
152-
```@docs
153-
ModelingToolkit.linearize
154-
```

docs/src/API/mechanical.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# ModelingToolkit Standard Library: Mechanical Components
22

3+
```@docs
4+
ModelingToolkitStandardLibrary.Mechanical
5+
```
6+
37
```@contents
48
Pages = ["mechanical.md"]
59
Depth = 3

docs/src/API/reference.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# API Reference
2+
3+
```@autodocs
4+
Modules = [
5+
ModelingToolkitStandardLibrary.Blocks,
6+
]
7+
Private = false
8+
```

docs/src/connectors/connections.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
In Physical Network Acausal modeling, each physical domain must define a **connector** to combine model components. Each physical domain **connector** defines a minimum of 2 variables, one which is called a *Through* variable, and one which is called an *Across* variable. Both Modelica and SimScape define these variables in the same way:
44

55
- [Modelica Connectors](https://mbe.modelica.university/components/connectors/#acausal-connection)
6-
- [SimScape Connectors](https://www.mathworks.com/help/simscape/ug/basic-principles-of-modeling-physical-networks.html#bq89sba-6)
6+
- Simscape connector documentation
77

88
However, the standard libraries differ on the selection of the Across variable for the Mechanical Translation and Rotation libraries, Modelica choosing position and angle and SimScape choosing velocity and angular velocity, respectively for Translation and Rotation. Modelica describes their decision [here](https://mbe.modelica.university/components/connectors/simple_domains/). In summary, they would like to provide less integration in the model to avoid lossy numerical behavior, but this decision assumes the lowest order derivative is needed by the model. Numerically it is possible to define the connector either way, but there are some consequences of this decision, and therefore we will study them in detail here as they relate to ModelingToolkit.
99

0 commit comments

Comments
 (0)