Skip to content

Commit abc9d7f

Browse files
Merge branch 'SciML:main' into ag/planar-mechanics
2 parents 7051dbe + f46cdc0 commit abc9d7f

File tree

17 files changed

+58
-15
lines changed

17 files changed

+58
-15
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ updates:
55
directory: "/" # Location of package manifests
66
schedule:
77
interval: "weekly"
8+
ignore:
9+
- dependency-name: "crate-ci/typos"
10+
update-types: ["version-update:semver-patch"]

.github/workflows/SpellCheck.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Spell Check
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
typos-check:
7+
name: Spell Check with Typos
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout Actions Repository
11+
uses: actions/checkout@v4
12+
- name: Check spelling
13+
uses: crate-ci/typos@v1.16.23

.typos.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[default.extend-words]
2+
Nd = "Nd"
3+
nin = "nin"
4+
coul = "coul"

Project.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,22 @@ ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
1212
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
1313

1414
[compat]
15+
Aqua = "0.8"
1516
ChainRulesCore = "1"
17+
ControlSystemsBase = "1"
18+
DataInterpolations = "4"
1619
DiffEqBase = "6"
1720
IfElse = "0.1"
21+
LinearAlgebra = "1"
1822
ModelingToolkit = "8.67"
23+
OrdinaryDiffEq = "6"
24+
SafeTestsets = "0.1"
1925
Symbolics = "4.9, 5"
26+
Test = "1"
2027
julia = "1.6"
2128

2229
[extras]
30+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
2331
ControlSystemsBase = "aaaaaaaa-a6ca-5380-bf3e-84a91bcd477e"
2432
DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0"
2533
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
@@ -28,4 +36,4 @@ SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
2836
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2937

