Skip to content

Commit 5570a78

Browse files
committed
typos
1 parent 01aa166 commit 5570a78

20 files changed

+33
-33
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
- This repository follows the [SciMLStyle](https://github.com/SciML/SciMLStyle) and the SciML [ColPrac](https://github.com/SciML/ColPrac).
2-
- Please run `using JuliaFormatter, ModelingToolkit; format(joinpath(dirname(pathof(ModelingToolkit)), ".."))` before commiting.
2+
- Please run `using JuliaFormatter, ModelingToolkit; format(joinpath(dirname(pathof(ModelingToolkit)), ".."))` before committing.
33
- Add tests for any new features.

docs/src/basics/FAQ.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ We can solve this problem by using the `missing_variable_defaults()` function
120120
prob = ODEProblem(sys, ModelingToolkit.missing_variable_defaults(sys), (0,1))
121121
```
122122

123-
This function provides 0 for the default values, which is a safe assumption for dummy derivatives of most models. However, the 2nd arument allows for a different default value or values to be used if needed.
123+
This function provides 0 for the default values, which is a safe assumption for dummy derivatives of most models. However, the 2nd argument allows for a different default value or values to be used if needed.
124124

125125
```
126126
julia> ModelingToolkit.missing_variable_defaults(sys, [1,2,3])

src/ModelingToolkit.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ abstract type AbstractOptimizationSystem <: AbstractTimeIndependentSystem end
106106

107107
function independent_variable end
108108

109-
# this has to be included early to deal with depency issues
109+
# this has to be included early to deal with dependency issues
110110
include("structural_transformation/bareiss.jl")
111111
function complete end
112112
function var_derivative! end

src/bipartite_graph.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ Essentially the graph adapter performs two largely orthogonal functions
618618
1. It pairs an undirected bipartite graph with a matching of the destination vertex.
619619
620620
This matching is used to induce an orientation on the otherwise undirected graph:
621-
Matched edges pass from destination to source [source to desination], all other edges
621+
Matched edges pass from destination to source [source to destination], all other edges
622622
pass in the opposite direction.
623623
624624
2. It exposes the graph view obtained by contracting the destination [source] vertices
@@ -632,7 +632,7 @@ graph is acyclic.
632632
# Hypergraph interpretation
633633
634634
Consider the bipartite graph `B` as the incidence graph of some hypergraph `H`.
635-
Note that a maching `M` on `B` in the above sense is equivalent to determining
635+
Note that a matching `M` on `B` in the above sense is equivalent to determining
636636
an (1,n)-orientation on the hypergraph (i.e. each directed hyperedge has exactly
637637
one head, but any arbitrary number of tails). In this setting, this is simply
638638
the graph formed by expanding each directed hyperedge into `n` ordinary edges
@@ -685,7 +685,7 @@ function Base.iterate(c::CMONeighbors{false}, (l, state...))
685685
r === nothing && return nothing
686686
# If this is a matched edge, skip it, it's reversed in the induced
687687
# directed graph. Otherwise, if there is no matching for this destination
688-
# edge, also skip it, since it got delted in the contraction.
688+
# edge, also skip it, since it got deleted in the contraction.
689689
vsrc = c.g.matching[r[1]]
690690
if vsrc === c.v || !isa(vsrc, Int)
691691
state = (r[2],)

src/inputoutput.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ end
112112
same_or_inner_namespace(u, var)
113113
114114
Determine whether `var` is in the same namespace as `u`, or a namespace internal to the namespace of `u`.
115-
Example: `sys.u ~ sys.inner.u` will bind `sys.inner.u`, but `sys.u` remains an unbound, external signal. The namepsaced signal `sys.inner.u` lives in a namspace internal to `sys`.
115+
Example: `sys.u ~ sys.inner.u` will bind `sys.inner.u`, but `sys.u` remains an unbound, external signal. The namespaced signal `sys.inner.u` lives in a namespace internal to `sys`.
116116
"""
117117
function same_or_inner_namespace(u, var)
118118
nu = get_namespace(u)
119119
nv = get_namespace(var)
120120
nu == nv || # namespaces are the same
121-
startswith(nv, nu) || # or nv starts with nu, i.e., nv is an inner namepsace to nu
121+
startswith(nv, nu) || # or nv starts with nu, i.e., nv is an inner namespace to nu
122122
occursin('', string(getname(var))) &&
123123
!occursin('', string(getname(u))) # or u is top level but var is internal
124124
end
@@ -127,7 +127,7 @@ function inner_namespace(u, var)
127127
nu = get_namespace(u)
128128
nv = get_namespace(var)
129129
nu == nv && return false
130-
startswith(nv, nu) || # or nv starts with nu, i.e., nv is an inner namepsace to nu
130+
startswith(nv, nu) || # or nv starts with nu, i.e., nv is an inner namespace to nu
131131
occursin('', string(getname(var))) &&
132132
!occursin('', string(getname(u))) # or u is top level but var is internal
133133
end
@@ -177,7 +177,7 @@ f_ip : (xout,x,u,p,t) -> nothing
177177
178178
The return values also include the remaining states and parameters, in the order they appear as arguments to `f`.
179179
180-
If `disturbance_inputs` is an array of variables, the generated dynamics function will preserve any state and dynamics associated with distrubance inputs, but the distrubance inputs themselves will not be included as inputs to the generated function. The use case for this is to generate dynamics for state observers that estimate the influence of unmeasured disturbances, and thus require state variables for the disturbance model, but without disturbance inputs since the disturbances are not available for measurement.
180+
If `disturbance_inputs` is an array of variables, the generated dynamics function will preserve any state and dynamics associated with disturbance inputs, but the disturbance inputs themselves will not be included as inputs to the generated function. The use case for this is to generate dynamics for state observers that estimate the influence of unmeasured disturbances, and thus require state variables for the disturbance model, but without disturbance inputs since the disturbances are not available for measurement.
181181
See [`add_input_disturbance`](@ref) for a higher-level interface to this functionality.
182182
183183
# Example

src/structural_transformation/bareiss.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ else
3434
function Base.swapcols!(A::AbstractSparseMatrixCSC, i, j)
3535
i == j && return
3636

37-
# For simplicitly, let i denote the smaller of the two columns
37+
# For simplicity, let i denote the smaller of the two columns
3838
j < i && @swap(i, j)
3939

4040
colptr = getcolptr(A)
@@ -72,7 +72,7 @@ else
7272
return nothing
7373
end
7474
function swaprows!(A::AbstractSparseMatrixCSC, i, j)
75-
# For simplicitly, let i denote the smaller of the two rows
75+
# For simplicity, let i denote the smaller of the two rows
7676
j < i && @swap(i, j)
7777

7878
rows = rowvals(A)
@@ -184,7 +184,7 @@ const bareiss_virtcolswap = ((M, i, j) -> nothing, swaprows!,
184184
Perform Bareiss's fraction-free row-reduction algorithm on the matrix `M`.
185185
Optionally, a specific pivoting method may be specified.
186186
187-
swap_strategy is an optional argument that determines how the swapping of rows and coulmns is performed.
187+
swap_strategy is an optional argument that determines how the swapping of rows and columns is performed.
188188
bareiss_colswap (the default) swaps the columns and rows normally.
189189
bareiss_virtcolswap pretends to swap the columns which can be faster for sparse matrices.
190190
"""

src/structural_transformation/partial_state_selection.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ function dummy_derivative_graph!(structure::SystemStructure, var_eq_matching, ja
209209
J = nothing
210210
else
211211
_J = jac(eqs, vars)
212-
# only accecpt small intergers to avoid overflow
212+
# only accept small integers to avoid overflow
213213
is_all_small_int = all(_J) do x′
214214
x = unwrap(x′)
215215
x isa Number || return false

src/structural_transformation/symbolics_tearing.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function full_equations(sys::AbstractSystem; simplify = false)
103103
if rhs isa Symbolic
104104
return 0 ~ rhs
105105
else # a number
106-
error("tearing failled because the system is singular")
106+
error("tearing failed because the system is singular")
107107
end
108108
end
109109
eq
@@ -194,7 +194,7 @@ function to_mass_matrix_form(neweqs, ieq, graph, fullvars, isdervar::F,
194194
return (new_lhs ~ new_rhs), invview(var_to_diff)[dervar]
195195
else # a number
196196
if abs(rhs) > 100eps(float(rhs))
197-
@warn "The equation $eq is not consistent. It simplifed to 0 == $rhs."
197+
@warn "The equation $eq is not consistent. It simplified to 0 == $rhs."
198198
end
199199
return nothing
200200
end

src/systems/alias_elimination.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ count_nonzeros(a::CLILVector) = nnz(a)
200200

201201
# Linear variables are highest order differentiated variables that only appear
202202
# in linear equations with only linear variables. Also, if a variable's any
203-
# derivaitves is nonlinear, then all of them are not linear variables.
203+
# derivatives is nonlinear, then all of them are not linear variables.
204204
function find_linear_variables(graph, linear_equations, var_to_diff, irreducibles)
205205
stack = Int[]
206206
linear_variables = falses(length(var_to_diff))
@@ -273,7 +273,7 @@ function aag_bareiss!(structure, mm_orig::SparseMatrixCLIL{T, Ti}) where {T, Ti}
273273
# linear algebraic equations can be set to 0.
274274
#
275275
# For all the other variables, we can update the original system with
276-
# Bareiss'ed coefficients as Gaussian elimination is nullspace perserving
276+
# Bareiss'ed coefficients as Gaussian elimination is nullspace preserving
277277
# and we are only working on linear homogeneous subsystem.
278278

279279
is_algebraic = let var_to_diff = var_to_diff

src/systems/diffeqs/modelingtoolkitize.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function modelingtoolkitize(prob::DiffEqBase.ODEProblem; kwargs...)
3737
elseif v in var_set
3838
D(v)
3939
else
40-
error("Non-permuation mass matrix is not supported.")
40+
error("Non-permutation mass matrix is not supported.")
4141
end
4242
end
4343
end

src/systems/diffeqs/odesystem.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ of
492492
[cumulative_var1 => x + y, cumulative_var2 => x^2]
493493
```
494494
Then, cumulative variables `cumulative_var1` and `cumulative_var2` that computes
495-
the comulative `x + y` and `x^2` would be added to `sys`.
495+
the cumulative `x + y` and `x^2` would be added to `sys`.
496496
"""
497497
function add_accumulations(sys::ODESystem, vars::Vector{<:Pair})
498498
eqs = get_eqs(sys)

src/systems/diffeqs/sdesystem.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ end
227227
"""
228228
$(TYPEDSIGNATURES)
229229
230-
Choose correction_factor=-1//2 (1//2) to converte Ito -> Stratonovich (Stratonovich->Ito).
230+
Choose correction_factor=-1//2 (1//2) to convert Ito -> Stratonovich (Stratonovich->Ito).
231231
"""
232232
function stochastic_integral_transform(sys::SDESystem, correction_factor)
233233
name = nameof(sys)
@@ -329,7 +329,7 @@ simmod = solve(ensemble_probmod,EM(),dt=dt,trajectories=numtraj)
329329
function Girsanov_transform(sys::SDESystem, u; θ0 = 1.0)
330330
name = nameof(sys)
331331

332-
# register new varible θ corresponding to 1D correction process θ(t)
332+
# register new variable θ corresponding to 1D correction process θ(t)
333333
t = get_iv(sys)
334334
D = Differential(t)
335335
@variables θ(t), weight(t)

src/systems/jumps/jumpsystem.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const JumpType = Union{VariableRateJump, ConstantRateJump, MassActionJump}
22

3-
# modifies the expression representating an affect function to
3+
# modifies the expression representing an affect function to
44
# call reset_aggregated_jumps!(integrator).
55
# assumes iip
66
function _reset_aggregator!(expr, integrator)
@@ -391,7 +391,7 @@ function JumpProcesses.JumpProblem(js::JumpSystem, prob, aggregator; callback =
391391
eqs = equations(js)
392392
invttype = prob.tspan[1] === nothing ? Float64 : typeof(1 / prob.tspan[2])
393393

394-
# handling parameter substition and empty param vecs
394+
# handling parameter substitution and empty param vecs
395395
p = (prob.p isa DiffEqBase.NullParameters || prob.p === nothing) ? Num[] : prob.p
396396

397397
majpmapper = JumpSysMajParamMapper(js, p; jseqs = eqs, rateconsttype = invttype)

src/systems/model_parsing.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ end
301301

302302
function component_args!(a, b, expr, kwargs)
303303
# Whenever `b` is a function call, skip the first arg aka the function name.
304-
# Whenver it is a kwargs list, include it.
304+
# Whenever it is a kwargs list, include it.
305305
start = b.head == :call ? 2 : 1
306306
for i in start:lastindex(b.args)
307307
arg = b.args[i]

src/systems/sparsematrixclil.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ function bareiss_update_virtual_colswap_mtk!(zero!, M::SparseMatrixCLIL, k, swap
170170
pivot_equal = pivot_equal_optimization && abs(pivot) == abs(last_pivot)
171171

172172
for ei in (k + 1):size(M, 1)
173-
# elimate `v`
173+
# eliminate `v`
174174
coeff = 0
175175
ivars = eadj[ei]
176176
vj = findfirst(isequal(vpivot), ivars)

src/variables.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ setoutput(x, v) = setmetadata(x, VariableOutput, v)
3333
setio(x, i, o) = setoutput(setinput(x, i), o)
3434
isinput(x) = isvarkind(VariableInput, x)
3535
isoutput(x) = isvarkind(VariableOutput, x)
36-
# Before the solvability check, we already have handled IO varibales, so
36+
# Before the solvability check, we already have handled IO variables, so
3737
# irreducibility is independent from IO.
3838
isirreducible(x) = isvarkind(VariableIrreducible, x)
3939
state_priority(x) = convert(Float64, getmetadata(x, VariableStatePriority, 0.0))::Float64

test/clock.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ By inference:
5454
=#
5555

5656
#=
57-
D(x) ~ Shift(x, 0, dt) + 1 # this should never meet with continous variables
57+
D(x) ~ Shift(x, 0, dt) + 1 # this should never meet with continuous variables
5858
=> (Shift(x, 0, dt) - Shift(x, -1, dt))/dt ~ Shift(x, 0, dt) + 1
5959
=> Shift(x, 0, dt) - Shift(x, -1, dt) ~ Shift(x, 0, dt) * dt + dt
6060
=> Shift(x, 0, dt) - Shift(x, 0, dt) * dt ~ Shift(x, -1, dt) + dt

test/lowering_solving.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ eqs2 = [0 ~ x * y - k,
1717
D(z) ~ x * y - β * z]
1818
@named sys2 = ODESystem(eqs2, t, [x, y, z, k], parameters(sys′))
1919
sys2 = ode_order_lowering(sys2)
20-
# test equation/varible ordering
20+
# test equation/variable ordering
2121
ModelingToolkit.calculate_massmatrix(sys2) == Diagonal([1, 1, 1, 1, 0])
2222

2323
u0 = [D(x) => 2.0,

test/runtests.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ using SafeTestsets, Test
3131
@safetestset "StructuralTransformations" include("structural_transformation/runtests.jl")
3232
@safetestset "State Selection Test" include("state_selection.jl")
3333
@safetestset "Symbolic Event Test" include("symbolic_events.jl")
34-
@safetestset "Stream Connnect Test" include("stream_connectors.jl")
34+
@safetestset "Stream Connect Test" include("stream_connectors.jl")
3535
@safetestset "Lowering Integration Test" include("lowering_solving.jl")
3636
@safetestset "Test Big System Usage" include("bigsystem.jl")
37-
@safetestset "Depdendency Graph Test" include("dep_graphs.jl")
37+
@safetestset "Dependency Graph Test" include("dep_graphs.jl")
3838
@safetestset "Function Registration Test" include("function_registration.jl")
3939
@safetestset "Precompiled Modules Test" include("precompile_test.jl")
4040
@testset "Distributed Test" begin

test/structural_transformation/bareiss.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ end
1818
@testset "bareiss tests" begin
1919
# copy gives a dense matrix
2020
@testset "bareiss tests: $T" for T in (copy, sparse)
21-
# matrix determinent pairs
21+
# matrix determinant pairs
2222
for (M, d) in ((BigInt[9 1 8 0; 0 0 8 7; 7 6 8 3; 2 9 7 7], -1),
2323
(BigInt[1 big(2)^65+1; 3 4], 4 - 3 * (big(2)^65 + 1)))
24-
# test that the determinent was correctly computed
24+
# test that the determinant was correctly computed
2525
@test det_bareiss!(T(M)) == d
2626
end
2727
end

0 commit comments

Comments
 (0)