Skip to content

Commit 11b21b2

Browse files
authored
Major Refactoring into API and Subpackages (SciML#371)
* Start to work on DataDrivenBase * Restructure a bit * Make the solution a statsbase type * Add implicit indicator and dispatch * exclude tests for now * Clean up deps and generalize Solution * Move utils * More tests * Fix typo * Remove old tests * Adapt further * Adapt testset * Add collocation test * Add some interpolation methods * Adapt SciML Code style * Adapt common options slightly * Adapt docs * Adapt the docs * Adapt docs * Lighten up documentation deps * Prune deps * Update the basis methods * Update make.jl * Format code * Adapt for subtyping of basis * Rmv deprecations * Slight documentation adapts * adapt more common options * Adapt solve dispatch * Setup subpackages and start working on DMD * Rmv old test for now * Adapt Readme * Format * Add StaticArrays * Make basis immutable * Make abstract types more concrete * Safety check eqs * Fixup docs * Format * Restructure tests * Implicit deps on Symbolics and SymbolicUtils * Fix wrong import * Working status commit * More tests * DataDrivenFunction * Structure tests * Remove revise again * Fix implicits * Fix Dataset and Solution * Fix tests * Empty Matrix backwards * Change empty matrix * Better normalization, preprocessing,add internal * Prune old code * Add problem to the internal prob * Fit InternalProb for all * Add comments and tests * Further adapt for use within DMD * Forgot retcode * Fix up tests * Store default values * Adapt test * Update docs * Format * Update docs and format * Export returncodes * Updata DMD * WIP for DMD * Update for remake and solution parameters * Update options, fix problem * Right eval_expression * Fix solution tests for prob remake * Fixup small issues and make StaticArrays keyworded * Fix Complex results and jacobian behaviour * Formatting * Fix small issues * Allow for non-parametric outputs * Add getters and fix errors * Add exports, testdeps and some tests * Remove StaticArrays and make eval concrete * Change sigdigits and use it to derive the basis * Adapt rounding * Adapt test * Add tests and fix gEDMD * Adapt the building of the basis * Add controlled tests * Adapt algorithms to old structure * Finalize tests * Info to test * Adapt tests for subpackages * Initial draft for Symbolic Regression jl * Adapt tests * try to up CI * Adapt for right useage * Fix typo * Intial draft for SparseRegression * ADMM and fixes * Further fixes * SR3 * Add simple testset * Add Tests * Format * Implicit Sparse Regression * Remove old stuff * Format * Debug the tests * Try to get tests green * Less randomness * Too much synt sugar! * Diversify the basis * Relax tests a little * Relax due to failing of 1.0 * Update Candidate Matrix * Update problems and build basis * Whitespace * Adapt utils * Update dependencies * Fix candidate matrix * Update tests * Fix pkg imports * Remove prints * Check for consistency on GH * Add necessary idx for implicits * Try to adapt coverage * Format * Try to fix * Adapt for all files * Revert CI * Adapt DMD tests * Add eval expression tests * Format * Adapt CompatHelper to include subdirs * Try to up Coverage * Add coverage to sublib * Fix coverage * Fix some exports and annotations * Update docs * Add more docs * Missing exports * Remove direct deps right now * Remove docs * Add more examples and adapt docs * Remove example files * Format * Bump version * Add quickstart to the homepage * Add rounding * Remove tests and make SR examples faster * Remove folders * Adapt README * Format * Limit DataInterpolations
1 parent a026b2c commit 11b21b2

File tree

120 files changed

+5393
-5870
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+5393
-5870
lines changed

.JuliaFormatter.toml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
style = "sciml"

.github/workflows/CI.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
1313
matrix:
1414
group:
1515
- Core
16+
- DataDrivenDMD
17+
- DataDrivenSR
18+
- DataDrivenSparse
1619
version:
1720
- '1'
1821
- '1.6'
@@ -33,7 +36,12 @@ jobs:
3336
${{ runner.os }}-
3437
- uses: julia-actions/julia-buildpkg@v1
3538
- uses: julia-actions/julia-runtest@v1
39+
env:
40+
GROUP: ${{ matrix.group }}
3641
- uses: julia-actions/julia-processcoverage@v1
37-
- uses: codecov/codecov-action@v1
3842
with:
39-
file: lcov.info
43+
directories: src,lib/DataDrivenDMD/src,lib/DataDrivenSparse/src,lib/DataDrivenSR/src
44+
- uses: codecov/codecov-action@v3
45+
with:
46+
files: lcov.info
47+
flags: ${{ matrix.group }}

.github/workflows/CompatHelper.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
- name: CompatHelper.main()
2424
env:
2525
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26-
run: julia -e 'using CompatHelper; CompatHelper.main()'
26+
run: julia -e 'using CompatHelper; CompatHelper.main(;subdirs=["", "docs", "lib/DataDrivenDMD", "lib/DataDrivenSparse", "lib/DataDrivenSR"])'

.github/workflows/FormatCheck.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: format-check
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
- 'release-'
8+
tags: '*'
9+
pull_request:
10+
11+
jobs:
12+
build:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
julia-version: [1]
17+
julia-arch: [x86]
18+
os: [ubuntu-latest]
19+
steps:
20+
- uses: julia-actions/setup-julia@latest
21+
with:
22+
version: ${{ matrix.julia-version }}
23+
24+
- uses: actions/checkout@v1
25+
- name: Install JuliaFormatter and format
26+
# This will use the latest version by default but you can set the version like so:
27+
#
28+
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
29+
run: |
30+
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
31+
julia -e 'using JuliaFormatter; format(".", verbose=true)'
32+
- name: Format check
33+
run: |
34+
julia -e '
35+
out = Cmd(`git diff --name-only`) |> read |> String
36+
if out == ""
37+
exit(0)
38+
else
39+
@error "Some files have not been formatted !!!"
40+
write(stdout, out)
41+
exit(1)
42+
end'

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44
Manifest.toml
55
.DS_Store
66
/docs/build/*
7-
hall_of_fame.*
7+
/docs/src/libs/*/examples
8+
hall_of_fame.*
9+
/tmp/*

Project.toml

+7-20
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
name = "DataDrivenDiffEq"
22
uuid = "2445eb08-9709-466a-b3fc-47e12bd697a2"
33
authors = ["Julius Martensen <[email protected]>"]
4-
version = "0.8.6"
4+
version = "1.0.0"
55

66
[deps]
77
CommonSolve = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2"
88
DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0"
99
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
10-
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
1110
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
1211
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
13-
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
12+
MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
1413
Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7"
1514
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
1615
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
@@ -19,43 +18,31 @@ QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
1918
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
2019
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
2120
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
22-
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
21+
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
2322
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
2423
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
25-
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
26-
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
2724
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2825

2926
[compat]
3027
CommonSolve = "0.2"
31-
DataInterpolations = "3"
28+
DataInterpolations = "3.7"
3229
DiffEqBase = "6"
33-
Distributions = "^0.25.9, 0.25"
3430
DocStringExtensions = "0.7, 0.8, 0.9"
35-
Flux = "^0.12.4"
36-
Literate = "2"
37-
Measurements = "2.7"
3831
ModelingToolkit = "7, 8"
3932
Parameters = "0.12"
4033
ProgressMeter = "1.6"
4134
QuadGK = "2.4"
4235
RecipesBase = "1"
4336
Reexport = "1.0"
44-
Requires = "1"
37+
Setfield = "1"
4538
StatsBase = "0.32.0, 0.33"
46-
SymbolicRegression = "0.9"
47-
SymbolicUtils = "0.19"
48-
Symbolics = "4"
4939
julia = "1.6"
5040

5141
[extras]
52-
DiffEqOperators = "9fdde737-9c7f-55bf-ade8-46b3f136cc48"
53-
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
54-
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
42+
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
5543
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
5644
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
57-
SymbolicRegression = "8254be44-1295-4e6a-a16d-46603ac705cb"
5845
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
5946

6047
[targets]
61-
test = ["DiffEqOperators", "Flux", "SymbolicRegression", "OrdinaryDiffEq", "Test", "Random", "SafeTestsets"]
48+
test = ["Test", "Random", "SafeTestsets", "Pkg"]

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ the documentation which contains the un-released features.
2727
using DataDrivenDiffEq
2828
using ModelingToolkit
2929
using OrdinaryDiffEq
30-
30+
using DataDrivenSparse
3131
using LinearAlgebra
3232

3333
# Create a test problem
@@ -44,18 +44,18 @@ u0 = [1.0;0.0;0.0]
4444
tspan = (0.0,100.0)
4545
dt = 0.1
4646
prob = ODEProblem(lorenz,u0,tspan)
47-
sol = solve(prob, Tsit5(), saveat = dt, progress = true)
47+
sol = solve(prob, Tsit5(), saveat = dt)
4848

4949

5050
## Start the automatic discovery
51-
ddprob = ContinuousDataDrivenProblem(sol)
51+
ddprob = DataDrivenProblem(sol)
5252

5353
@variables t x(t) y(t) z(t)
5454
u = [x;y;z]
5555
basis = Basis(polynomial_basis(u, 5), u, iv = t)
5656
opt = STLSQ(exp10.(-5:0.1:-1))
57-
ddsol = solve(ddprob, basis, opt, normalize = true)
58-
print(ddsol, Val{true})
57+
ddsol = solve(ddprob, basis, opt, options = DataDrivenCommonOptions(digits = 1))
58+
println(get_basis(ddsol))
5959
```
6060

6161
```

docs/Project.toml

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
[deps]
22
DataDrivenDiffEq = "2445eb08-9709-466a-b3fc-47e12bd697a2"
3-
DiffEqOperators = "9fdde737-9c7f-55bf-ade8-46b3f136cc48"
43
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
5-
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
64
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
75
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
86
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
97
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
108
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
11-
SymbolicRegression = "8254be44-1295-4e6a-a16d-46603ac705cb"
12-
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
9+
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
10+
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
1311

1412
[compat]
1513
Documenter = "0.27"
16-
SymbolicRegression = "0.9"

docs/examples/10_noisy_nonlinear.jl

-96
This file was deleted.

0 commit comments

Comments
 (0)