Skip to content

Commit a0c888b

Browse files
Merge pull request #6 from anandijain/aj/updates
update datadriven
2 parents 8f10a1a + d435743 commit a0c888b

File tree

10 files changed

+24
-18
lines changed

10 files changed

+24
-18
lines changed

.github/CI.yml renamed to .github/workflows/CI.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: CI
22
on:
33
pull_request:
44
branches:
5-
- master
5+
- main
66
push:
77
branches:
8-
- master
8+
- main
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
File renamed without changes.

.github/Documentation.yml renamed to .github/workflows/Documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Documentation
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
tags: '*'
88
pull_request:
99

File renamed without changes.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Manifest.toml

Project.toml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
name = "SymbolicNumericIntegration"
22
uuid = "78aadeae-fbc0-11eb-17b6-c7ec0477ba9e"
33
authors = ["Shahriar Iravanian <[email protected]>"]
4-
version = "0.8.2"
4+
version = "0.8.3"
55

66
[deps]
77
DataDrivenDiffEq = "2445eb08-9709-466a-b3fc-47e12bd697a2"
88
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
99
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
10-
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
1110
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1211
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
1312
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
14-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1513

1614
[compat]
17-
DataDrivenDiffEq = "0.6"
15+
DataDrivenDiffEq = "0.8"
1816
DataStructures = "0.18"
1917
PyCall = "1"
20-
SymbolicUtils = "0.18"
18+
SymbolicUtils = "0.19"
2119
Symbolics = "4"
2220
julia = "1.6"
21+
22+
[extras]
23+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
24+
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
25+
26+
[targets]
27+
test = ["Test", "PyCall"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The basis of how it works and the theory of integration using the Symbolic-Numer
88
Function `integrate` returns the integral of a univariate expression with *constant* real or complex coefficients. `integrate` returns a tuple with three values. The first one is the solved integral, the second one is the sum of the unsolved terms, and the third value is the residual error. If `integrate` is successful, the unsolved portion is reported as 0.
99

1010
```julia
11-
using SymbolicUtils
11+
using Symbolics
1212
using SymbolicNumericIntegration
1313

1414
@variables x

src/SymbolicNumericIntegration.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ using Symbolics: value, get_variables, expand_derivatives
66
using SymbolicUtils.Rewriters
77
using Symbolics
88

9-
using DataDrivenDiffEq.Optimize
9+
using DataDrivenDiffEq
1010

1111
include("utils.jl")
1212
include("roots.jl")

src/integral.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,8 @@ function sparse_fit(T, A, x, basis, Δbasis, opt; abstol=1e-6)
326326
try
327327
b = ones(n)
328328
# q₀ = A \ b
329-
q₀ = Optimize.init(opt, A, b)
330-
@views Optimize.sparse_regression!(q₀, A, permutedims(b)', opt, maxiter = 1000)
329+
q₀ = DataDrivenDiffEq.init(opt, A, b)
330+
@views sparse_regression!(q₀, A, permutedims(b)', opt, maxiter = 1000)
331331
ϵ = rms(A * q₀ - b)
332332
q = nice_parameter.(q₀)
333333
if sum(iscomplex.(q)) > 2 return nothing, Inf end # eliminating complex coefficients

test/runtests.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
# using SymbolicNumericIntegration
2-
using SymbolicUtils
1+
using SymbolicNumericIntegration
2+
using Symbolics
33
using Test
44

55
include("axiom.jl")
66

77
##############################################################################
88

9-
# @syms x β
109
@variables x β
1110

1211
"""
@@ -220,9 +219,10 @@ function test_integrals(; kw...)
220219
for eq in misses
221220
printstyled(eq, '\n'; color=:red)
222221
end
223-
return true
222+
return n
224223
end
225224

226-
@testset "integral" begin test_integrals(;
227-
symbolic=false, verbose=false, homotopy=true, num_steps=2, num_trials=10)
225+
@testset "integral" begin
226+
n = test_integrals(;symbolic=false, verbose=false, homotopy=true, num_steps=2, num_trials=10)
227+
@test n==11
228228
end

0 commit comments

Comments
 (0)