3038
[targets]
31-
test = ["LinearAlgebra", "OrdinaryDiffEq", "SafeTestsets", "Test", "ControlSystemsBase", "DataInterpolations"]
39+
test = ["Aqua", "LinearAlgebra", "OrdinaryDiffEq", "SafeTestsets", "Test", "ControlSystemsBase", "DataInterpolations"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ the documentation, which contains the unreleased features.
3232

3333
## Libraries
3434

35-
The following are the constituant libraries of the ModelingToolkit Standard Library.
35+
The following are the constituent libraries of the ModelingToolkit Standard Library.
3636

3737
- [Basic Blocks](https://docs.sciml.ai/ModelingToolkitStandardLibrary/stable/API/blocks/)
3838
- [Mechanical Components](https://docs.sciml.ai/ModelingToolkitStandardLibrary/stable/API/mechanical/)

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Pkg.add("ModelingToolkitStandardLibrary")
2121

2222
## Libraries
2323

24-
The following are the constituant libraries of the ModelingToolkit Standard Library.
24+
The following are the constituent libraries of the ModelingToolkit Standard Library.
2525

2626
- [Basic Blocks](https://docs.sciml.ai/ModelingToolkitStandardLibrary/stable/API/blocks/)
2727
- [Mechanical Components](https://docs.sciml.ai/ModelingToolkitStandardLibrary/stable/API/mechanical/)

docs/src/tutorials/input_component.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ prob = ODEProblem(sys, [], (0, time[end]))
4747
sol = solve(prob, ImplicitEuler())
4848
```
4949

50-
If we want to run a new data set, this requires building a new `LinearInterpolation` and `ODESystem` followed by running `structural_simplify`, all of which takes time. Therefore, to run serveral pieces of data it's better to re-use an `ODESystem`. The next couple methods will demonstrate how to do this.
50+
If we want to run a new data set, this requires building a new `LinearInterpolation` and `ODESystem` followed by running `structural_simplify`, all of which takes time. Therefore, to run several pieces of data it's better to re-use an `ODESystem`. The next couple methods will demonstrate how to do this.
5151

5252
## Custom Component with External Data
5353

@@ -105,7 +105,7 @@ Additional code could be added to resolve this issue, for example by using a `Re
105105

106106
## `SampledData` Component
107107

108-
To resolve the issues presented above, the `ModelingToolkitStandardLibrary.Blocks.SampledData` component can be used which allows for a resusable `ODESystem` and self contained data which ensures a solution which remains valid for it's lifetime. Now it's possible to also parallize the call to `solve()`.
108+
To resolve the issues presented above, the `ModelingToolkitStandardLibrary.Blocks.SampledData` component can be used which allows for a resusable `ODESystem` and self contained data which ensures a solution which remains valid for it's lifetime. Now it's possible to also parallelize the call to `solve()`.
109109

110110
```julia
111111
function System(; name)
@@ -146,4 +146,4 @@ sol2 = Ref{ODESolution}()
146146
end
147147
```
148148

149-
Note, in the above example, we can build the system with an empty `SampledData` component, only setting the expected data type: `@named src = SampledData(Float64)`. It's also possible to initialize the component with real sampled data: `@named src = SampledData(data, dt)`. Additionally note that before running an `ODEProblem` using the `SampledData` component, one must be careful about the parameter vector Type. The `SampledData` component contains a `buffer` parameter of type `Parameter`, therefore we must generate the problem using `tofloat=false`. This will initially give a parameter vector of type `Vector{Any}` with a mix of numbers and `Parameter` type. We can convert the vector to a uniform `Parameter` type by running `p = Parameter.(p)`. This will wrap all the single values in a `Parameter` which will be mathmatically equivalent to a `Number`.
149+
Note, in the above example, we can build the system with an empty `SampledData` component, only setting the expected data type: `@named src = SampledData(Float64)`. It's also possible to initialize the component with real sampled data: `@named src = SampledData(data, dt)`. Additionally note that before running an `ODEProblem` using the `SampledData` component, one must be careful about the parameter vector Type. The `SampledData` component contains a `buffer` parameter of type `Parameter`, therefore we must generate the problem using `tofloat=false`. This will initially give a parameter vector of type `Vector{Any}` with a mix of numbers and `Parameter` type. We can convert the vector to a uniform `Parameter` type by running `p = Parameter.(p)`. This will wrap all the single values in a `Parameter` which will be mathematically equivalent to a `Number`.

src/Blocks/analysis_points.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ eqs = [connect(P.output, C.input)
5252
connect(C.output, :plant_input, P.input)]
5353
sys = ODESystem(eqs, t, systems = [P, C], name = :feedback_system)
5454
55-
matrices_S, _ = get_sensitivity(sys, :plant_input) # Compute the matrices of a state-space representation of the (input) sensitivity funciton.
55+
matrices_S, _ = get_sensitivity(sys, :plant_input) # Compute the matrices of a state-space representation of the (input) sensitivity function.
5656
matrices_T, _ = get_comp_sensitivity(sys, :plant_input)
5757
```
5858

src/Blocks/continuous.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ To set the initial state, it's recommended to set the initial condition for `x`,
572572
573573
# Parameters:
574574
- `b`: Numerator polynomial coefficients, e.g., `2s + 3` is specified as `[2, 3]`
575-
- `a`: Denomenator polynomial coefficients, e.g., `s² + 2ωs + ω^2` is specified as `[1, 2ω, ω^2]`
575+
- `a`: Denominator polynomial coefficients, e.g., `s² + 2ωs + ω^2` is specified as `[1, 2ω, ω^2]`
576576
577577
# Connectors:
578578
- `input`

src/Electrical/Digital/logic.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
@enum Logic Uninitialized=1 ForcingUnknown ForcingZero ForcingOne HighImpedence WeakUnknown WeakZero WeakOne DontCare
1+
@enum Logic Uninitialized=1 ForcingUnknown ForcingZero ForcingOne HighImpedance WeakUnknown WeakZero WeakOne DontCare
22

33
const U = Uninitialized
44
const X = ForcingUnknown
55
const F0 = ForcingZero
66
const F1 = ForcingOne
7-
const Z = HighImpedence
7+
const Z = HighImpedance
88
const W = WeakUnknown
99
const L = WeakZero
1010
const H = WeakOne

src/Hydraulic/IsothermalCompressible/components.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ dm ────► │ │ area
497497
name)
498498
@assert(N>=0,
499499
"the Tube component must be defined with 0 or more segments (i.e. N>=0), found N=$N")
500-
@assert (direction == +1)||(direction == -1) "direction arument must be +/-1, found $direction"
500+
@assert (direction == +1)||(direction == -1) "direction argument must be +/-1, found $direction"
501501

502502
#TODO: How to set an assert effective_length >= length ??
503503
pars = @parameters begin

src/ModelingToolkitStandardLibrary.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Omits the check expression if the argument `J` is symbolic.
88
"""
99
macro symcheck(ex)
1010
ex.args[1].head === :call ||
11-
error("Expected an expresion on the form sym > val || error()")
11+
error("Expected an expression on the form sym > val || error()")
1212
sym = ex.args[1].args[2]
1313
quote
1414
_issymbolic(x) = !(unwrap(x) isa Real)

test/Blocks/continuous.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ using Test
77

88
#=
99
Testing strategy:
10-
The general strategy is to test systems using simple intputs where the solution
10+
The general strategy is to test systems using simple inputs where the solution
1111
is known on closed form. For algebraic systems (without differential variables),
1212
an integrator with a constant input is often used together with the system under test.
1313
=#

test/Blocks/test_analysis_points.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ lsys = sminreal(ss(matrices...))
143143

144144
matrices_So, _ = get_sensitivity(sys_outer, :inner_plant_output)
145145
lsyso = sminreal(ss(matrices_So...))
146-
@test lsys == lsyso || lsys == -1 * lsyso * (-1) # Output and input sensitivites are equal for SISO systems
146+
@test lsys == lsyso || lsys == -1 * lsyso * (-1) # Output and input sensitivities are equal for SISO systems
147147

148148
## A more complicated test case
149149
using ModelingToolkit, OrdinaryDiffEq, LinearAlgebra

test/Electrical/digital.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ using OrdinaryDiffEq: ReturnCode.Success
3232
@test typeof(logic.logic) == Vector{Logic}
3333
@test get_logic_level(logic) == [1, 6, 2, 4]
3434

35-
# Predefiend logic vectors
35+
# Predefined logic vectors
3636
@test std_ulogic.logic == [U, X, F0, F1, Z, W, L, H, DC]
3737
@test UX01.logic == [U, X, F0, F1]
3838
@test UX01Z.logic == [U, X, F0, F1, Z]

test/qa.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using ModelingToolkitStandardLibrary, Aqua
2+
@testset "Aqua" begin
3+
Aqua.find_persistent_tasks_deps(ModelingToolkitStandardLibrary)
4+
Aqua.test_ambiguities(ModelingToolkitStandardLibrary, recursive = false)
5+
Aqua.test_deps_compat(ModelingToolkitStandardLibrary)
6+
Aqua.test_piracies(ModelingToolkitStandardLibrary)
7+
Aqua.test_project_extras(ModelingToolkitStandardLibrary)
8+
Aqua.test_stale_deps(ModelingToolkitStandardLibrary)
9+
Aqua.test_unbound_args(ModelingToolkitStandardLibrary)
10+
Aqua.test_undefined_exports(ModelingToolkitStandardLibrary)
11+
end

test/runtests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
using SafeTestsets
22

3+
@safetestset "Quality Assurance" begin
4+
include("qa.jl")
5+
end
6+
37
# Blocks
48
@safetestset "Blocks: math" begin
59
include("Blocks/math.jl")

0 commit comments

Comments
 (0)