gle-sim 0.1.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.
Files changed (39) hide show
  1. gle_sim-0.1.0/.github/workflows/publish.yml +96 -0
  2. gle_sim-0.1.0/.gitignore +152 -0
  3. gle_sim-0.1.0/Cargo.lock +517 -0
  4. gle_sim-0.1.0/Cargo.toml +32 -0
  5. gle_sim-0.1.0/PKG-INFO +321 -0
  6. gle_sim-0.1.0/Readme.md +302 -0
  7. gle_sim-0.1.0/gle_sim/__init__.py +137 -0
  8. gle_sim-0.1.0/gle_sim/config.py +1313 -0
  9. gle_sim-0.1.0/gle_sim/fit_kernel.py +50 -0
  10. gle_sim-0.1.0/pyproject.toml +23 -0
  11. gle_sim-0.1.0/showcase.ipynb +177 -0
  12. gle_sim-0.1.0/src/config.rs +704 -0
  13. gle_sim-0.1.0/src/funcs.rs +262 -0
  14. gle_sim-0.1.0/src/integrators.rs +720 -0
  15. gle_sim-0.1.0/src/kernels.rs +1160 -0
  16. gle_sim-0.1.0/src/lib.rs +396 -0
  17. gle_sim-0.1.0/src/pmfs.rs +247 -0
  18. gle_sim-0.1.0/test/_test_simulation_distributions.py +169 -0
  19. gle_sim-0.1.0/test/ala9_fe.npy +0 -0
  20. gle_sim-0.1.0/test/ala9_spl_m.npy +0 -0
  21. gle_sim-0.1.0/test/ala9_values.npy +0 -0
  22. gle_sim-0.1.0/test/benchmark.py +134 -0
  23. gle_sim-0.1.0/test/data/fe.npy +0 -0
  24. gle_sim-0.1.0/test/data/values.npy +0 -0
  25. gle_sim-0.1.0/test/ref_ala9_hb4.toml +5 -0
  26. gle_sim-0.1.0/test/ref_implementation_njit_exp.py +169 -0
  27. gle_sim-0.1.0/test/ref_implementation_njit_exposc.py +170 -0
  28. gle_sim-0.1.0/test/ref_implementation_vel_couple_pos_mem.py +271 -0
  29. gle_sim-0.1.0/test/test_euler_maruyama.py +169 -0
  30. gle_sim-0.1.0/test/test_forces.py +177 -0
  31. gle_sim-0.1.0/test/test_improved_euler.py +160 -0
  32. gle_sim-0.1.0/test/test_leapfrog.py +121 -0
  33. gle_sim-0.1.0/test/test_position_mass_config.py +118 -0
  34. gle_sim-0.1.0/test/test_runge_kutta_4.py +130 -0
  35. gle_sim-0.1.0/test/test_sample_init.py +57 -0
  36. gle_sim-0.1.0/test/test_sample_tps.py +48 -0
  37. gle_sim-0.1.0/test/test_save_load.py +64 -0
  38. gle_sim-0.1.0/test/utils.py +91 -0
  39. gle_sim-0.1.0/test_distr_fr.py +312 -0
