laddu 0.1.17__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 (110) hide show
  1. laddu-0.1.17/.github/workflows/benchmark.yml +33 -0
  2. laddu-0.1.17/.github/workflows/coverage.yml +80 -0
  3. laddu-0.1.17/.github/workflows/maturin.yml +195 -0
  4. laddu-0.1.17/.github/workflows/release-plz.yml +30 -0
  5. laddu-0.1.17/.github/workflows/rust.yml +25 -0
  6. laddu-0.1.17/.gitignore +195 -0
  7. laddu-0.1.17/.justfile +32 -0
  8. laddu-0.1.17/.pytest.ini +2 -0
  9. laddu-0.1.17/.readthedocs.yaml +23 -0
  10. laddu-0.1.17/.ruff.toml +77 -0
  11. laddu-0.1.17/CHANGELOG.md +362 -0
  12. laddu-0.1.17/Cargo.lock +2473 -0
  13. laddu-0.1.17/Cargo.toml +92 -0
  14. laddu-0.1.17/LICENSE-APACHE +202 -0
  15. laddu-0.1.17/LICENSE-MIT +21 -0
  16. laddu-0.1.17/PKG-INFO +350 -0
  17. laddu-0.1.17/README.md +321 -0
  18. laddu-0.1.17/benches/bench.parquet +0 -0
  19. laddu-0.1.17/benches/kmatrix_benchmark.rs +181 -0
  20. laddu-0.1.17/benches/open_benchmark.rs +13 -0
  21. laddu-0.1.17/bin/amptools-to-laddu +139 -0
  22. laddu-0.1.17/codecov.yml +2 -0
  23. laddu-0.1.17/docs/Makefile +20 -0
  24. laddu-0.1.17/docs/docs-header.html +33 -0
  25. laddu-0.1.17/docs/make.bat +35 -0
  26. laddu-0.1.17/docs/source/conf.py +42 -0
  27. laddu-0.1.17/docs/source/index.rst +13 -0
  28. laddu-0.1.17/docs/source/modules/index.rst +12 -0
  29. laddu-0.1.17/docs/source/modules/laddu/amplitudes/breit_wigner.rst +6 -0
  30. laddu-0.1.17/docs/source/modules/laddu/amplitudes/common.rst +6 -0
  31. laddu-0.1.17/docs/source/modules/laddu/amplitudes/index.rst +18 -0
  32. laddu-0.1.17/docs/source/modules/laddu/amplitudes/kmatrix.rst +6 -0
  33. laddu-0.1.17/docs/source/modules/laddu/amplitudes/piecewise.rst +6 -0
  34. laddu-0.1.17/docs/source/modules/laddu/amplitudes/ylm.rst +6 -0
  35. laddu-0.1.17/docs/source/modules/laddu/amplitudes/zlm.rst +6 -0
  36. laddu-0.1.17/docs/source/modules/laddu/data.rst +6 -0
  37. laddu-0.1.17/docs/source/modules/laddu/likelihoods.rst +6 -0
  38. laddu-0.1.17/docs/source/modules/laddu/utils/index.rst +9 -0
  39. laddu-0.1.17/docs/source/modules/laddu/utils/variables.rst +6 -0
  40. laddu-0.1.17/docs/source/modules/laddu/utils/vectors.rst +6 -0
  41. laddu-0.1.17/docs/source/tutorials/binned_fit.rst +4 -0
  42. laddu-0.1.17/docs/source/tutorials/index.rst +11 -0
  43. laddu-0.1.17/docs/source/tutorials/live_plotting.rst +4 -0
  44. laddu-0.1.17/docs/source/tutorials/unbinned_fit.rst +325 -0
  45. laddu-0.1.17/docs/source/tutorials/unbinned_fit_efficiency.png +0 -0
  46. laddu-0.1.17/docs/source/tutorials/unbinned_fit_mass_angle_plot.png +0 -0
  47. laddu-0.1.17/docs/source/tutorials/unbinned_fit_result.png +0 -0
  48. laddu-0.1.17/docs/source/tutorials/unbinned_fit_result_acceptance_corrected.png +0 -0
  49. laddu-0.1.17/media/logo.png +0 -0
  50. laddu-0.1.17/media/logo.svg +121 -0
  51. laddu-0.1.17/media/wordmark.png +0 -0
  52. laddu-0.1.17/media/wordmark.svg +170 -0
  53. laddu-0.1.17/pyproject.toml +33 -0
  54. laddu-0.1.17/python/laddu/__init__.py +122 -0
  55. laddu-0.1.17/python/laddu/__init__.pyi +95 -0
  56. laddu-0.1.17/python/laddu/amplitudes/__init__.py +30 -0
  57. laddu-0.1.17/python/laddu/amplitudes/__init__.pyi +81 -0
  58. laddu-0.1.17/python/laddu/amplitudes/breit_wigner/__init__.py +3 -0
  59. laddu-0.1.17/python/laddu/amplitudes/breit_wigner/__init__.pyi +14 -0
  60. laddu-0.1.17/python/laddu/amplitudes/common/__init__.py +3 -0
  61. laddu-0.1.17/python/laddu/amplitudes/common/__init__.pyi +7 -0
  62. laddu-0.1.17/python/laddu/amplitudes/kmatrix/__init__.py +17 -0
  63. laddu-0.1.17/python/laddu/amplitudes/kmatrix/__init__.pyi +61 -0
  64. laddu-0.1.17/python/laddu/amplitudes/piecewise/__init__.py +7 -0
  65. laddu-0.1.17/python/laddu/amplitudes/piecewise/__init__.pyi +24 -0
  66. laddu-0.1.17/python/laddu/amplitudes/ylm/__init__.py +3 -0
  67. laddu-0.1.17/python/laddu/amplitudes/ylm/__init__.pyi +27 -0
  68. laddu-0.1.17/python/laddu/amplitudes/zlm/__init__.py +3 -0
  69. laddu-0.1.17/python/laddu/amplitudes/zlm/__init__.pyi +50 -0
  70. laddu-0.1.17/python/laddu/convert.py +164 -0
  71. laddu-0.1.17/python/laddu/data/__init__.py +3 -0
  72. laddu-0.1.17/python/laddu/data/__init__.pyi +38 -0
  73. laddu-0.1.17/python/laddu/likelihoods/__init__.py +29 -0
  74. laddu-0.1.17/python/laddu/likelihoods/__init__.pyi +221 -0
  75. laddu-0.1.17/python/laddu/py.typed +0 -0
  76. laddu-0.1.17/python/laddu/utils/__init__.py +3 -0
  77. laddu-0.1.17/python/laddu/utils/variables/__init__.py +21 -0
  78. laddu-0.1.17/python/laddu/utils/variables/__init__.pyi +105 -0
  79. laddu-0.1.17/python/laddu/utils/vectors/__init__.py +3 -0
  80. laddu-0.1.17/python/laddu/utils/vectors/__init__.pyi +53 -0
  81. laddu-0.1.17/python/tests/test_amplitudes.py +184 -0
  82. laddu-0.1.17/python/tests/test_breit_wigner.py +49 -0
  83. laddu-0.1.17/python/tests/test_common.py +111 -0
  84. laddu-0.1.17/python/tests/test_data.py +122 -0
  85. laddu-0.1.17/python/tests/test_kmatrix.py +337 -0
  86. laddu-0.1.17/python/tests/test_piecewise.py +190 -0
  87. laddu-0.1.17/python/tests/test_serde.py +89 -0
  88. laddu-0.1.17/python/tests/test_variables.py +132 -0
  89. laddu-0.1.17/python/tests/test_vectors.py +90 -0
  90. laddu-0.1.17/python/tests/test_ylm.py +44 -0
  91. laddu-0.1.17/python/tests/test_zlm.py +46 -0
  92. laddu-0.1.17/src/amplitudes/breit_wigner.rs +170 -0
  93. laddu-0.1.17/src/amplitudes/common.rs +296 -0
  94. laddu-0.1.17/src/amplitudes/kmatrix.rs +1315 -0
  95. laddu-0.1.17/src/amplitudes/mod.rs +837 -0
  96. laddu-0.1.17/src/amplitudes/piecewise.rs +553 -0
  97. laddu-0.1.17/src/amplitudes/ylm.rs +120 -0
  98. laddu-0.1.17/src/amplitudes/zlm.rs +152 -0
  99. laddu-0.1.17/src/data.rs +645 -0
  100. laddu-0.1.17/src/lib.rs +508 -0
  101. laddu-0.1.17/src/likelihoods.rs +1466 -0
  102. laddu-0.1.17/src/python.rs +5328 -0
  103. laddu-0.1.17/src/resources.rs +702 -0
  104. laddu-0.1.17/src/utils/enums.rs +162 -0
  105. laddu-0.1.17/src/utils/functions.rs +321 -0
  106. laddu-0.1.17/src/utils/mod.rs +58 -0
  107. laddu-0.1.17/src/utils/variables.rs +593 -0
  108. laddu-0.1.17/src/utils/vectors.rs +352 -0
  109. laddu-0.1.17/test_data/data.parquet +0 -0
  110. laddu-0.1.17/test_data/mc.parquet +0 -0
