Skip to content

Commit 5a84adc

Browse files
committed
autoformat with Runic
finish migration to `Runic`
1 parent ba97117 commit 5a84adc

8 files changed

Lines changed: 413 additions & 262 deletions

File tree

.JuliaFormatter.toml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.git-blame-ignore-revs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# This file contains a list of commits that should be ignored by git blame.
2+
# To use this file, run: git config blame.ignoreRevsFile .git-blame-ignore-revs
3+
# See: https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt
4+
5+
# Format all code with Runic.jl (replacing JuliaFormatter)
6+
e50743f8a5d515880f4c9a4d1f7532304957eb63

.github/workflows/FormatCheck.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ jobs:
2222
version: ${{ matrix.julia-version }}
2323

2424
- uses: actions/checkout@v1
25-
- name: Install JuliaFormatter and format
25+
- name: Install Runic and format
2626
# This will use the latest version by default but you can set the version like so:
2727
#
28-
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
28+
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="Runic", version="0.1.0"))'
2929
run: |
30-
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
31-
julia -e 'using JuliaFormatter; format(".", verbose=true)'
30+
julia -e 'using Pkg; Pkg.add(PackageSpec(name="Runic"))'
31+
julia -e 'using Runic; format(".", verbose=true)'
3232
- name: Format check
3333
run: |
3434
julia -e '

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://IntegralEquations.github.io/ElementaryPDESolutions.jl/dev/)
55
[![Build Status](https://github.com/IntegralEquations/ElementaryPDESolutions.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/IntegralEquations/ElementaryPDESolutions.jl/actions/workflows/CI.yml?query=branch%3Amain)
66
[![Coverage](https://codecov.io/gh/IntegralEquations/ElementaryPDESolutions.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/IntegralEquations/ElementaryPDESolutions.jl)
7+
[![code style: runic](https://img.shields.io/badge/code_style-%E1%9A%B1%E1%9A%A2%E1%9A%BE%E1%9B%81%E1%9A%B2-black)](https://github.com/fredrikekre/Runic.jl)
78
[![Aqua
89
QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)
910

docs/make.jl

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
11
using ElementaryPDESolutions
22
using Documenter
33

4-
DocMeta.setdocmeta!(ElementaryPDESolutions, :DocTestSetup,
5-
:(using ElementaryPDESolutions, StaticArrays);
6-
recursive=true)
4+
DocMeta.setdocmeta!(
5+
ElementaryPDESolutions, :DocTestSetup,
6+
:(using ElementaryPDESolutions, StaticArrays);
7+
recursive = true
8+
)
79

810
makedocs(;
9-
modules=[ElementaryPDESolutions],
10-
authors="Thomas G. Anderson, Luiz M. Faria",
11-
repo="https://github.com/IntegralEquations/ElementaryPDESolutions.jl/blob/{commit}{path}#{line}",
12-
sitename="ElementaryPDESolutions.jl",
13-
format=Documenter.HTML(;
14-
prettyurls=get(ENV, "CI", "false") == "true",
15-
canonical="https://IntegralEquations.github.io/ElementaryPDESolutions.jl",
16-
edit_link="main",
17-
assets=String[]),
18-
pages=["Home" => "index.md",
19-
"Docstrings" => "docstrings.md"])
11+
modules = [ElementaryPDESolutions],
12+
authors = "Thomas G. Anderson, Luiz M. Faria",
13+
repo = "https://github.com/IntegralEquations/ElementaryPDESolutions.jl/blob/{commit}{path}#{line}",
14+
sitename = "ElementaryPDESolutions.jl",
15+
format = Documenter.HTML(;
16+
prettyurls = get(ENV, "CI", "false") == "true",
17+
canonical = "https://IntegralEquations.github.io/ElementaryPDESolutions.jl",
18+
edit_link = "main",
19+
assets = String[]
20+
),
21+
pages = [
22+
"Home" => "index.md",
23+
"Docstrings" => "docstrings.md",
24+
]
25+
)
2026

2127
deploydocs(;
22-
repo="github.com/IntegralEquations/ElementaryPDESolutions.jl",
23-
devbranch="main")
28+
repo = "github.com/IntegralEquations/ElementaryPDESolutions.jl",
29+
devbranch = "main"
30+
)

ext/ElementaryPDESolutionsFixedPolynomialsExt.jl

Lines changed: 81 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,64 +5,82 @@ import DynamicPolynomials: @polyvar
55
using FixedPolynomials: FixedPolynomials
66

77
function __init__()
8-
@info "Loading ElementaryPDESolutions.jl FixedPolynomials extension"
8+
return @info "Loading ElementaryPDESolutions.jl FixedPolynomials extension"
99
end
1010

11-
struct VecPolyFastEvaluator{N,S,T}
11+
struct VecPolyFastEvaluator{N, S, T}
1212
N::Int64
1313
PolSystem::FixedPolynomials.System{S}
14-
cfg::FixedPolynomials.JacobianConfig{T,S}
14+
cfg::FixedPolynomials.JacobianConfig{T, S}
1515
end
1616

17-
struct ScaPolyFastEvaluator{N,T}
17+
struct ScaPolyFastEvaluator{N, T}
1818
N::Int64
1919
Pol::FixedPolynomials.Polynomial{T}
20-
r::FixedPolynomials.GradientDiffResult{T,Vector{T}}
20+
r::FixedPolynomials.GradientDiffResult{T, Vector{T}}
2121
cfg::FixedPolynomials.GradientConfig{T}
2222
end
2323

24-
function VecPolyFastEvaluator(N, PolSystem::FixedPolynomials.System{S},
25-
cfg::FixedPolynomials.JacobianConfig{T,S}) where {S,T}
26-
return VecPolyFastEvaluator{N,S,T}(N, PolSystem, cfg)
24+
function VecPolyFastEvaluator(
25+
N, PolSystem::FixedPolynomials.System{S},
26+
cfg::FixedPolynomials.JacobianConfig{T, S}
27+
) where {S, T}
28+
return VecPolyFastEvaluator{N, S, T}(N, PolSystem, cfg)
2729
end
2830

29-
function ScaPolyFastEvaluator(N, Pol, r::FixedPolynomials.GradientDiffResult{T},
30-
cfg::FixedPolynomials.GradientConfig{T}) where {T}
31-
return ScaPolyFastEvaluator{N,T}(N, Pol, r, cfg)
31+
function ScaPolyFastEvaluator(
32+
N, Pol, r::FixedPolynomials.GradientDiffResult{T},
33+
cfg::FixedPolynomials.GradientConfig{T}
34+
) where {T}
35+
return ScaPolyFastEvaluator{N, T}(N, Pol, r, cfg)
3236
end
3337

34-
Base.length(VPFE::VecPolyFastEvaluator{N,S,T}) where {N,S,T} = length(VPFE.PolSystem)
38+
Base.length(VPFE::VecPolyFastEvaluator{N, S, T}) where {N, S, T} = length(VPFE.PolSystem)
3539

3640
"""
3741
fast_evaluate_with_jacobian!(vals::AbstractArray{S}, grad::AbstractArray{S}, x::AbstractVector{S}, VPFE::VecPolyFastEvaluator{N,S,T})
3842
3943
Evaluate an M-length vector of `N`-variate polynomials `VPFE` at point `x`, with values placed in the vector `vals` and its gradient placed in the array `grad` of size MxN.
4044
"""
41-
function ElementaryPDESolutions.fast_evaluate_with_jacobian!(vals::AbstractArray{S},
42-
grad::AbstractArray{S},
43-
x::AbstractVector{S},
44-
VPFE::VecPolyFastEvaluator{N,S,
45-
T}) where {N,
46-
S,
47-
T}
45+
function ElementaryPDESolutions.fast_evaluate_with_jacobian!(
46+
vals::AbstractArray{S},
47+
grad::AbstractArray{S},
48+
x::AbstractVector{S},
49+
VPFE::VecPolyFastEvaluator{
50+
N, S,
51+
T,
52+
}
53+
) where {
54+
N,
55+
S,
56+
T,
57+
}
4858
@assert length(vals) == length(VPFE.PolSystem)
4959
@assert size(grad) == (length(VPFE.PolSystem), N)
50-
return FixedPolynomials.evaluate_and_jacobian!(vals, grad, VPFE.PolSystem, x,
51-
VPFE.cfg)
60+
return FixedPolynomials.evaluate_and_jacobian!(
61+
vals, grad, VPFE.PolSystem, x,
62+
VPFE.cfg
63+
)
5264
end
5365

5466
"""
5567
fast_evaluate_with_jacobian!(vals::AbstractArray{S}, grad::AbstractArray{S}, x::AbstractVector{S}, SPFE::ScaPolyFastEvaluator{N,S,T})
5668
5769
Evaluate an `N`-variate polynomial `SPFE` at point `x`, with values placed in the vector `vals` and its gradient placed in the array `grad`.
5870
"""
59-
function ElementaryPDESolutions.fast_evaluate_with_gradient!(vals::AbstractArray{S},
60-
grad::AbstractArray{S},
61-
x::AbstractVector{S},
62-
SPFE::ScaPolyFastEvaluator{N,
63-
T}) where {N,
64-
S,
65-
T}
71+
function ElementaryPDESolutions.fast_evaluate_with_gradient!(
72+
vals::AbstractArray{S},
73+
grad::AbstractArray{S},
74+
x::AbstractVector{S},
75+
SPFE::ScaPolyFastEvaluator{
76+
N,
77+
T,
78+
}
79+
) where {
80+
N,
81+
S,
82+
T,
83+
}
6684
@assert SPFE.N == length(x)
6785
@assert length(grad) == N
6886
FixedPolynomials.gradient!(SPFE.r, SPFE.Pol, x, SPFE.cfg)
@@ -75,10 +93,14 @@ end
7593
7694
Evaluate a vector of polynomials `VPFE` at point `x`, with values placed in the vector `vals`.
7795
"""
78-
function ElementaryPDESolutions.fast_evaluate!(vals::AbstractArray{S}, x::AbstractVector{S},
79-
VPFE::VecPolyFastEvaluator{N,S,T}) where {N,
80-
S,
81-
T}
96+
function ElementaryPDESolutions.fast_evaluate!(
97+
vals::AbstractArray{S}, x::AbstractVector{S},
98+
VPFE::VecPolyFastEvaluator{N, S, T}
99+
) where {
100+
N,
101+
S,
102+
T,
103+
}
82104
@assert VPFE.N == length(x)
83105
@assert length(vals) == length(VPFE.PolSystem)
84106
return FixedPolynomials.evaluate!(vals, VPFE.PolSystem, x, VPFE.cfg)
@@ -89,9 +111,13 @@ end
89111
90112
Evaluate polynomial `SPFE` at point `x`, with value placed in `val`.
91113
"""
92-
function ElementaryPDESolutions.fast_evaluate!(val::AbstractArray{S}, x::AbstractVector{S},
93-
SPFE::ScaPolyFastEvaluator{N,T}) where {N,S,
94-
T}
114+
function ElementaryPDESolutions.fast_evaluate!(
115+
val::AbstractArray{S}, x::AbstractVector{S},
116+
SPFE::ScaPolyFastEvaluator{N, T}
117+
) where {
118+
N, S,
119+
T,
120+
}
95121
@assert SPFE.N == length(x)
96122
return val = FixedPolynomials.evaluate(SPFE.Pol, x, SPFE.cfg)
97123
end
@@ -103,9 +129,15 @@ Perform precomputations for fast evaluation of a `Vector` of `N`-variate
103129
`Polynomial` of input type `S`, with coefficients of type T. Return a
104130
`VecPolyFastEvaluator` object for online use.
105131
"""
106-
function ElementaryPDESolutions.assemble_fastevaluator(Pols::Vector{ElementaryPDESolutions.Polynomial{N,
107-
T}},
108-
::Type{S}) where {N,S,T}
132+
function ElementaryPDESolutions.assemble_fastevaluator(
133+
Pols::Vector{
134+
ElementaryPDESolutions.Polynomial{
135+
N,
136+
T,
137+
},
138+
},
139+
::Type{S}
140+
) where {N, S, T}
109141
if N == 1
110142
@polyvar x
111143
elseif N == 2
@@ -132,8 +164,10 @@ function ElementaryPDESolutions.assemble_fastevaluator(Pols::Vector{ElementaryPD
132164
elseif N == 2
133165
PolArray[polind] = FixedPolynomials.Polynomial(exp_data, coeff_data, [:x, :y])
134166
else
135-
PolArray[polind] = FixedPolynomials.Polynomial(exp_data, coeff_data,
136-
[:x, :y, :z])
167+
PolArray[polind] = FixedPolynomials.Polynomial(
168+
exp_data, coeff_data,
169+
[:x, :y, :z]
170+
)
137171
end
138172
end
139173
PolSystem = FixedPolynomials.System(PolArray)
@@ -147,9 +181,13 @@ end
147181
Perform precomputations for fast evaluation of a `Polynomial` on points of type `S`.
148182
Return a `ScaPolyFastEvaluator` object for online use.
149183
"""
150-
function ElementaryPDESolutions.assemble_fastevaluator(Pol::ElementaryPDESolutions.Polynomial{N,
151-
T},
152-
::Type{S}) where {N,S,T}
184+
function ElementaryPDESolutions.assemble_fastevaluator(
185+
Pol::ElementaryPDESolutions.Polynomial{
186+
N,
187+
T,
188+
},
189+
::Type{S}
190+
) where {N, S, T}
153191
if N == 1
154192
@polyvar x
155193
elseif N == 2

0 commit comments

Comments
 (0)