@@ -0,0 +1,96 @@
1
+ name: Build Python package
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ workflow_dispatch:
8
+ release:
9
+ types: [published]
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ wheels:
16
+ name: Wheel (${{ matrix.target }}, CPython 3.10+ abi3)
17
+ runs-on: ${{ matrix.runner }}
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ include:
22
+ - runner: ubuntu-22.04
23
+ target: x86_64-unknown-linux-gnu
24
+ manylinux: '2014'
25
+ - runner: ubuntu-24.04-arm
26
+ target: aarch64-unknown-linux-gnu
27
+ manylinux: '2014'
28
+ - runner: windows-2022
29
+ target: x86_64-pc-windows-msvc
30
+ manylinux: 'off'
31
+ - runner: macos-15-intel
32
+ target: x86_64-apple-darwin
33
+ manylinux: 'off'
34
+ - runner: macos-15
35
+ target: aarch64-apple-darwin
36
+ manylinux: 'off'
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+ - uses: actions/setup-python@v5
40
+ with:
41
+ python-version: '3.10'
42
+ - name: Build wheel
43
+ uses: PyO3/maturin-action@v1
44
+ with:
45
+ command: build
46
+ target: ${{ matrix.target }}
47
+ manylinux: ${{ matrix.manylinux }}
48
+ # Build once per target against the CPython 3.10 stable ABI.
49
+ args: --release --locked --out dist --interpreter ${{ runner.os == 'Linux' && 'python3.10' || 'python' }}
50
+ - name: Install and smoke-test wheel
51
+ shell: bash
52
+ run: |
53
+ python -m pip install dist/*.whl
54
+ cd "$RUNNER_TEMP"
55
+ python - <<'PY'
56
+ import gle_sim
57
+ import numpy as np
58
+
59
+ config = gle_sim.Config.default()
60
+ config.pmf = gle_sim.Harmonic(k=1.0)
61
+ config.x0 = 1.0
62
+ config.v0 = 0.0
63
+ config.steps = 10
64
+ trajectory = gle_sim.integrate(config)
65
+ assert trajectory.shape == (11,), trajectory.shape
66
+ assert np.isfinite(trajectory).all()
67
+ PY
68
+ - name: Check stable ABI wheel tag
69
+ shell: bash
70
+ run: |
71
+ python - <<'PY'
72
+ from pathlib import Path
73
+ wheels = list(Path("dist").glob("*.whl"))
74
+ assert len(wheels) == 1, wheels
75
+ assert "-cp310-abi3-" in wheels[0].name, wheels[0].name
76
+ PY
77
+ - uses: actions/upload-artifact@v4
78
+ with:
79
+ name: wheels-${{ matrix.target }}
80
+ path: dist/*.whl
81
+ if-no-files-found: error
82
+
83
+ sdist:
84
+ name: Source distribution
85
+ runs-on: ubuntu-22.04
86
+ steps:
87
+ - uses: actions/checkout@v4
88
+ - uses: PyO3/maturin-action@v1
89
+ with:
90
+ command: sdist
91
+ args: --out dist
92
+ - uses: actions/upload-artifact@v4
93
+ with:
94
+ name: sdist
95
+ path: dist/*.tar.gz
96
+ if-no-files-found: error
@@ -0,0 +1,152 @@
1
+ Cargo.lock
2
+ benchmarker
3
+ target/
4
+ gle_sim/__pycache__
5
+ gle_sim/gle_sim.cpython*
6
+ test/__pycache__
7
+ test/benchmarks
8
+ test/benchmarks_plots
9
+ .vscode
10
+
11
+ # Byte-compiled / optimized / DLL files
12
+ __pycache__/
13
+ *.py[cod]
14
+ *$py.class
15
+ *.cpython-37.pyc
16
+ *.pyc
17
+ **.pyc
18
+
19
+ # C extensions
20
+ *.so
21
+ *.o
22
+
23
+ # Distribution / packaging
24
+ .Python
25
+ build/
26
+ develop-eggs/
27
+ dist/
28
+ downloads/
29
+ eggs/
30
+ .eggs/
31
+ lib/
32
+ lib64/
33
+ parts/
34
+ sdist/
35
+ var/
36
+ wheels/
37
+ share/python-wheels/
38
+ *.egg-info/
39
+ .installed.cfg
40
+ *.egg
41
+ MANIFEST
42
+
43
+ # PyInstaller
44
+ # Usually these files are written by a python script from a template
45
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
46
+ *.manifest
47
+ *.spec
48
+
49
+ # Installer logs
50
+ pip-log.txt
51
+ pip-delete-this-directory.txt
52
+
53
+ # Unit test / coverage reports
54
+ htmlcov/
55
+ .tox/
56
+ .nox/
57
+ .coverage
58
+ .coverage.*
59
+ .cache
60
+ nosetests.xml
61
+ coverage.xml
62
+ *.cover
63
+ *.py,cover
64
+ .hypothesis/
65
+ .pytest_cache/
66
+ cover/
67
+
68
+ # Translations
69
+ *.mo
70
+ *.pot
71
+
72
+ # Django stuff:
73
+ *.log
74
+ local_settings.py
75
+ db.sqlite3
76
+ db.sqlite3-journal
77
+
78
+ # Flask stuff:
79
+ instance/
80
+ .webassets-cache
81
+
82
+ # Scrapy stuff:
83
+ .scrapy
84
+
85
+ # Sphinx documentation
86
+ docs/_build/
87
+
88
+ # PyBuilder
89
+ .pybuilder/
90
+ target/
91
+
92
+ # Jupyter Notebook
93
+ .ipynb_checkpoints
94
+
95
+ # IPython
96
+ profile_default/
97
+ ipython_config.py
98
+
99
+ # pyenv
100
+ # For a library or package, you might want to ignore these files since the code is
101
+ # intended to run in multiple environments; otherwise, check them in:
102
+ # .python-version
103
+
104
+ # pipenv
105
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
106
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
107
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
108
+ # install all needed dependencies.
109
+ #Pipfile.lock
110
+
111
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
112
+ __pypackages__/
113
+
114
+ # Celery stuff
115
+ celerybeat-schedule
116
+ celerybeat.pid
117
+
118
+ # SageMath parsed files
119
+ *.sage.py
120
+
121
+ # Environments
122
+ .env
123
+ .venv
124
+ env/
125
+ venv/
126
+ ENV/
127
+ env.bak/
128
+ venv.bak/
129
+
130
+ # Spyder project settings
131
+ .spyderproject
132
+ .spyproject
133
+
134
+ # Rope project settings
135
+ .ropeproject
136
+
137
+ # mkdocs documentation
138
+ /site
139
+
140
+ # mypy
141
+ .mypy_cache/
142
+ .dmypy.json
143
+ dmypy.json
144
+
145
+ # Pyre type checker
146
+ .pyre/
147
+
148
+ # pytype static type analyzer
149
+ .pytype/
150
+
151
+ # Cython debug symbols
152
+ cython_debug/