@@ -0,0 +1,33 @@
1
+ name: CodSpeed
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - "main"
7
+ pull_request:
8
+ # `workflow_dispatch` allows CodSpeed to trigger backtest
9
+ # performance analysis in order to generate initial data.
10
+ workflow_dispatch:
11
+
12
+ jobs:
13
+ benchmarks:
14
+ name: Run benchmarks
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Setup rust toolchain, cache and cargo-codspeed binary
20
+ uses: moonrepo/setup-rust@v1
21
+ with:
22
+ channel: stable
23
+ cache-target: release
24
+ bins: cargo-codspeed
25
+
26
+ - name: Build the benchmark target(s)
27
+ run: cargo codspeed build --profile bench
28
+
29
+ - name: Run the benchmarks
30
+ uses: CodSpeedHQ/action@v3
31
+ with:
32
+ run: cargo codspeed run
33
+ token: ${{ secrets.CODSPEED_TOKEN }}
@@ -0,0 +1,80 @@
1
+ name: Coverage
2
+
3
+ on:
4
+ pull_request:
5
+ paths:
6
+ - '**.rs'
7
+ - '**.py'
8
+ - '.github/workflows/coverage.yml'
9
+ push:
10
+ branches:
11
+ - main
12
+ paths:
13
+ - '**.rs'
14
+ - '**.py'
15
+ - '.github/workflows/coverage.yml'
16
+ workflow_call:
17
+ secrets:
18
+ codecov_token:
19
+ required: true
20
+ workflow_dispatch:
21
+ jobs:
22
+ coverage-rust:
23
+ runs-on: ubuntu-latest
24
+ env:
25
+ CARGO_TERM_COLOR: always
26
+ steps:
27
+ - uses: actions/checkout@v4
28
+ - name: Install Rust
29
+ run: rustup update stable
30
+ - name: Install cargo-llvm-cov
31
+ uses: taiki-e/install-action@cargo-llvm-cov
32
+ - name: Generate Rust code coverage
33
+ run: cargo llvm-cov --workspace --lcov --output-path coverage-rust.lcov
34
+ - name: Upload coverage report
35
+ uses: actions/upload-artifact@v4
36
+ with:
37
+ name: coverage-rust
38
+ path: coverage-rust.lcov
39
+ coverage-python:
40
+ runs-on: ubuntu-latest
41
+ steps:
42
+ - uses: actions/checkout@v4
43
+ - name: Install uv
44
+ uses: astral-sh/setup-uv@v4
45
+ - name: Set up Python
46
+ run: |
47
+ uv python install
48
+ uv venv
49
+ source .venv/bin/activate
50
+ - name: Build wheels
51
+ uses: PyO3/maturin-action@v1
52
+ with:
53
+ command: develop
54
+ args: -r --uv
55
+ - name: Install pytest
56
+ run: uv pip install pytest pytest-cov
57
+ - name: Generate Python code coverage
58
+ run: .venv/bin/pytest --cov --cov-report xml:coverage-python.xml
59
+ - name: Upload coverage report
60
+ uses: actions/upload-artifact@v4
61
+ with:
62
+ name: coverage-python
63
+ path: coverage-python.xml
64
+ upload-coverage:
65
+ needs: [coverage-rust, coverage-python]
66
+ runs-on: ubuntu-latest
67
+ steps:
68
+ - uses: actions/checkout@v4
69
+ - name: Download coverage reports
70
+ uses: actions/download-artifact@v4
71
+ with:
72
+ merge-multiple: true
73
+ - name: Upload coverage reports to Codecov
74
+ uses: codecov/codecov-action@v5
75
+ with:
76
+ token: ${{ secrets.CODECOV_TOKEN }}
77
+ files: coverage-rust.lcov,coverage-python.xml
78
+ fail_ci_if_error: true
79
+ verbose: true
80
+ root_dir: ${{ github.workspace }}
@@ -0,0 +1,195 @@
1
+ # This file is autogenerated by maturin v1.7.3
2
+ # To update, run
3
+ #
4
+ # maturin generate-ci github -o .github/workflows/maturin.yml
5
+ #
6
+ name: CI
7
+
8
+ on:
9
+ push:
10
+ branches:
11
+ - main
12
+ - master
13
+ tags:
14
+ - '*'
15
+ pull_request:
16
+ workflow_dispatch:
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ jobs:
22
+ test:
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@v4
28
+ - name: Set up Python
29
+ run: |
30
+ uv python install
31
+ uv venv
32
+ source .venv/bin/activate
33
+ - name: Build wheels
34
+ uses: PyO3/maturin-action@v1
35
+ with:
36
+ command: develop
37
+ args: -r --uv
38
+ - name: Install pytest
39
+ run: uv pip install pytest
40
+ - name: Run tests
41
+ run: .venv/bin/pytest
42
+
43
+ linux:
44
+ needs: test
45
+ runs-on: ${{ matrix.platform.runner }}
46
+ strategy:
47
+ matrix:
48
+ platform:
49
+ - runner: ubuntu-latest
50
+ target: x86_64
51
+ - runner: ubuntu-latest
52
+ target: x86
53
+ - runner: ubuntu-latest
54
+ target: aarch64
55
+ - runner: ubuntu-latest
56
+ target: armv7
57
+ - runner: ubuntu-latest
58
+ target: s390x
59
+ - runner: ubuntu-latest
60
+ target: ppc64le
61
+ steps:
62
+ - uses: actions/checkout@v4
63
+ - uses: actions/setup-python@v5
64
+ with:
65
+ python-version: 3.x
66
+ - name: Build wheels
67
+ uses: PyO3/maturin-action@v1
68
+ with:
69
+ target: ${{ matrix.platform.target }}
70
+ args: --release --out dist
71
+ sccache: 'true'
72
+ manylinux: auto
73
+ - name: Upload wheels
74
+ uses: actions/upload-artifact@v4
75
+ with:
76
+ name: wheels-linux-${{ matrix.platform.target }}
77
+ path: dist
78
+
79
+ musllinux:
80
+ needs: test
81
+ runs-on: ${{ matrix.platform.runner }}
82
+ strategy:
83
+ matrix:
84
+ platform:
85
+ - runner: ubuntu-latest
86
+ target: x86_64
87
+ - runner: ubuntu-latest
88
+ target: x86
89
+ - runner: ubuntu-latest
90
+ target: aarch64
91
+ - runner: ubuntu-latest
92
+ target: armv7
93
+ steps:
94
+ - uses: actions/checkout@v4
95
+ - uses: actions/setup-python@v5
96
+ with:
97
+ python-version: 3.x
98
+ - name: Build wheels
99
+ uses: PyO3/maturin-action@v1
100
+ with:
101
+ target: ${{ matrix.platform.target }}
102
+ args: --release --out dist
103
+ sccache: 'true'
104
+ manylinux: musllinux_1_2
105
+ - name: Upload wheels
106
+ uses: actions/upload-artifact@v4
107
+ with:
108
+ name: wheels-musllinux-${{ matrix.platform.target }}
109
+ path: dist
110
+
111
+ windows:
112
+ needs: test
113
+ runs-on: ${{ matrix.platform.runner }}
114
+ strategy:
115
+ matrix:
116
+ platform:
117
+ - runner: windows-latest
118
+ target: x64
119
+ # - runner: windows-latest
120
+ # target: x86
121
+ steps:
122
+ - uses: actions/checkout@v4
123
+ - uses: actions/setup-python@v5
124
+ with:
125
+ python-version: 3.x
126
+ architecture: ${{ matrix.platform.target }}
127
+ - name: Build wheels
128
+ uses: PyO3/maturin-action@v1
129
+ with:
130
+ target: ${{ matrix.platform.target }}
131
+ args: --release --out dist
132
+ sccache: 'true'
133
+ - name: Upload wheels
134
+ uses: actions/upload-artifact@v4
135
+ with:
136
+ name: wheels-windows-${{ matrix.platform.target }}
137
+ path: dist
138
+
139
+ macos:
140
+ needs: test
141
+ runs-on: ${{ matrix.platform.runner }}
142
+ strategy:
143
+ matrix:
144
+ platform:
145
+ - runner: macos-13
146
+ target: x86_64
147
+ - runner: macos-latest
148
+ target: aarch64
149
+ steps:
150
+ - uses: actions/checkout@v4
151
+ - uses: actions/setup-python@v5
152
+ with:
153
+ python-version: 3.x
154
+ - name: Build wheels
155
+ uses: PyO3/maturin-action@v1
156
+ with:
157
+ target: ${{ matrix.platform.target }}
158
+ args: --release --out dist
159
+ sccache: 'true'
160
+ - name: Upload wheels
161
+ uses: actions/upload-artifact@v4
162
+ with:
163
+ name: wheels-macos-${{ matrix.platform.target }}
164
+ path: dist
165
+
166
+ sdist:
167
+ needs: test
168
+ runs-on: ubuntu-latest
169
+ steps:
170
+ - uses: actions/checkout@v4
171
+ - name: Build sdist
172
+ uses: PyO3/maturin-action@v1
173
+ with:
174
+ command: sdist
175
+ args: --out dist
176
+ - name: Upload sdist
177
+ uses: actions/upload-artifact@v4
178
+ with:
179
+ name: wheels-sdist
180
+ path: dist
181
+
182
+ release:
183
+ name: Release
184
+ runs-on: ubuntu-latest
185
+ # if: "startsWith(github.ref, 'refs/tags/')"
186
+ needs: [linux, musllinux, windows, macos, sdist]
187
+ steps:
188
+ - uses: actions/download-artifact@v4
189
+ - name: Publish to PyPI
190
+ uses: PyO3/maturin-action@v1
191
+ env:
192
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
193
+ with:
194
+ command: upload
195
+ args: --non-interactive --skip-existing wheels-*/*
@@ -0,0 +1,30 @@
1
+ name: Release Plz
2
+
3
+ permissions:
4
+ pull-requests: write
5
+ contents: write
6
+
7
+ on:
8
+ push:
9
+ branches:
10
+ - main
11
+
12
+ jobs:
13
+ release-plz:
14
+ name: Release-plz
15
+ runs-on: ubuntu-latest
16
+ concurrency:
17
+ group: release-plz-${{ github.ref }}
18
+ cancel-in-progress: false
19
+ steps:
20
+ - name: Checkout repository
21
+ uses: actions/checkout@v4
22
+ with:
23
+ fetch-depth: 0
24
+ - name: Install Rust toolchain
25
+ uses: dtolnay/rust-toolchain@stable
26
+ - name: Run release-plz
27
+ uses: MarcoIeni/release-plz-action@v0.5
28
+ env:
29
+ GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
30
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
@@ -0,0 +1,25 @@
1
+ name: Rust
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ branches: [ "main" ]
7
+
8
+ env:
9
+ CARGO_TERM_COLOR: always
10
+
11
+ jobs:
12
+ build:
13
+
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - name: Install cargo-hack
19
+ uses: taiki-e/install-action@cargo-hack
20
+ - name: Run checks
21
+ run: cargo hack check --rust-version --each-feature --no-dev-deps
22
+ - name: Build
23
+ run: cargo build -r --verbose
24
+ - name: Run tests
25
+ run: cargo hack test --verbose --each-feature
@@ -0,0 +1,195 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110
+ .pdm.toml
111
+ .pdm-python
112
+ .pdm-build/
113
+
114
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115
+ __pypackages__/
116
+
117
+ # Celery stuff
118
+ celerybeat-schedule
119
+ celerybeat.pid
120
+
121
+ # SageMath parsed files
122
+ *.sage.py
123
+
124
+ # Environments
125
+ .env
126
+ .venv
127
+ env/
128
+ venv/
129
+ ENV/
130
+ env.bak/
131
+ venv.bak/
132
+
133
+ # Spyder project settings
134
+ .spyderproject
135
+ .spyproject
136
+
137
+ # Rope project settings
138
+ .ropeproject
139
+
140
+ # mkdocs documentation
141
+ /site
142
+
143
+ # mypy
144
+ .mypy_cache/
145
+ .dmypy.json
146
+ dmypy.json
147
+
148
+ # Pyre type checker
149
+ .pyre/
150
+
151
+ # pytype static type analyzer
152
+ .pytype/
153
+
154
+ # Cython debug symbols
155
+ cython_debug/
156
+
157
+ # PyCharm
158
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
161
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
162
+ #.idea/
163
+
164
+ uv.lock
165
+
166
+ .DS_Store
167
+
168
+ # Generated by Cargo
169
+ # will have compiled files and executables
170
+ debug/
171
+ target/
172
+
173
+ # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
174
+ # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
175
+ Cargo.lock
176
+
177
+ # These are backup files generated by rustfmt
178
+ **/*.rs.bk
179
+
180
+ # MSVC Windows builds of rustc generate these, which store debugging information
181
+ *.pdb
182
+
183
+ # RustRover
184
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
185
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
186
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
187
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
188
+ #.idea/
189
+
190
+ # Others
191
+ demos/
192
+ src/main.rs
193
+ *.perf.*
194
+ perf.*
195
+ *.pkl
laddu-0.1.17/.justfile ADDED
@@ -0,0 +1,32 @@
1
+ default:
2
+ just --list
3
+
4
+ develop:
5
+ CARGO_INCREMENTAL=true maturin develop -r --uv --strip
6
+
7
+ builddocs:
8
+ CARGO_INCREMENTAL=true maturin build -r --strip
9
+ uv pip install ./target/wheels/*
10
+ make -C docs clean
11
+ make -C docs html
12
+
13
+ makedocs:
14
+ make -C docs clean
15
+ make -C docs html
16
+
17
+ odoc:
18
+ firefox ./docs/build/html/index.html
19
+
20
+ clean:
21
+ cargo clean
22
+
23
+ profile:
24
+ RUSTFLAGS='-C force-frame-pointers=y' cargo build --profile perf
25
+ perf record -g target/perf/laddu
26
+ perf annotate -v --asm-raw --stdio
27
+ perf report -g graph,0.5,caller
28
+
29
+ popen:
30
+ mv firefox.perf.data firefox.perf.data.old
31
+ perf script --input=perf.data -F +pid > firefox.perf.data
32
+ firefox https://profiler.firefox.com
@@ -0,0 +1,2 @@
1
+ [pytest]
2
+ testpaths = python/tests
@@ -0,0 +1,23 @@
1
+ # .readthedocs.yaml
2
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3
+
4
+ version: 2
5
+
6
+ build:
7
+ os: ubuntu-24.04
8
+ tools:
9
+ python: "3.12"
10
+ rust: "latest"
11
+
12
+ sphinx:
13
+ configuration: docs/source/conf.py
14
+
15
+ formats:
16
+ - pdf
17
+
18
+ python:
19
+ install:
20
+ - method: pip
21
+ path: .
22
+ extra_requirements:
23
+ - docs
@@ -0,0 +1,77 @@
1
+ # Exclude a variety of commonly ignored directories.
2
+ exclude = [
3
+ ".bzr",
4
+ ".direnv",
5
+ ".eggs",
6
+ ".git",
7
+ ".git-rewrite",
8
+ ".hg",
9
+ ".ipynb_checkpoints",
10
+ ".mypy_cache",
11
+ ".nox",
12
+ ".pants.d",
13
+ ".pyenv",
14
+ ".pytest_cache",
15
+ ".pytype",
16
+ ".ruff_cache",
17
+ ".svn",
18
+ ".tox",
19
+ ".venv",
20
+ ".vscode",
21
+ "__pypackages__",
22
+ "_build",
23
+ "buck-out",
24
+ "build",
25
+ "dist",
26
+ "node_modules",
27
+ "site-packages",
28
+ "venv",
29
+ ]
30
+
31
+ # Same as Black.
32
+ line-length = 90
33
+ indent-width = 4
34
+
35
+ # Assume Python 3.9
36
+ target-version = "py39"
37
+
38
+ [lint]
39
+ # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
40
+ # Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
41
+ # McCabe complexity (`C901`) by default.
42
+ select = ["E4", "E7", "E9", "F"]
43
+ ignore = []
44
+
45
+ # Allow fix for all enabled rules (when `--fix`) is provided.
46
+ fixable = ["ALL"]
47
+ unfixable = []
48
+
49
+ # Allow unused variables when underscore-prefixed.
50
+ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
51
+
52
+ [format]
53
+ # Like Black, use double quotes for strings.
54
+ quote-style = "single"
55
+
56
+ # Like Black, indent with spaces, rather than tabs.
57
+ indent-style = "space"
58
+
59
+ # Like Black, respect magic trailing commas.
60
+ skip-magic-trailing-comma = false
61
+
62
+ # Like Black, automatically detect the appropriate line ending.
63
+ line-ending = "auto"
64
+
65
+ # Enable auto-formatting of code examples in docstrings. Markdown,
66
+ # reStructuredText code/literal blocks and doctests are all supported.
67
+ #
68
+ # This is currently disabled by default, but it is planned for this
69
+ # to be opt-out in the future.
70
+ docstring-code-format = false
71
+
72
+ # Set the line length limit used when formatting code snippets in
73
+ # docstrings.
74
+ #
75
+ # This only has an effect when the `docstring-code-format` setting is
76
+ # enabled.
77
+ docstring-code-line-length = "dynamic"