Skip to content

Commit 283f3ed

Browse files
reformatting
1 parent 7b477dc commit 283f3ed

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

Project.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ version = "0.9.0"
66
[deps]
77
DataDrivenDiffEq = "2445eb08-9709-466a-b3fc-47e12bd697a2"
88
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
9+
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
910
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1011
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1112
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
@@ -14,12 +15,16 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
1415
[compat]
1516
DataDrivenDiffEq = "0.8"
1617
DataStructures = "0.18"
18+
PyCall = "1"
19+
SymPy = "1"
1720
SymbolicUtils = "0.19"
1821
Symbolics = "4"
1922
julia = "1.6"
2023

2124
[extras]
25+
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
26+
SymPy = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6"
2227
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2328

2429
[targets]
25-
test = ["Test"]
30+
test = ["PyCall", "SymPy", "Test"]

src/integral.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -279,17 +279,17 @@ function init_basis_matrix!(T, A, X, x, eq, Δbasis, radius, complex_plane; abst
279279
n = size(A, 1)
280280
k = 1
281281
i = 1
282-
283-
eq_fun = build_function(eq, x; expression=false)
284-
Δbasis_fun = build_function.(Δbasis, x; expression=false)
282+
283+
eq_fun = build_function(eq, x; expression = false)
284+
Δbasis_fun = build_function.(Δbasis, x; expression = false)
285285

286286
while k <= n
287-
try
287+
try
288288
X[k] = test_point(complex_plane, radius)
289289
b₀ = eq_fun(X[k])
290-
290+
291291
if is_proper(b₀)
292-
for j in 1:n
292+
for j in 1:n
293293
A[k, j] = Δbasis_fun[j](X[k]) / b₀
294294
end
295295
if all(is_proper, A[k, :])
@@ -305,11 +305,11 @@ end
305305
function modify_basis_matrix!(T, A, X, x, eq, ∂eq, Δbasis, radius; abstol = 1e-6)
306306
n = size(A, 1)
307307
k = 1
308-
309-
eq_fun = build_function(eq, x; expression=false)
310-
∂eq_fun = build_function(∂eq, x; expression=false)
311-
Δbasis_fun = build_function.(Δbasis, x; expression=false)
312-
308+
309+
eq_fun = build_function(eq, x; expression = false)
310+
∂eq_fun = build_function(∂eq, x; expression = false)
311+
Δbasis_fun = build_function.(Δbasis, x; expression = false)
312+
313313
for k in 1:n
314314
# One Newton iteration toward the poles
315315
# note the + sign instead of the usual - in Newton-Raphson's method. This is

src/numeric_utils.jl

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,19 @@ end
3232
converts float to int or small rational numbers
3333
"""
3434

35-
function nice_parameter(u::Complex{T}; abstol = 1e-3, M = 10) where {T <: Real}
36-
α = nice_parameter(real(u))
37-
β = nice_parameter(imag(u))
35+
function nice_parameter(u::Complex{T}; abstol=1e-6) where {T <: Real}
36+
α = nice_parameter(real(u); abstol)
37+
β = nice_parameter(imag(u); abstol)
3838
return β 0 ? α : Complex(α, β)
3939
end
4040

41-
nice_parameter(x; abstol=1e-7) = small_rational(x; abstol)
41+
nice_parameter(x; abstol=1e-6) = small_rational(x; abstol)
4242

43-
nice_parameters(p; abstol = 1e-3) = nice_parameter.(p)
43+
nice_parameters(p; abstol=1e-6) = nice_parameter.(p; abstol)
4444

4545
function small_rational(x::T; abstol=1e-6, M=20) where {T <: Real}
46-
# c = lcm(collect(1:M)...)
47-
a = floor(Int, x)
48-
r = x - a
46+
a = floor(Int, x)
47+
r = x - a
4948
for den in 2:M
5049
try
5150
if abs(round(r * den) - r * den) < abstol
@@ -57,7 +56,3 @@ function small_rational(x::T; abstol=1e-6, M=20) where {T <: Real}
5756
end
5857
return x
5958
end
60-
61-
62-
63-

src/utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#isdependent(eq, x) = !isequal(expand_derivatives(Differential(x)(eq)), 0)
55

66
function isdependent(eq, x)
7-
vars = get_variables(eq)
8-
return length(vars) == 1 && isequal(x, vars[1])
7+
vars = get_variables(eq)
8+
return length(vars) == 1 && isequal(x, vars[1])
99
end
1010

1111
"""

0 commit comments

Comments
 (0)