Skip to content

Commit

Permalink
Merge pull request #119 from ArnoStrouwen/qa
Browse files Browse the repository at this point in the history
Aqua + typos CI
  • Loading branch information
ChrisRackauckas committed Dec 2, 2023
2 parents 02c8016 + 8ed8219 commit c2a3368
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 14 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/SpellCheck.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[default.extend-words]
Nd = "Nd"
Numer = "Numer"
14 changes: 12 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,28 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
AdaptiveRejectionSampling = "0.1"
Aqua = "0.8"
Combinatorics = "1.0"
Distributions = "0.23, 0.24, 0.25"
FFTW = "1.2"
GaussQuadrature = "0.5"
LinearAlgebra = "1"
SparseArrays = "1"
Test = "1"
QuadGK = "2.4"
SpecialFunctions = "0.10, 1.0, 2"
StaticArrays = "0.12, 1.0"
Statistics = "1"
julia = "1.6"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Aqua", "StaticArrays", "Test"]
2 changes: 1 addition & 1 deletion docs/src/TypeHierarchy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"meas::Measure\n",
"```\n",
"The purpose of `name` is obvious.\n",
"The integer `deg` stands for the maxium degree of the polynomials.\n",
"The integer `deg` stands for the maximum degree of the polynomials.\n",
"Rather than storing the polynomials $\\phi_i$ themselves we store the recurrence coefficients `α`, `β` that characterize the system of orthogonal polynomials.\n",
"These recurrence coefficients are the single most important piece of information for the orthogonal polynomials.\n",
"For several common measures, there exist analytic formulae.\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/src/TypeHierarchy_new.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"\n",
"\n",
"The purpose of `name` is obvious.\n",
"The integer `deg` stands for the maxium degree of the polynomials.\n",
"The integer `deg` stands for the maximum degree of the polynomials.\n",
"Rather than storing the polynomials $\\phi_i$ themselves we store the recurrence coefficients `α`, `β` that characterize the system of orthogonal polynomials.\n",
"These recurrence coefficients are the single most important piece of information for the orthogonal polynomials.\n",
"For several common measures, there exist analytic formulae.\n",
Expand Down Expand Up @@ -155,7 +155,7 @@
"| `w_uni::Vector{Function}` | Weight functions of underlying univariate measures |\n",
"| `dom::Vector{Tuple{Float64,Float64}}` | Domain |\n",
"| `symmetric::Vector{Bool}` | Symmetry properties |\n",
"| `pars::Vector{Dict}` | Additioanl parameters |\n",
"| `pars::Vector{Dict}` | Additional parameters |\n",
"\n",
"All fields from `Measure` appear in vectorized versions (except for the weight $w$, which is the weight of the product measure)\n",
"The only *new* field is `w_uni`, which stacks the univariate weight functions.\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/chi_squared_k1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"Let's plot the probability density function to compare results.\n",
"We first draw samples from the measure with the help of `sampleMeasure()`, and then evaluate the basis at these samples and multiply times the PCE coefficients.\n",
"The latter stop is done using `evaluatePCE()`.\n",
"Finally, we compare the result agains the analytical PDF $\\rho(t) = \\frac{\\mathrm{e}^{-0.5t}}{\\sqrt{2 t} \\, \\Gamma(0.5)}$ of the chi-squared distribution with one degree of freedom."
"Finally, we compare the result against the analytical PDF $\\rho(t) = \\frac{\\mathrm{e}^{-0.5t}}{\\sqrt{2 t} \\, \\Gamma(0.5)}$ of the chi-squared distribution with one degree of freedom."
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/chi_squared_k_greater1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
"We first draw samples from the measure with the help of `sampleMeasure()`, and then evaluate the basis at these samples and multiply times the PCE coefficients.\n",
"The latter stop is done using `evaluatePCE()`.\n",
"Both steps are combined in the function `samplePCE()`.\n",
"Finally, we compare the result agains the analytical PDF $\\rho(t) = \\frac{t^{t/2-1}\\mathrm{e}^{-t/2}}{2^{k/2} \\, \\Gamma(k/2)}$ of the chi-squared distribution with one degree of freedom."
"Finally, we compare the result against the analytical PDF $\\rho(t) = \\frac{t^{t/2-1}\\mathrm{e}^{-t/2}}{2^{k/2} \\, \\Gamma(k/2)}$ of the chi-squared distribution with one degree of freedom."
]
},
{
Expand Down
12 changes: 6 additions & 6 deletions src/polynomial_chaos.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function _createMethodVector(mop::MultiOrthoPoly, word::String = "adaptivereject
_createMethodVector(mop.measure, word)
end

function _checkStandardDevation::Real)
function _checkStandardDeviation::Real)
σ < 0 && throw(DomainError(σ, "σ has to be non-negative"))
σ < 1e-4 && @warn "σ is close to zero (σ = )"
end
Expand Down Expand Up @@ -79,7 +79,7 @@ function convert2affinePCE(a1::Real, a2::Real, α0::Real)
end

