sindy-exp 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sindy_exp-0.2.0/.github/workflows/main.yaml +67 -0
- sindy_exp-0.2.0/.github/workflows/release.yml +38 -0
- sindy_exp-0.2.0/.gitignore +139 -0
- sindy_exp-0.2.0/.pre-commit-config.yaml +64 -0
- sindy_exp-0.2.0/CITATION.cff +33 -0
- sindy_exp-0.2.0/LICENSE +21 -0
- sindy_exp-0.2.0/PKG-INFO +111 -0
- sindy_exp-0.2.0/README.md +45 -0
- sindy_exp-0.2.0/pyproject.toml +115 -0
- sindy_exp-0.2.0/setup.cfg +26 -0
- sindy_exp-0.2.0/src/sindy_exp/__init__.py +28 -0
- sindy_exp-0.2.0/src/sindy_exp/_data.py +202 -0
- sindy_exp-0.2.0/src/sindy_exp/_diffrax_solver.py +104 -0
- sindy_exp-0.2.0/src/sindy_exp/_dysts_to_sympy.py +452 -0
- sindy_exp-0.2.0/src/sindy_exp/_odes.py +287 -0
- sindy_exp-0.2.0/src/sindy_exp/_plotting.py +544 -0
- sindy_exp-0.2.0/src/sindy_exp/_typing.py +158 -0
- sindy_exp-0.2.0/src/sindy_exp/_utils.py +381 -0
- sindy_exp-0.2.0/src/sindy_exp/addl_attractors.json +91 -0
- sindy_exp-0.2.0/src/sindy_exp.egg-info/PKG-INFO +111 -0
- sindy_exp-0.2.0/src/sindy_exp.egg-info/SOURCES.txt +25 -0
- sindy_exp-0.2.0/src/sindy_exp.egg-info/dependency_links.txt +1 -0
- sindy_exp-0.2.0/src/sindy_exp.egg-info/requires.txt +27 -0
- sindy_exp-0.2.0/src/sindy_exp.egg-info/top_level.txt +1 -0
- sindy_exp-0.2.0/tests/test_all.py +186 -0
- sindy_exp-0.2.0/tests/test_inspect_to_sympy.py +20 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
Linting:
|
|
13
|
+
name: Linting
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v3
|
|
17
|
+
- name: "Set up Python"
|
|
18
|
+
uses: actions/setup-python@v3
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.10"
|
|
21
|
+
- name: run pre-commit
|
|
22
|
+
run: |
|
|
23
|
+
pip install pre-commit
|
|
24
|
+
pre-commit run --all-files
|
|
25
|
+
|
|
26
|
+
Typing:
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v3
|
|
30
|
+
- name: "Set up Python"
|
|
31
|
+
uses: actions/setup-python@v3
|
|
32
|
+
with:
|
|
33
|
+
python-version: "3.10"
|
|
34
|
+
- name: install dependencies
|
|
35
|
+
run: |
|
|
36
|
+
pip install -e .[dev,jax]
|
|
37
|
+
- name: run mypy
|
|
38
|
+
run: |
|
|
39
|
+
mypy
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
Tests:
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
strategy:
|
|
45
|
+
fail-fast: false
|
|
46
|
+
max-parallel: 4
|
|
47
|
+
matrix:
|
|
48
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/checkout@v3
|
|
51
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
52
|
+
uses: actions/setup-python@v3
|
|
53
|
+
with:
|
|
54
|
+
python-version: ${{ matrix.python-version }}
|
|
55
|
+
- name: Install dependencies
|
|
56
|
+
run: |
|
|
57
|
+
pip install --upgrade pip
|
|
58
|
+
pip install .[dev,jax]
|
|
59
|
+
- name: Test with pytest
|
|
60
|
+
run: |
|
|
61
|
+
coverage run --source=src/sindy_exp -m pytest tests && coverage xml
|
|
62
|
+
- uses: actions/cache@v3
|
|
63
|
+
with:
|
|
64
|
+
path: ~/.cache/pip
|
|
65
|
+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
|
|
66
|
+
restore-keys: |
|
|
67
|
+
${{ runner.os }}-pip-
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
tags:
|
|
5
|
+
- '**'
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
print-context:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- name: print-gh-context
|
|
12
|
+
env:
|
|
13
|
+
GITHUB_CONTEXT: ${{ toJson(github) }}
|
|
14
|
+
run: echo "$GITHUB_CONTEXT"
|
|
15
|
+
|
|
16
|
+
pypi-publish:
|
|
17
|
+
name: Deploy release to PyPI
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
environment:
|
|
20
|
+
name: pypi
|
|
21
|
+
url: https://pypi.org/p/sindy-exp
|
|
22
|
+
permissions:
|
|
23
|
+
id-token: write
|
|
24
|
+
steps:
|
|
25
|
+
- name: Checkout source
|
|
26
|
+
uses: actions/checkout@v6
|
|
27
|
+
- name: Set up Python
|
|
28
|
+
uses: actions/setup-python@v6
|
|
29
|
+
with:
|
|
30
|
+
python-version: "3.10"
|
|
31
|
+
- name: Install Build
|
|
32
|
+
run: |
|
|
33
|
+
python -m pip install --upgrade pip
|
|
34
|
+
pip install build
|
|
35
|
+
- name: Build package
|
|
36
|
+
run: python -m build .
|
|
37
|
+
- name: Publish package distributions to PyPI
|
|
38
|
+
uses: pypa/gh-action-pypi-publish@v1.13.0
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
commit-msg
|
|
2
|
+
todo
|
|
3
|
+
scratch/
|
|
4
|
+
*.png
|
|
5
|
+
debugme*.py
|
|
6
|
+
trials/*
|
|
7
|
+
|
|
8
|
+
# IDE files
|
|
9
|
+
.vscode
|
|
10
|
+
|
|
11
|
+
# Byte-compiled / optimized / DLL files
|
|
12
|
+
__pycache__/
|
|
13
|
+
*.py[cod]
|
|
14
|
+
*$py.class
|
|
15
|
+
|
|
16
|
+
# C extensions
|
|
17
|
+
*.so
|
|
18
|
+
|
|
19
|
+
# Distribution / packaging
|
|
20
|
+
.Python
|
|
21
|
+
build/
|
|
22
|
+
develop-eggs/
|
|
23
|
+
dist/
|
|
24
|
+
downloads/
|
|
25
|
+
eggs/
|
|
26
|
+
.eggs/
|
|
27
|
+
lib/
|
|
28
|
+
lib64/
|
|
29
|
+
parts/
|
|
30
|
+
sdist/
|
|
31
|
+
var/
|
|
32
|
+
wheels/
|
|
33
|
+
pip-wheel-metadata/
|
|
34
|
+
share/python-wheels/
|
|
35
|
+
*.egg-info/
|
|
36
|
+
.installed.cfg
|
|
37
|
+
*.egg
|
|
38
|
+
MANIFEST
|
|
39
|
+
|
|
40
|
+
# PyInstaller
|
|
41
|
+
# Usually these files are written by a python script from a template
|
|
42
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
43
|
+
*.manifest
|
|
44
|
+
*.spec
|
|
45
|
+
|
|
46
|
+
# Installer logs
|
|
47
|
+
pip-log.txt
|
|
48
|
+
pip-delete-this-directory.txt
|
|
49
|
+
|
|
50
|
+
# Unit test / coverage reports
|
|
51
|
+
htmlcov/
|
|
52
|
+
.tox/
|
|
53
|
+
.nox/
|
|
54
|
+
.coverage
|
|
55
|
+
.coverage.*
|
|
56
|
+
.cache
|
|
57
|
+
nosetests.xml
|
|
58
|
+
coverage.xml
|
|
59
|
+
*.cover
|
|
60
|
+
*.py,cover
|
|
61
|
+
.hypothesis/
|
|
62
|
+
.pytest_cache/
|
|
63
|
+
|
|
64
|
+
# Translations
|
|
65
|
+
*.mo
|
|
66
|
+
*.pot
|
|
67
|
+
|
|
68
|
+
# Django stuff:
|
|
69
|
+
*.log
|
|
70
|
+
local_settings.py
|
|
71
|
+
db.sqlite3
|
|
72
|
+
db.sqlite3-journal
|
|
73
|
+
|
|
74
|
+
# Flask stuff:
|
|
75
|
+
instance/
|
|
76
|
+
.webassets-cache
|
|
77
|
+
|
|
78
|
+
# Scrapy stuff:
|
|
79
|
+
.scrapy
|
|
80
|
+
|
|
81
|
+
# Sphinx documentation
|
|
82
|
+
docs/_build/
|
|
83
|
+
|
|
84
|
+
# PyBuilder
|
|
85
|
+
target/
|
|
86
|
+
|
|
87
|
+
# Jupyter Notebook
|
|
88
|
+
.ipynb_checkpoints
|
|
89
|
+
|
|
90
|
+
# IPython
|
|
91
|
+
profile_default/
|
|
92
|
+
ipython_config.py
|
|
93
|
+
|
|
94
|
+
# pyenv
|
|
95
|
+
.python-version
|
|
96
|
+
|
|
97
|
+
# pipenv
|
|
98
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
99
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
100
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
101
|
+
# install all needed dependencies.
|
|
102
|
+
#Pipfile.lock
|
|
103
|
+
|
|
104
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
105
|
+
__pypackages__/
|
|
106
|
+
|
|
107
|
+
# Celery stuff
|
|
108
|
+
celerybeat-schedule
|
|
109
|
+
celerybeat.pid
|
|
110
|
+
|
|
111
|
+
# SageMath parsed files
|
|
112
|
+
*.sage.py
|
|
113
|
+
|
|
114
|
+
# Environments
|
|
115
|
+
.env
|
|
116
|
+
.venv
|
|
117
|
+
env/
|
|
118
|
+
venv/
|
|
119
|
+
ENV/
|
|
120
|
+
env.bak/
|
|
121
|
+
venv.bak/
|
|
122
|
+
|
|
123
|
+
# Spyder project settings
|
|
124
|
+
.spyderproject
|
|
125
|
+
.spyproject
|
|
126
|
+
|
|
127
|
+
# Rope project settings
|
|
128
|
+
.ropeproject
|
|
129
|
+
|
|
130
|
+
# mkdocs documentation
|
|
131
|
+
/site
|
|
132
|
+
|
|
133
|
+
# mypy
|
|
134
|
+
.mypy_cache/
|
|
135
|
+
.dmypy.json
|
|
136
|
+
dmypy.json
|
|
137
|
+
|
|
138
|
+
# Pyre type checker
|
|
139
|
+
.pyre/
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
fail_fast: false
|
|
2
|
+
repos:
|
|
3
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
4
|
+
rev: v4.5.0
|
|
5
|
+
hooks:
|
|
6
|
+
- id: check-added-large-files
|
|
7
|
+
args: ["--maxkb=775"]
|
|
8
|
+
- id: check-merge-conflict
|
|
9
|
+
- repo: https://github.com/PyCQA/isort
|
|
10
|
+
rev: 5.13.2
|
|
11
|
+
hooks:
|
|
12
|
+
- id: isort
|
|
13
|
+
exclude: > # multiline regex pattern
|
|
14
|
+
(?x)^(
|
|
15
|
+
scratch/.*
|
|
16
|
+
)
|
|
17
|
+
- repo: https://github.com/psf/black
|
|
18
|
+
rev: 24.8.0
|
|
19
|
+
hooks:
|
|
20
|
+
- id: black
|
|
21
|
+
- repo: https://github.com/PyCQA/flake8
|
|
22
|
+
rev: 7.0.0
|
|
23
|
+
hooks:
|
|
24
|
+
- id: flake8
|
|
25
|
+
exclude: > # multiline regex pattern
|
|
26
|
+
(?x)^(
|
|
27
|
+
scratch/.*
|
|
28
|
+
)
|
|
29
|
+
additional_dependencies: [flake8-comprehensions]
|
|
30
|
+
args: ["--config=setup.cfg"]
|
|
31
|
+
- repo: https://github.com/pre-commit/pygrep-hooks
|
|
32
|
+
rev: v1.10.0
|
|
33
|
+
hooks:
|
|
34
|
+
- id: rst-backticks
|
|
35
|
+
- id: rst-directive-colons
|
|
36
|
+
types: [text] # overwrite types: [rst]
|
|
37
|
+
types_or: [python, rst]
|
|
38
|
+
- id: rst-inline-touching-normal
|
|
39
|
+
types: [text] # overwrite types: [rst]
|
|
40
|
+
types_or: [python, rst]
|
|
41
|
+
- repo: https://github.com/sphinx-contrib/sphinx-lint
|
|
42
|
+
rev: v0.9.1
|
|
43
|
+
hooks:
|
|
44
|
+
- id: sphinx-lint
|
|
45
|
+
- repo: https://github.com/codespell-project/codespell
|
|
46
|
+
rev: v2.2.6
|
|
47
|
+
hooks:
|
|
48
|
+
- id: codespell
|
|
49
|
+
exclude: > # multiline regex pattern
|
|
50
|
+
(?x)^(
|
|
51
|
+
scratch/.*
|
|
52
|
+
)
|
|
53
|
+
types_or: [python, rst, markdown]
|
|
54
|
+
additional_dependencies: [tomli]
|
|
55
|
+
args: ["--toml=pyproject.toml"]
|
|
56
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
57
|
+
rev: v4.5.0
|
|
58
|
+
hooks:
|
|
59
|
+
- id: end-of-file-fixer
|
|
60
|
+
exclude: (.txt|^docs/JOSS1|^docs/JOSS2|^examples/data/)
|
|
61
|
+
stages: [commit, merge-commit, push, prepare-commit-msg, commit-msg, post-checkout, post-commit, post-merge, post-rewrite]
|
|
62
|
+
- id: trailing-whitespace
|
|
63
|
+
stages: [commit, merge-commit, push, prepare-commit-msg, commit-msg, post-checkout, post-commit, post-merge, post-rewrite]
|
|
64
|
+
exclude: (.txt|^docs/JOSS1|^docs/JOSS2|^examples/data/)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# This CITATION.cff file was generated with cffinit.
|
|
2
|
+
# Visit https://bit.ly/cffinit to generate yours today!
|
|
3
|
+
|
|
4
|
+
cff-version: 1.2.0
|
|
5
|
+
title: pysindy-experiments
|
|
6
|
+
message: >-
|
|
7
|
+
If you use this software, please cite it using the
|
|
8
|
+
metadata from this file.
|
|
9
|
+
type: software
|
|
10
|
+
authors:
|
|
11
|
+
- given-names: Jacob
|
|
12
|
+
family-names: Stevens-Haas
|
|
13
|
+
email: jacob.stevens.haas@gmail.com
|
|
14
|
+
affiliation: University of Washington
|
|
15
|
+
orcid: 'https://orcid.org/0000-0003-4142-5550'
|
|
16
|
+
- given-names: Yash
|
|
17
|
+
family-names: Bhangale
|
|
18
|
+
email: yash6599@uw.edu
|
|
19
|
+
affiliation: University of Washington
|
|
20
|
+
repository-code: 'https://github.com/Jacob-Stevens-Haas/gen-experiments'
|
|
21
|
+
abstract: >-
|
|
22
|
+
A package for forming pysindy experiments to be run in
|
|
23
|
+
mitosis.
|
|
24
|
+
keywords:
|
|
25
|
+
- reproducibility
|
|
26
|
+
- experiments
|
|
27
|
+
- pysindy
|
|
28
|
+
- SINDy
|
|
29
|
+
- dynamical systems
|
|
30
|
+
license: MIT
|
|
31
|
+
commit: 31383318ae86fe3c662d683e0d4a9caf9a2def51
|
|
32
|
+
version: 0.1.1
|
|
33
|
+
date-released: '2024-04-28'
|
sindy_exp-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Jacob Stevens-Haas
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
sindy_exp-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sindy-exp
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: A basic library for constructing dynamics experiments
|
|
5
|
+
Author-email: Jake Stevens-Haas <jacob.stevens.haas@gmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2022 Jacob Stevens-Haas
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: homepage, https://github.com/Jake-Stevens-Haas/gen-experiments
|
|
29
|
+
Keywords: Machine Learning,Science,Mathematics,Experiments
|
|
30
|
+
Classifier: Development Status :: 4 - Beta
|
|
31
|
+
Classifier: Programming Language :: Python
|
|
32
|
+
Classifier: Framework :: Jupyter
|
|
33
|
+
Classifier: Intended Audience :: Science/Research
|
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
35
|
+
Classifier: Natural Language :: English
|
|
36
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
37
|
+
Requires-Python: >=3.10
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
License-File: LICENSE
|
|
40
|
+
Requires-Dist: matplotlib
|
|
41
|
+
Requires-Dist: numpy>=2.0.0
|
|
42
|
+
Requires-Dist: seaborn
|
|
43
|
+
Requires-Dist: scipy
|
|
44
|
+
Requires-Dist: sympy
|
|
45
|
+
Requires-Dist: dysts
|
|
46
|
+
Provides-Extra: jax
|
|
47
|
+
Requires-Dist: jax[cuda12]; extra == "jax"
|
|
48
|
+
Requires-Dist: diffrax; extra == "jax"
|
|
49
|
+
Requires-Dist: sympy2jax; extra == "jax"
|
|
50
|
+
Requires-Dist: typing_extensions; extra == "jax"
|
|
51
|
+
Provides-Extra: dev
|
|
52
|
+
Requires-Dist: ipykernel; extra == "dev"
|
|
53
|
+
Requires-Dist: mypy; extra == "dev"
|
|
54
|
+
Requires-Dist: pytest>=6.0.0; extra == "dev"
|
|
55
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
56
|
+
Requires-Dist: flake8; extra == "dev"
|
|
57
|
+
Requires-Dist: flake8-comprehensions>=3.1.0; extra == "dev"
|
|
58
|
+
Requires-Dist: black; extra == "dev"
|
|
59
|
+
Requires-Dist: coverage; extra == "dev"
|
|
60
|
+
Requires-Dist: isort; extra == "dev"
|
|
61
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
62
|
+
Requires-Dist: codecov; extra == "dev"
|
|
63
|
+
Requires-Dist: tomli; extra == "dev"
|
|
64
|
+
Requires-Dist: pysindy>=2.1.0; extra == "dev"
|
|
65
|
+
Dynamic: license-file
|
|
66
|
+
|
|
67
|
+
# Dynamics Experiments
|
|
68
|
+
|
|
69
|
+
A library for constructing dynamics experiments.
|
|
70
|
+
This includes data generation and plotting/evaluation.
|
|
71
|
+
|
|
72
|
+
## Getting started
|
|
73
|
+
|
|
74
|
+
It's not yet on PyPI, so install it with `pip install sindy_exp @ git+https://github.com/Jacob-Stevens-Haas/sindy-experiments`
|
|
75
|
+
|
|
76
|
+
Generate data
|
|
77
|
+
|
|
78
|
+
data = sindy_exp.data.gen_data("lorenz", num_trajectories=5, t_end=10.0, dt=0.01)["data]
|
|
79
|
+
|
|
80
|
+
Evaluate your SINDy-like model with:
|
|
81
|
+
|
|
82
|
+
sindy_exp.odes.fit_eval(model, data)
|
|
83
|
+
|
|
84
|
+

|
|
85
|
+
|
|
86
|
+
A list of available ODE systems can be found in `ODE_CLASSES`, which includes most
|
|
87
|
+
of the systems from the [dysts package](https://pypi.org/project/dysts/) as well as some non-chaotic systems.
|
|
88
|
+
|
|
89
|
+
## ODE representation
|
|
90
|
+
|
|
91
|
+
We deal primarily with autonomous ODE systems of the form:
|
|
92
|
+
|
|
93
|
+
dx/dt = sum_i f_i(x)
|
|
94
|
+
|
|
95
|
+
Thus, we represent ODE systems as a list of right-hand side expressions.
|
|
96
|
+
Each element is a dictionary mapping a term (Sympy expression) to its coefficient.
|
|
97
|
+
|
|
98
|
+
## Other useful imports, compatibility, and extensions
|
|
99
|
+
|
|
100
|
+
This is built to be compatible with dynamics learning models that follow the
|
|
101
|
+
pysindy _BaseSINDy interface.
|
|
102
|
+
The experiments are also built to be compatible with the `mitosis` tool,
|
|
103
|
+
an experiment runner.
|
|
104
|
+
To integrate your own experiments or data generation in a way that is compatible,
|
|
105
|
+
see the `ProbData` and `DynamicsTrialData` classes.
|
|
106
|
+
For plotting tools, see `plot_coefficients`, `compare_coefficient_plots_from_dicts`,
|
|
107
|
+
`plot_test_trajectory`, `plot_training_data`, and `COLOR`.
|
|
108
|
+
For metrics, see `coeff_metrics`, `pred_metrics`, and `integration_metrics`.
|
|
109
|
+
|
|
110
|
+

|
|
111
|
+

|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Dynamics Experiments
|
|
2
|
+
|
|
3
|
+
A library for constructing dynamics experiments.
|
|
4
|
+
This includes data generation and plotting/evaluation.
|
|
5
|
+
|
|
6
|
+
## Getting started
|
|
7
|
+
|
|
8
|
+
It's not yet on PyPI, so install it with `pip install sindy_exp @ git+https://github.com/Jacob-Stevens-Haas/sindy-experiments`
|
|
9
|
+
|
|
10
|
+
Generate data
|
|
11
|
+
|
|
12
|
+
data = sindy_exp.data.gen_data("lorenz", num_trajectories=5, t_end=10.0, dt=0.01)["data]
|
|
13
|
+
|
|
14
|
+
Evaluate your SINDy-like model with:
|
|
15
|
+
|
|
16
|
+
sindy_exp.odes.fit_eval(model, data)
|
|
17
|
+
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
A list of available ODE systems can be found in `ODE_CLASSES`, which includes most
|
|
21
|
+
of the systems from the [dysts package](https://pypi.org/project/dysts/) as well as some non-chaotic systems.
|
|
22
|
+
|
|
23
|
+
## ODE representation
|
|
24
|
+
|
|
25
|
+
We deal primarily with autonomous ODE systems of the form:
|
|
26
|
+
|
|
27
|
+
dx/dt = sum_i f_i(x)
|
|
28
|
+
|
|
29
|
+
Thus, we represent ODE systems as a list of right-hand side expressions.
|
|
30
|
+
Each element is a dictionary mapping a term (Sympy expression) to its coefficient.
|
|
31
|
+
|
|
32
|
+
## Other useful imports, compatibility, and extensions
|
|
33
|
+
|
|
34
|
+
This is built to be compatible with dynamics learning models that follow the
|
|
35
|
+
pysindy _BaseSINDy interface.
|
|
36
|
+
The experiments are also built to be compatible with the `mitosis` tool,
|
|
37
|
+
an experiment runner.
|
|
38
|
+
To integrate your own experiments or data generation in a way that is compatible,
|
|
39
|
+
see the `ProbData` and `DynamicsTrialData` classes.
|
|
40
|
+
For plotting tools, see `plot_coefficients`, `compare_coefficient_plots_from_dicts`,
|
|
41
|
+
`plot_test_trajectory`, `plot_training_data`, and `COLOR`.
|
|
42
|
+
For metrics, see `coeff_metrics`, `pred_metrics`, and `integration_metrics`.
|
|
43
|
+
|
|
44
|
+

|
|
45
|
+

|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=62", "setuptools_scm[toml]>=6.2"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "sindy-exp"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "A basic library for constructing dynamics experiments"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = {file = "LICENSE"}
|
|
12
|
+
keywords = ["Machine Learning", "Science", "Mathematics", "Experiments"]
|
|
13
|
+
authors = [
|
|
14
|
+
{email = "jacob.stevens.haas@gmail.com", name = "Jake Stevens-Haas"}
|
|
15
|
+
]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Programming Language :: Python",
|
|
19
|
+
"Framework :: Jupyter",
|
|
20
|
+
"Intended Audience :: Science/Research",
|
|
21
|
+
"License :: OSI Approved :: MIT License",
|
|
22
|
+
"Natural Language :: English",
|
|
23
|
+
"Operating System :: POSIX :: Linux",
|
|
24
|
+
]
|
|
25
|
+
dependencies = [
|
|
26
|
+
"matplotlib",
|
|
27
|
+
"numpy >= 2.0.0",
|
|
28
|
+
"seaborn",
|
|
29
|
+
"scipy",
|
|
30
|
+
"sympy",
|
|
31
|
+
"dysts",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[project.optional-dependencies]
|
|
35
|
+
jax = [
|
|
36
|
+
"jax[cuda12]",
|
|
37
|
+
"diffrax",
|
|
38
|
+
"sympy2jax",
|
|
39
|
+
"typing_extensions"
|
|
40
|
+
]
|
|
41
|
+
dev = [
|
|
42
|
+
"ipykernel",
|
|
43
|
+
"mypy",
|
|
44
|
+
"pytest >= 6.0.0",
|
|
45
|
+
"pytest-cov",
|
|
46
|
+
"flake8",
|
|
47
|
+
"flake8-comprehensions>=3.1.0",
|
|
48
|
+
"black",
|
|
49
|
+
"coverage",
|
|
50
|
+
"isort",
|
|
51
|
+
"pre-commit",
|
|
52
|
+
"codecov",
|
|
53
|
+
"tomli",
|
|
54
|
+
"pysindy>=2.1.0",
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
[project.urls]
|
|
58
|
+
homepage = "https://github.com/Jake-Stevens-Haas/gen-experiments"
|
|
59
|
+
|
|
60
|
+
[tool.setuptools_scm]
|
|
61
|
+
|
|
62
|
+
[tool.black]
|
|
63
|
+
line-length = 88
|
|
64
|
+
extend-exclude = '''
|
|
65
|
+
/(
|
|
66
|
+
\.git
|
|
67
|
+
| \.mypy_cache
|
|
68
|
+
| \.venv
|
|
69
|
+
| .vscode
|
|
70
|
+
| version.py
|
|
71
|
+
| build
|
|
72
|
+
| dist
|
|
73
|
+
| scratch
|
|
74
|
+
| env
|
|
75
|
+
)/
|
|
76
|
+
'''
|
|
77
|
+
preview = true
|
|
78
|
+
|
|
79
|
+
[tool.codespell]
|
|
80
|
+
skip = '*.html,./env,./scratch/*,todo'
|
|
81
|
+
ignore-words-list = "nd, aks, ser"
|
|
82
|
+
|
|
83
|
+
[tool.isort]
|
|
84
|
+
profile = "black"
|
|
85
|
+
src_paths = ["src/sindy_exp", "tests"]
|
|
86
|
+
|
|
87
|
+
[tool.pytest.ini_options]
|
|
88
|
+
filterwarnings = [
|
|
89
|
+
"ignore::RuntimeWarning",
|
|
90
|
+
"ignore::UserWarning",]
|
|
91
|
+
addopts = '-m "not slow"'
|
|
92
|
+
markers = ["slow"]
|
|
93
|
+
|
|
94
|
+
[tool.mypy]
|
|
95
|
+
files = [
|
|
96
|
+
"src/sindy_exp/__init__.py",
|
|
97
|
+
"src/sindy_exp/_utils.py",
|
|
98
|
+
"tests/test_all.py",
|
|
99
|
+
]
|
|
100
|
+
|
|
101
|
+
[[tool.mypy.overrides]]
|
|
102
|
+
module="sklearn.*"
|
|
103
|
+
ignore_missing_imports=true
|
|
104
|
+
|
|
105
|
+
[[tool.mypy.overrides]]
|
|
106
|
+
module="pysindy.*"
|
|
107
|
+
ignore_missing_imports=true
|
|
108
|
+
|
|
109
|
+
[[tool.mypy.overrides]]
|
|
110
|
+
module="sympy.*"
|
|
111
|
+
ignore_missing_imports=true
|
|
112
|
+
|
|
113
|
+
[[tool.mypy.overrides]]
|
|
114
|
+
module="scipy.*"
|
|
115
|
+
ignore_missing_imports=true
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[flake8]
|
|
2
|
+
exclude =
|
|
3
|
+
.git,
|
|
4
|
+
env,
|
|
5
|
+
dist,
|
|
6
|
+
build,
|
|
7
|
+
site-packages,
|
|
8
|
+
bin,
|
|
9
|
+
scratch,
|
|
10
|
+
debug*,
|
|
11
|
+
composite_plots*,
|
|
12
|
+
__pycache__
|
|
13
|
+
ignore =
|
|
14
|
+
W503
|
|
15
|
+
E704
|
|
16
|
+
E203
|
|
17
|
+
max-line-length = 88
|
|
18
|
+
import-order-style = smarkets
|
|
19
|
+
statistics = True
|
|
20
|
+
count = True
|
|
21
|
+
verbose = 1
|
|
22
|
+
|
|
23
|
+
[egg_info]
|
|
24
|
+
tag_build =
|
|
25
|
+
tag_date = 0
|
|
26
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from ._data import ODE_CLASSES, gen_data
|
|
2
|
+
from ._odes import fit_eval, plot_ode_panel
|
|
3
|
+
from ._plotting import (
|
|
4
|
+
COLOR,
|
|
5
|
+
compare_coefficient_plots_from_dicts,
|
|
6
|
+
plot_coefficients,
|
|
7
|
+
plot_test_trajectory,
|
|
8
|
+
plot_training_data,
|
|
9
|
+
)
|
|
10
|
+
from ._typing import DynamicsTrialData, ProbData
|
|
11
|
+
from ._utils import coeff_metrics, integration_metrics, pred_metrics
|
|
12
|
+
|
|
13
|
+
__all__ = [
|
|
14
|
+
"gen_data",
|
|
15
|
+
"fit_eval",
|
|
16
|
+
"ProbData",
|
|
17
|
+
"DynamicsTrialData",
|
|
18
|
+
"coeff_metrics",
|
|
19
|
+
"pred_metrics",
|
|
20
|
+
"integration_metrics",
|
|
21
|
+
"ODE_CLASSES",
|
|
22
|
+
"plot_ode_panel",
|
|
23
|
+
"plot_coefficients",
|
|
24
|
+
"compare_coefficient_plots_from_dicts",
|
|
25
|
+
"plot_test_trajectory",
|
|
26
|
+
"plot_training_data",
|
|
27
|
+
"COLOR",
|
|
28
|
+
]
|