diff --git a/.github/workflows/SpellCheck.yml b/.github/workflows/SpellCheck.yml new file mode 100644 index 000000000..599253c8c --- /dev/null +++ b/.github/workflows/SpellCheck.yml @@ -0,0 +1,13 @@ +name: Spell Check + +on: [pull_request] + +jobs: + typos-check: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v3 + - name: Check spelling + uses: crate-ci/typos@v1.16.23 \ No newline at end of file diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 000000000..e2b3e6f9a --- /dev/null +++ b/.typos.toml @@ -0,0 +1,2 @@ +[default.extend-words] +numer = "numer" \ No newline at end of file diff --git a/Project.toml b/Project.toml index b69f3f9e6..5fa7fadf5 100644 --- a/Project.toml +++ b/Project.toml @@ -5,7 +5,6 @@ version = "0.5.1" [deps] AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" -BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" @@ -27,8 +26,9 @@ TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f" [compat] AbstractAlgebra = "0.13, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34" -BenchmarkTools = "1" +Aqua = "0.8" Combinatorics = "1" +CPUSummary = "0.2" DataStructures = "0.18" Dates = "1.6, 1.7" Groebner = "0.4, 0.5" @@ -45,14 +45,16 @@ Random = "1.6, 1.7" SpecialFunctions = "1, 2" SymbolicUtils = "1" Symbolics = "5" +Test = "1" TestSetExtensions = "2" TimerOutputs = "0.5" julia = "1.6, 1.7" [extras] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" CPUSummary = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" TestSetExtensions = "98d24dd4-01ad-11ea-1b02-c9a08f80db04" [targets] -test = ["CPUSummary", "Test", "TestSetExtensions"] +test = ["Aqua", "CPUSummary", "Test", "TestSetExtensions"] diff --git a/README.md b/README.md index 605339a9a..0a10eb27f 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ In this example: - `y(t)` is the **output variable** which is assumed to be observed in the experiments and, thus, known; - `a01, a21, a12, b` are unknown scalar **parameters**. -Note that there may be mulitple inputs and outputs. +Note that there may be multiple inputs and outputs. ### Assessing identifiability diff --git a/benchmarking/IdentifiableFunctions/experiments.jl b/benchmarking/IdentifiableFunctions/experiments.jl index f5b3077a9..6d42a74b9 100644 --- a/benchmarking/IdentifiableFunctions/experiments.jl +++ b/benchmarking/IdentifiableFunctions/experiments.jl @@ -1116,7 +1116,7 @@ end #! format: off new_rff = StructuralIdentifiability.RationalFunctionField(funcs1) -cfs = StructuralIdentifiability.beautifuly_generators(new_rff) +cfs = StructuralIdentifiability.beautifully_generators(new_rff) gb_rff = StructuralIdentifiability.RationalFunctionField(cfs) K = GF(2^31 - 1) diff --git a/benchmarking/IdentifiableFunctions/homogenization.jl b/benchmarking/IdentifiableFunctions/homogenization.jl index 94fafc0bd..d658c2a89 100644 --- a/benchmarking/IdentifiableFunctions/homogenization.jl +++ b/benchmarking/IdentifiableFunctions/homogenization.jl @@ -15,7 +15,7 @@ Bilirubin2_io = @ODEmodel( funcs = find_identifiable_functions(Bilirubin2_io, with_states = true, strategy = (:gb,)) rff = StructuralIdentifiability.RationalFunctionField(funcs) -cfs = StructuralIdentifiability.beautifuly_generators(rff) +cfs = StructuralIdentifiability.beautifully_generators(rff) rff = StructuralIdentifiability.RationalFunctionField(cfs) K = GF(2^31 - 1) diff --git a/docs/src/tutorials/creating_ode.md b/docs/src/tutorials/creating_ode.md index ec7d039ff..f494aaf52 100644 --- a/docs/src/tutorials/creating_ode.md +++ b/docs/src/tutorials/creating_ode.md @@ -12,7 +12,7 @@ which involves - a vector $\mathbf{x}(t)$ of the state variables of the system, - - a vector $\mathbf{u}(t)$ of extermal inputs, + - a vector $\mathbf{u}(t)$ of external inputs, - a vector $\mathbf{p}$ of scalar parameters, - a vector $\mathbf{y}(t)$ of outputs (i.e., observations), - and vectors of rational functions $\mathbf{f}$ and $\mathbf{g}$ (for discussion of the non-rational case, see this [issue](https://github.com/SciML/StructuralIdentifiability.jl/issues/144)). diff --git a/src/ODE.jl b/src/ODE.jl index 625c0d21e..12622b16f 100644 --- a/src/ODE.jl +++ b/src/ODE.jl @@ -359,7 +359,7 @@ Here, - `x1`, `x2` are state variables - `y` is an output variable - `u` is an input variable -- `a`, `b`, `c` are time-indepdendent parameters +- `a`, `b`, `c` are time-independent parameters """ macro ODEmodel(ex::Expr...) diff --git a/src/RationalFunctionFields/RationalFunctionField.jl b/src/RationalFunctionFields/RationalFunctionField.jl index 9c8e68fbf..3a5df27d2 100644 --- a/src/RationalFunctionFields/RationalFunctionField.jl +++ b/src/RationalFunctionFields/RationalFunctionField.jl @@ -200,7 +200,7 @@ end # ------------------------------------------------------------------------------ """ - beautifuly_generators(rff::RationalFunctionField) + beautifully_generators(rff::RationalFunctionField) Given a field of rational functions `rff` returns a set of "simpler" and standardized generators for `rff`. @@ -209,7 +209,7 @@ Applies the following passes: 1. Filter constants, 2. Remove redundant generators. """ -@timeit _to function beautifuly_generators( +@timeit _to function beautifully_generators( rff::RationalFunctionField; discard_redundant = true, reversed_order = false, @@ -390,7 +390,7 @@ Returns a set of Groebner bases for multiple different rankings of variables. # The first basis in some ordering ord = InputOrdering() new_rff = groebner_basis_coeffs(rff, seed = seed, ordering = ord) - cfs = beautifuly_generators(new_rff) + cfs = beautifully_generators(new_rff) ordering_to_generators[ord] = cfs if isempty(cfs) return ordering_to_generators @@ -415,7 +415,7 @@ Returns a set of Groebner bases for multiple different rankings of variables. ordering = ord, up_to_degree = up_to_degree, ) - cfs = beautifuly_generators(new_rff, discard_redundant = false) + cfs = beautifully_generators(new_rff, discard_redundant = false) ordering_to_generators[ord] = cfs end end @@ -432,7 +432,7 @@ Returns a set of Groebner bases for multiple different rankings of variables. ordering = ord, up_to_degree = up_to_degree, ) - cfs = beautifuly_generators(new_rff, discard_redundant = false) + cfs = beautifully_generators(new_rff, discard_redundant = false) ordering_to_generators[ord] = cfs end end @@ -450,7 +450,7 @@ Returns a set of Groebner bases for multiple different rankings of variables. ordering = ord, up_to_degree = up_to_degree, ) - cfs = beautifuly_generators(new_rff, discard_redundant = false) + cfs = beautifully_generators(new_rff, discard_redundant = false) ordering_to_generators[ord] = cfs end end @@ -467,7 +467,7 @@ function monomial_generators_up_to_degree( ) where {T} @assert strategy in (:monte_carlo,) relations = linear_relations_between_normal_forms( - beautifuly_generators(rff), + beautifully_generators(rff), up_to_degree, seed = seed, ) @@ -532,7 +532,7 @@ Result is correct (in Monte-Carlo sense) with probability at least `p`. seed = seed, rational_interpolator = rational_interpolator, ) - new_fracs = beautifuly_generators(new_rff) + new_fracs = beautifully_generators(new_rff) if isempty(new_fracs) return new_fracs end @@ -556,7 +556,7 @@ Result is correct (in Monte-Carlo sense) with probability at least `p`. Final cleaning and simplification of generators. Out of $(length(new_fracs)) fractions $(length(new_fracs_unique)) are syntactically unique.""" runtime = - @elapsed new_fracs = beautifuly_generators(RationalFunctionField(new_fracs_unique)) + @elapsed new_fracs = beautifully_generators(RationalFunctionField(new_fracs_unique)) @debug "Checking inclusion with probability $p" runtime = @elapsed result = issubfield(rff, RationalFunctionField(new_fracs), p) _runtime_logger[:id_inclusion_check] = runtime @@ -565,7 +565,7 @@ Out of $(length(new_fracs)) fractions $(length(new_fracs_unique)) are syntactica throw("The new subfield generators are not correct.") end @info "Inclusion checked with probability $p in $(_runtime_logger[:id_inclusion_check]) seconds" - @debug "Out of $(length(rff.mqs.nums_qq)) initial generators there are $(length(new_fracs)) indepdendent" + @debug "Out of $(length(rff.mqs.nums_qq)) initial generators there are $(length(new_fracs)) independent" ranking = generating_set_rank(new_fracs) _runtime_logger[:id_ranking] = ranking @debug "The ranking of the new set of generators is $ranking" diff --git a/src/RationalFunctionFields/normalforms.jl b/src/RationalFunctionFields/normalforms.jl index 80c6329c0..ab712fb2c 100644 --- a/src/RationalFunctionFields/normalforms.jl +++ b/src/RationalFunctionFields/normalforms.jl @@ -1,5 +1,5 @@ -# Maintans a row echelon form of a set of vectors over the integrals. +# Maintains a row echelon form of a set of vectors over the integrals. # Works well when the ambient dimension is small. mutable struct TinyRowEchelonForm{T} rows::Vector{Vector{T}} diff --git a/src/discrete.jl b/src/discrete.jl index a8bf8da70..822a1764d 100644 --- a/src/discrete.jl +++ b/src/discrete.jl @@ -6,11 +6,11 @@ Input: - `param_values` - parameter values, must be a dictionary mapping parameter to a value - `initial_conditions` - initial conditions of `ode`, must be a dictionary mapping state variable to a value - `input_values` - input sequences in the form input => list of terms; length of the lists must be at least - teh required number of terms in the result + the required number of terms in the result - `num_terms` - number of terms to compute Output: -- computes a sequence solution with teh required number of terms prec presented as a dictionary state_variable => corresponding sequence +- computes a sequence solution with the required number of terms prec presented as a dictionary state_variable => corresponding sequence """ function sequence_solution( dds::ODE{P}, diff --git a/src/global_identifiability.jl b/src/global_identifiability.jl index 5f61644e0..9bdfbe25d 100644 --- a/src/global_identifiability.jl +++ b/src/global_identifiability.jl @@ -3,7 +3,7 @@ Takes as input input-output equations, the corresponding ode, a list of functions assumed to be known and a flag `with_states`. -Extracts generators of the field of identifiable functions (with or without states) withous +Extracts generators of the field of identifiable functions (with or without states) without any simplifications. Returns a tuple consisting of diff --git a/src/states.jl b/src/states.jl index c706a9ab5..370c7b56f 100644 --- a/src/states.jl +++ b/src/states.jl @@ -6,7 +6,7 @@ Input: - `vars` - list of variables The function considers `f` as `A / B`, where `A` and `B` are polynomials in `vars` with -coefficients in rational fucntion field in the remaining variables such that at least one of the +coefficients in rational function field in the remaining variables such that at least one of the coefficients is equal to one. Output: diff --git a/src/submodels.jl b/src/submodels.jl index 107ceac4e..1d86b0e6d 100644 --- a/src/submodels.jl +++ b/src/submodels.jl @@ -90,7 +90,7 @@ end # ------------------------------------------------------------------------------ -# filters the models containin all states or no states +# filters the models containing all states or no states function filter_max_empty( ode::ODE{P}, submodels::Array{Set{fmpq_mpoly}, 1}, diff --git a/src/util.jl b/src/util.jl index a55d5571c..44a92895e 100644 --- a/src/util.jl +++ b/src/util.jl @@ -373,7 +373,7 @@ Input: - `poly` - multivariate polynomial - `variables` - a list of variables from the generators of the ring of p Output: -- dictionary with keys being tuples of length `lenght(variables)` and values being polynomials in the variables other than those which are the coefficients at the corresponding monomials (in a smaller polynomial ring) +- dictionary with keys being tuples of length `length(variables)` and values being polynomials in the variables other than those which are the coefficients at the corresponding monomials (in a smaller polynomial ring) """ function extract_coefficients(poly::P, variables::Array{P, 1}) where {P <: MPolyElem} xs = gens(parent(poly)) diff --git a/test/extract_coefficients.jl b/test/extract_coefficients.jl index da3bae87f..30dc2e699 100644 --- a/test/extract_coefficients.jl +++ b/test/extract_coefficients.jl @@ -1,4 +1,4 @@ -@testset "Coefficient extraction for rational fucntions" begin +@testset "Coefficient extraction for rational functions" begin R, (x, y, z) = PolynomialRing(QQ, ["x", "y", "z"]) C = extract_coefficients_ratfunc( (x^2 + y * z - y^2 * z^3 + 3 * x * z^3) // (x + y + z + z^2 * (x^2 + 1)), diff --git a/test/ode_ps_solution.jl b/test/ode_ps_solution.jl index 177bec543..9e728b428 100644 --- a/test/ode_ps_solution.jl +++ b/test/ode_ps_solution.jl @@ -76,7 +76,7 @@ end end end - # Testing ps_ode_solution in conjuntion with the ODE class + # Testing ps_ode_solution in conjunction with the ODE class for i in 1:30 # Setting up the ring NUMX = 3 @@ -91,7 +91,7 @@ end PType = gfp_mpoly TDict = Dict{PType, Union{PType, Generic.Frac{PType}}} - # Generating the intial conditions etc + # Generating the initial conditions etc ic = Dict(vars[i] => F(rand(-5:5)) for i in 1:NUMX) param_vals = Dict(vars[i + NUMX] => F(rand(-5:5)) for i in 1:NUMP) inputs = diff --git a/test/qa.jl b/test/qa.jl new file mode 100644 index 000000000..f4dde7d0a --- /dev/null +++ b/test/qa.jl @@ -0,0 +1,12 @@ +using StructuralIdentifiability, Aqua +@testset "Aqua" begin + Aqua.find_persistent_tasks_deps(StructuralIdentifiability) + Aqua.test_ambiguities(StructuralIdentifiability, recursive = false) + Aqua.test_deps_compat(StructuralIdentifiability) + Aqua.test_piracies(StructuralIdentifiability, + treat_as_own = []) + Aqua.test_project_extras(StructuralIdentifiability) + Aqua.test_stale_deps(StructuralIdentifiability) + Aqua.test_unbound_args(StructuralIdentifiability) + Aqua.test_undefined_exports(StructuralIdentifiability) +end diff --git a/test/runtests.jl b/test/runtests.jl index 82e6b0dd7..516a69a1b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -79,8 +79,7 @@ end @info "Testing started" -@test isempty(Test.detect_ambiguities(StructuralIdentifiability)) -@test isempty(Test.detect_unbound_args(StructuralIdentifiability)) +@time @testset "Quality Assurance" include("qa.jl") @time @testset "All the tests" verbose = true begin @includetests ARGS