function convert2affinePCE(mu::Real, sigma::Real, op::GaussOrthoPoly)
_checkStandardDevation(sigma)
_checkStandardDeviation(sigma)
convert2affinePCE(mu, sigma, first(op.α))
end

Expand All @@ -90,7 +90,7 @@ function convert2affinePCE(par1::Real, par2::Real, op::Uniform01OrthoPoly;
_checkBounds(par1, par2)
par1, par2 - par1
elseif kind == "μσ"
_checkStandardDevation(par2)
_checkStandardDeviation(par2)
par1 - sqrt(3) * par2, 2 * sqrt(3) * par2
end
convert2affinePCE(a1, a2, first(op.α))
Expand All @@ -103,7 +103,7 @@ function convert2affinePCE(par1::Real, par2::Real, op::Uniform_11OrthoPoly;
_checkBounds(par1, par2)
0.5 * (par1 + par2), 0.5 * (par2 - par1)
elseif kind == "μσ"
_checkStandardDevation(par2)
_checkStandardDeviation(par2)
par1, sqrt(3) * par2
end
convert2affinePCE(a1, a2, first(op.α))
Expand All @@ -116,7 +116,7 @@ function convert2affinePCE(p1::Real, p2::Real, op::Beta01OrthoPoly; kind::String
_checkBounds(p1, p2)
a1, a2 = p1, p2 - p1
elseif kind == "μσ"
_checkStandardDevation(p2)
_checkStandardDeviation(p2)
a1, a2 = p1 - sqrt/ β) * sqrt(1 + α + β) * p2,
+ β) * sqrt((α + β + 1) /* β)) * p2
end
Expand All @@ -128,7 +128,7 @@ function convert2affinePCE(p1::Real, p2::Real, op::GammaOrthoPoly)
end

function convert2affinePCE(p1::Real, p2::Real, op::LogisticOrthoPoly)
_checkStandardDevation(p2)
_checkStandardDeviation(p2)
convert2affinePCE(p1, p2, first(op.α))
end

Expand Down
2 changes: 1 addition & 1 deletion test/auxfuns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ op = genLaguerreOrthoPoly(d, 1.23, addQuadrature = false)
opq = genLaguerreOrthoPoly(d, 1.23)
mop = MultiOrthoPoly([op for i in 1:nunc], d)
mopq = MultiOrthoPoly([opq for i in 1:nunc], d)
@testset "dimenions" begin
@testset "dimensions" begin
@test isequal(PolyChaos.dim(op), d + 1)
@test isequal(PolyChaos.dim(opq), d + 1)
@test isequal(PolyChaos.dim(mop),
Expand Down
10 changes: 10 additions & 0 deletions test/qa.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using PolyChaos, Aqua

Aqua.find_persistent_tasks_deps(PolyChaos)
Aqua.test_ambiguities(PolyChaos, recursive = false)
Aqua.test_deps_compat(PolyChaos)
Aqua.test_piracies(PolyChaos)
Aqua.test_project_extras(PolyChaos)
Aqua.test_stale_deps(PolyChaos)
Aqua.test_unbound_args(PolyChaos, broken = true)
Aqua.test_undefined_exports(PolyChaos)
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include("qa.jl")
include("constructors.jl")
include("quadrature.jl")
include("recurrence_coefficients.jl")
Expand Down

0 comments on commit c2a3368

Please sign in to comment.