pylinearcapr 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 (57) hide show
  1. pylinearcapr-0.1.0/.github/workflows/package.yml +266 -0
  2. pylinearcapr-0.1.0/.github/workflows/requirements.txt +3 -0
  3. pylinearcapr-0.1.0/.github/workflows/test.yml +166 -0
  4. pylinearcapr-0.1.0/.gitignore +167 -0
  5. pylinearcapr-0.1.0/.gitmodules +3 -0
  6. pylinearcapr-0.1.0/CHANGELOG.md +14 -0
  7. pylinearcapr-0.1.0/CMakeLists.txt +27 -0
  8. pylinearcapr-0.1.0/CONTRIBUTING.md +45 -0
  9. pylinearcapr-0.1.0/COPYING +21 -0
  10. pylinearcapr-0.1.0/PKG-INFO +206 -0
  11. pylinearcapr-0.1.0/README.md +169 -0
  12. pylinearcapr-0.1.0/include/linearcapr/__init__.pxd +22 -0
  13. pylinearcapr-0.1.0/include/linearcapr/energy_model.pxd +45 -0
  14. pylinearcapr-0.1.0/include/linearcapr/miscs.pxd +8 -0
  15. pylinearcapr-0.1.0/patches/LinCapR.hpp.patch +13 -0
  16. pylinearcapr-0.1.0/pyproject.toml +120 -0
  17. pylinearcapr-0.1.0/src/CMakeLists.txt +2 -0
  18. pylinearcapr-0.1.0/src/linearcapr/CMakeLists.txt +65 -0
  19. pylinearcapr-0.1.0/src/pylinearcapr/CMakeLists.txt +1 -0
  20. pylinearcapr-0.1.0/src/pylinearcapr/__init__.py +18 -0
  21. pylinearcapr-0.1.0/src/pylinearcapr/_linearcapr.pyx +303 -0
  22. pylinearcapr-0.1.0/src/pylinearcapr/tests/__init__.py +12 -0
  23. pylinearcapr-0.1.0/src/pylinearcapr/tests/__main__.py +5 -0
  24. pylinearcapr-0.1.0/src/pylinearcapr/tests/test_doctest.py +82 -0
  25. pylinearcapr-0.1.0/src/pylinearcapr/tests/test_profiler.py +51 -0
  26. pylinearcapr-0.1.0/src/scripts/apply_patch.py +65 -0
  27. pylinearcapr-0.1.0/src/scripts/cmake/CythonExtension.cmake +125 -0
  28. pylinearcapr-0.1.0/src/scripts/cmake/pystate_patch.h +10 -0
  29. pylinearcapr-0.1.0/src/scripts/generate_patches.py +51 -0
  30. pylinearcapr-0.1.0/src/scripts/generate_patches.py.save +51 -0
  31. pylinearcapr-0.1.0/vendor/LinearCapR/.git +1 -0
  32. pylinearcapr-0.1.0/vendor/LinearCapR/.gitignore +4 -0
  33. pylinearcapr-0.1.0/vendor/LinearCapR/CITATION.cff +12 -0
  34. pylinearcapr-0.1.0/vendor/LinearCapR/FileReader.cpp +35 -0
  35. pylinearcapr-0.1.0/vendor/LinearCapR/FileReader.hpp +12 -0
  36. pylinearcapr-0.1.0/vendor/LinearCapR/LICENSE +7 -0
  37. pylinearcapr-0.1.0/vendor/LinearCapR/LinCapR.cpp +548 -0
  38. pylinearcapr-0.1.0/vendor/LinearCapR/LinCapR.hpp +59 -0
  39. pylinearcapr-0.1.0/vendor/LinearCapR/Makefile +49 -0
  40. pylinearcapr-0.1.0/vendor/LinearCapR/README.md +248 -0
  41. pylinearcapr-0.1.0/vendor/LinearCapR/beam_prune.hpp +58 -0
  42. pylinearcapr-0.1.0/vendor/LinearCapR/compare_profiles.py +139 -0
  43. pylinearcapr-0.1.0/vendor/LinearCapR/debug.cpp +3 -0
  44. pylinearcapr-0.1.0/vendor/LinearCapR/debug.hpp +54 -0
  45. pylinearcapr-0.1.0/vendor/LinearCapR/docs/1ehz_lincapr_profile_overlay.png +0 -0
  46. pylinearcapr-0.1.0/vendor/LinearCapR/docs/test_profile_demo.png +0 -0
  47. pylinearcapr-0.1.0/vendor/LinearCapR/dp_table_api.hpp +37 -0
  48. pylinearcapr-0.1.0/vendor/LinearCapR/energy_model.hpp +165 -0
  49. pylinearcapr-0.1.0/vendor/LinearCapR/energy_param.hpp +445 -0
  50. pylinearcapr-0.1.0/vendor/LinearCapR/intloops.hpp +12385 -0
  51. pylinearcapr-0.1.0/vendor/LinearCapR/legacy_energy_param.cpp +1 -0
  52. pylinearcapr-0.1.0/vendor/LinearCapR/legacy_energy_param.hpp +187 -0
  53. pylinearcapr-0.1.0/vendor/LinearCapR/legacy_intloops.hpp +2802 -0
  54. pylinearcapr-0.1.0/vendor/LinearCapR/main.cpp +92 -0
  55. pylinearcapr-0.1.0/vendor/LinearCapR/miscs.hpp +155 -0
  56. pylinearcapr-0.1.0/vendor/LinearCapR/plot_profile.py +418 -0
  57. pylinearcapr-0.1.0/vendor/LinearCapR/test.fa +2 -0
@@ -0,0 +1,266 @@
1
+ name: Package
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+
8
+ jobs:
9
+
10
+ wheel-linux-aarch64:
11
+ name: Build Linux wheels (Aarch64)
12
+ runs-on: ubuntu-22.04-arm
13
+ steps:
14
+ - uses: actions/checkout@v3
15
+ with:
16
+ submodules: recursive
17
+ - name: Build manylinux wheels
18
+ uses: pypa/cibuildwheel@v4.3.5
19
+ env:
20
+ CIBW_ARCHS: aarch64
21
+ CIBW_BUILD: '*-manylinux_aarch64'
22
+ CIBW_BUILD_VERBOSITY: 2
23
+ with:
24
+ output-dir: dist
25
+ - uses: actions/upload-artifact@v4
26
+ with:
27
+ name: wheels-manylinux_aarch64
28
+ path: dist/*
29
+
30
+ wheel-linux-x86_64:
31
+ name: Build Linux wheels (x86-64)
32
+ runs-on: ubuntu-latest
33
+ steps:
34
+ - uses: actions/checkout@v4
35
+ with:
36
+ submodules: recursive
37
+ - name: Build manylinux wheels
38
+ uses: pypa/cibuildwheel@v4.3.5
39
+ env:
40
+ CIBW_ARCHS: x86_64
41
+ CIBW_BUILD: '*-manylinux_x86_64'
42
+ CIBW_BUILD_VERBOSITY: 2
43
+ with:
44
+ output-dir: dist
45
+ - uses: actions/upload-artifact@v4
46
+ with:
47
+ name: wheels-manylinux_x86_64
48
+ path: dist/*
49
+
50
+ wheel-macos-x86_64:
51
+ name: Build MacOS wheels (x86-64)
52
+ runs-on: macOS-latest
53
+ steps:
54
+ - uses: actions/checkout@v4
55
+ with:
56
+ submodules: recursive
57
+ - name: Build manylinux wheels
58
+ uses: pypa/cibuildwheel@v4.3.5
59
+ env:
60
+ CIBW_ARCHS: x86_64
61
+ CIBW_BUILD: '*-macosx_x86_64'
62
+ CIBW_BUILD_VERBOSITY: 2
63
+ MACOSX_DEPLOYMENT_TARGET: 11.0
64
+ with:
65
+ output-dir: dist
66
+ - uses: actions/upload-artifact@v4
67
+ with:
68
+ name: wheels-macosx_x86_64
69
+ path: dist/*
70
+
71
+ wheel-macos-aarch64:
72
+ name: Build MacOS wheels (Aarch64)
73
+ runs-on: macOS-latest
74
+ steps:
75
+ - uses: actions/checkout@v4
76
+ with:
77
+ submodules: recursive
78
+ - name: Build manylinux wheels
79
+ uses: pypa/cibuildwheel@v4.3.5
80
+ env:
81
+ CIBW_ARCHS: arm64
82
+ CIBW_BUILD: '*-macosx_arm64'
83
+ CIBW_BUILD_VERBOSITY: 2
84
+ with:
85
+ output-dir: dist
86
+ - uses: actions/upload-artifact@v4
87
+ with:
88
+ name: wheels-macosx_arm64
89
+ path: dist/*
90
+
91
+ wheel-win32-x86_64:
92
+ name: Build Windows wheels (x86-64)
93
+ runs-on: windows-latest
94
+ steps:
95
+ - uses: actions/checkout@v4
96
+ with:
97
+ submodules: recursive
98
+ - name: Configure build for amd64
99
+ uses: ilammy/msvc-dev-cmd@v1
100
+ with:
101
+ arch: amd64
102
+ - name: Build manylinux wheels
103
+ uses: pypa/cibuildwheel@v4.3.5
104
+ env:
105
+ CIBW_ARCHS: AMD64
106
+ CIBW_BUILD: '*-win_amd64'
107
+ CIBW_BUILD_VERBOSITY: 2
108
+ CMAKE_GENERATOR: Ninja
109
+ with:
110
+ output-dir: dist
111
+ - uses: actions/upload-artifact@v4
112
+ with:
113
+ name: wheels-win_amd64
114
+ path: dist/*
115
+
116
+ wheel-wasm:
117
+ name: Build WebAssembly wheel
118
+ runs-on: ubuntu-latest
119
+ steps:
120
+ - uses: actions/checkout@v4
121
+ with:
122
+ submodules: true
123
+ - name: Set up Python 3.13
124
+ uses: actions/setup-python@v2
125
+ with:
126
+ python-version: 3.13
127
+ - name: Install Pyodide
128
+ run: python -m pip install pyodide-build
129
+ - name: Build wheel
130
+ run: pyodide build .
131
+ - name: Create virtualenv
132
+ run: pyodide venv .venv-pyodide
133
+ - name: Install WebAssembly wheel
134
+ run: .venv-pyodide/bin/pip install dist/pylinearcapr-*.whl
135
+ - name: Run tests
136
+ run: .venv-pyodide/bin/python -m unittest pylinearcapr.tests -vv
137
+ - uses: actions/upload-artifact@v4
138
+ with:
139
+ name: wheels-wasm
140
+ path: dist/*
141
+
142
+ sdist:
143
+ runs-on: ubuntu-latest
144
+ name: Build source distribution
145
+ steps:
146
+ - uses: actions/checkout@v4
147
+ with:
148
+ submodules: recursive
149
+ - name: Set up Python 3.12
150
+ uses: actions/setup-python@v5
151
+ with:
152
+ python-version: 3.12
153
+ - name: Install build requirements
154
+ run: python -m pip install -r .github/workflows/requirements.txt
155
+ - name: Build source distribution
156
+ run: python -m build -s .
157
+ - name: Store built source distribution
158
+ uses: actions/upload-artifact@v4
159
+ with:
160
+ name: sdist
161
+ path: dist/*
162
+
163
+ test-sdist:
164
+ runs-on: ubuntu-latest
165
+ name: Test source distribution
166
+ needs:
167
+ - sdist
168
+ steps:
169
+ - name: Setup Python 3.12
170
+ uses: actions/setup-python@v5
171
+ with:
172
+ python-version: 3.12
173
+ - name: Download built wheels
174
+ uses: actions/download-artifact@v4
175
+ with:
176
+ name: sdist
177
+ path: dist/
178
+ - name: Update pip to latest version
179
+ run: python -m pip install -U pip
180
+ - name: Install built wheel
181
+ run: python -m pip install --no-binary pylinearcapr --find-links=dist pylinearcapr
182
+ - name: Run tests without coverage
183
+ run: python -m unittest pylinearcapr.tests -vv
184
+
185
+ upload:
186
+ environment: PyPI
187
+ runs-on: ubuntu-latest
188
+ permissions:
189
+ id-token: write
190
+ name: Upload
191
+ needs:
192
+ - sdist
193
+ - test-sdist
194
+ - wheel-linux-aarch64
195
+ - wheel-linux-x86_64
196
+ - wheel-macos-aarch64
197
+ - wheel-macos-x86_64
198
+ - wheel-win32-x86_64
199
+ - wheel-wasm
200
+ steps:
201
+ - uses: actions/download-artifact@v4
202
+ with:
203
+ name: sdist
204
+ path: dist
205
+ merge-multiple: true
206
+ - uses: actions/download-artifact@v4
207
+ with:
208
+ pattern: wheels-*
209
+ path: dist
210
+ merge-multiple: true
211
+ - uses: pypa/gh-action-pypi-publish@release/v1
212
+ if: startsWith(github.ref, 'refs/tags')
213
+
214
+ release:
215
+ environment: GitHub Releases
216
+ runs-on: ubuntu-latest
217
+ if: "!contains(github.ref, 'rc')"
218
+ name: Release
219
+ needs: upload
220
+ permissions: write-all
221
+ steps:
222
+ - uses: actions/checkout@v4
223
+ with:
224
+ submodules: recursive
225
+ - uses: rasmus-saks/release-a-changelog-action@v1.2.0
226
+ with:
227
+ github-token: '${{ secrets.GITHUB_TOKEN }}'
228
+
229
+ # aur:
230
+ # environment: Arch User Repository
231
+ # runs-on: ubuntu-latest
232
+ # if: "!contains(github.ref, 'alpha') && !contains(github.ref, 'rc') && !contains(github.ref, 'post')"
233
+ # name: Update AUR package
234
+ # needs:
235
+ # - sdist
236
+ # - test-sdist
237
+ # - upload
238
+ # steps:
239
+ # - uses: actions/checkout@v3
240
+ # with:
241
+ # submodules: recursive
242
+ # - name: Set up Python 3.13
243
+ # uses: actions/setup-python@v5
244
+ # with:
245
+ # python-version: '3.13'
246
+ # - name: Download source distribution
247
+ # uses: actions/download-artifact@v4
248
+ # with:
249
+ # name: sdist
250
+ # path: dist
251
+ # - name: Extract package version
252
+ # run: echo PKGVER=$(echo '${{ github.ref }}' | cut -d'v' -f2) >> $GITHUB_ENV
253
+ # - name: Compute SHA256 of source distribution
254
+ # run: echo SHA256=$(sha256sum dist/pylinearcapr-${{ env.PKGVER }}.tar.gz | cut -f1 -d' ') >> $GITHUB_ENV
255
+ # - name: Generate PKGBUILD
256
+ # run: sed -e "s/%pkgver/${{ env.PKGVER }}/g" -e "s/%sha256sum/${{ env.SHA256 }}/g" pkg/aur/PKGBUILD.in > pkg/aur/PKGBUILD
257
+ # - name: Update package
258
+ # uses: KSXGitHub/github-actions-deploy-aur@v2.7.2
259
+ # with:
260
+ # pkgname: python-pylinearcapr
261
+ # pkgbuild: pkg/aur/PKGBUILD
262
+ # commit_username: ${{ secrets.AUR_USER }}
263
+ # commit_email: ${{ secrets.AUR_EMAIL }}
264
+ # ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
265
+ # commit_message: ${{ github.event.head_commit.message }}
266
+ # ssh_keyscan_types: rsa,ecdsa,ed25519
@@ -0,0 +1,3 @@
1
+ cython ~=3.0
2
+ scikit-build-core
3
+ build
@@ -0,0 +1,166 @@
1
+ name: Test
2
+
3
+ on:
4
+ - push
5
+ - pull_request
6
+
7
+ jobs:
8
+
9
+ test_linux:
10
+ name: Test (Linux)
11
+ runs-on: ubuntu-latest
12
+ env:
13
+ OS: Linux
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ include:
18
+ - python-version: '3.10'
19
+ python-release: v3.10
20
+ python-impl: CPython
21
+ - python-version: 3.11
22
+ python-release: v3.11
23
+ python-impl: CPython
24
+ - python-version: 3.12
25
+ python-release: v3.12
26
+ python-impl: CPython
27
+ - python-version: 3.13
28
+ python-release: v3.13
29
+ python-impl: CPython
30
+ - python-version: 3.14
31
+ python-release: v3.14
32
+ python-impl: CPython
33
+ - python-version: pypy-3.10
34
+ python-release: v3.10
35
+ python-impl: PyPy
36
+ steps:
37
+ - name: Checkout code
38
+ uses: actions/checkout@v4
39
+ with:
40
+ submodules: recursive
41
+ - name: Setup Python ${{ matrix.python-version }}
42
+ uses: actions/setup-python@v5
43
+ with:
44
+ python-version: ${{ matrix.python-version }}
45
+ - name: Update pip
46
+ run: python -m pip install -U pip wheel setuptools
47
+ - name: Install Python requirements
48
+ run: python -m pip install -r .github/workflows/requirements.txt
49
+ - name: Build extension in debug mode
50
+ run: python -m pip install -v -e . --no-build-isolation
51
+ - name: Test extension
52
+ run: python -m unittest pylinearcapr.tests -vv
53
+ # - name: Upload to Codecov
54
+ # if: matrix.python-impl == 'CPython'
55
+ # uses: codecov/codecov-action@v3
56
+ # with:
57
+ # flags: ${{ matrix.python-impl }},${{ matrix.python-release }},${{ env.OS }}
58
+ # name: test-python-${{ matrix.python-version }}
59
+ # fail_ci_if_error: true
60
+ # token: ${{ secrets.CODECOV_TOKEN }}
61
+
62
+ test_osx:
63
+ name: Test (OSX)
64
+ runs-on: macos-latest
65
+ env:
66
+ OS: OSX
67
+ strategy:
68
+ fail-fast: false
69
+ matrix:
70
+ include:
71
+ - python-version: '3.10'
72
+ python-release: v3.10
73
+ python-impl: CPython
74
+ - python-version: '3.11'
75
+ python-release: v3.11
76
+ python-impl: CPython
77
+ - python-version: '3.12'
78
+ python-release: v3.12
79
+ python-impl: CPython
80
+ - python-version: '3.14'
81
+ python-release: v3.13
82
+ python-impl: CPython
83
+ - python-version: '3.14'
84
+ python-release: v3.13
85
+ python-impl: CPython
86
+ - python-version: pypy-3.10
87
+ python-release: v3.10
88
+ python-impl: PyPy
89
+ steps:
90
+ - name: Checkout code
91
+ uses: actions/checkout@v4
92
+ with:
93
+ submodules: recursive
94
+ - name: Setup Python ${{ matrix.python-version }}
95
+ uses: actions/setup-python@v5
96
+ with:
97
+ python-version: ${{ matrix.python-version }}
98
+ # - name: Setup deployment target
99
+ # shell: bash
100
+ # if: ${{ startsWith(matrix.python-version, 'pypy') || matrix.python-version == '3.11' || matrix.python-version == '3.12' }}
101
+ # run: echo "MACOSX_DEPLOYMENT_TARGET=10.12" >> $GITHUB_ENV
102
+ - name: Update pip
103
+ run: python -m pip install -U pip wheel setuptools
104
+ - name: Install Python requirements
105
+ run: python -m pip install -r .github/workflows/requirements.txt
106
+
107
+ - name: Install LLVM
108
+ run: brew install llvm
109
+ - name: Build extension in debug mode
110
+ run: python -m pip install -v -e . --no-build-isolation -C cmake.define.CMAKE_C_COMPILER=$(brew --prefix llvm)/bin/clang -C cmake.define.CMAKE_CXX_COMPILER=$(brew --prefix llvm)/bin/clang++
111
+ - name: Test extension
112
+ run: python -m unittest pylinearcapr.tests -vv
113
+ # - name: Upload to Codecov
114
+ # if: matrix.python-impl == 'CPython'
115
+ # uses: codecov/codecov-action@v3
116
+ # with:
117
+ # flags: ${{ matrix.python-impl }},${{ matrix.python-release }},${{ env.OS }}
118
+ # name: test-python-${{ matrix.python-version }}
119
+ # fail_ci_if_error: true
120
+ # token: ${{ secrets.CODECOV_TOKEN }}
121
+
122
+ test_windows:
123
+ name: Test (Windows)
124
+ runs-on: windows-latest
125
+ env:
126
+ OS: Windows
127
+ strategy:
128
+ fail-fast: false
129
+ matrix:
130
+ include:
131
+ - python-version: '3.10'
132
+ python-release: v3.10
133
+ python-impl: CPython
134
+ - python-version: '3.11'
135
+ python-release: v3.11
136
+ python-impl: CPython
137
+ - python-version: '3.12'
138
+ python-release: v3.12
139
+ python-impl: CPython
140
+ - python-version: '3.13'
141
+ python-release: v3.13
142
+ python-impl: CPython
143
+ - python-version: '3.14'
144
+ python-release: v3.14
145
+ python-impl: CPython
146
+ - python-version: pypy-3.10
147
+ python-release: v3.10
148
+ python-impl: PyPy
149
+ steps:
150
+ - name: Checkout code
151
+ uses: actions/checkout@v4
152
+ with:
153
+ submodules: recursive
154
+ - name: Setup Python ${{ matrix.python-version }}
155
+ uses: actions/setup-python@v5
156
+ with:
157
+ python-version: ${{ matrix.python-version }}
158
+ architecture: x64
159
+ - name: Update pip
160
+ run: python -m pip install -U pip wheel setuptools
161
+ - name: Install Python requirements
162
+ run: python -m pip install -r .github/workflows/requirements.txt
163
+ - name: Build extension in debug mode
164
+ run: python -m pip install -v . --no-build-isolation
165
+ - name: Test extension
166
+ run: python -m unittest pylinearcapr.tests -vv
@@ -0,0 +1,167 @@
1
+ ### C ###
2
+ # Prerequisites
3
+ *.d
4
+
5
+ # Object files
6
+ *.o
7
+ *.ko
8
+ *.obj
9
+ *.elf
10
+
11
+ # Linker output
12
+ *.ilk
13
+ *.map
14
+ *.exp
15
+
16
+ # Precompiled Headers
17
+ *.gch
18
+ *.pch
19
+
20
+ # Libraries
21
+ *.lib
22
+ *.a
23
+ *.la
24
+ *.lo
25
+
26
+ # Shared objects (inc. Windows DLLs)
27
+ *.dll
28
+ *.so
29
+ *.so.*
30
+ *.dylib
31
+
32
+ # Executables
33
+ *.exe
34
+ *.out
35
+ *.app
36
+ *.i*86
37
+ *.x86_64
38
+ *.hex
39
+
40
+ # Debug files
41
+ *.dSYM/
42
+ *.su
43
+ *.idb
44
+ *.pdb
45
+
46
+ # Kernel Module Compile Results
47
+ *.mod*
48
+ *.cmd
49
+ .tmp_versions/
50
+ modules.order
51
+ Module.symvers
52
+ Mkfile.old
53
+ dkms.conf
54
+
55
+ # Valgrind files
56
+ callgrind.out.*
57
+ cachegrind.out.*
58
+
59
+ # Memprofile
60
+ mprofile_*.dat
61
+
62
+ ### Python ###
63
+ # Byte-compiled / optimized / DLL files
64
+ __pycache__/
65
+ *.py[cod]
66
+ *$py.class
67
+
68
+ # C extensions
69
+
70
+ # Distribution / packaging
71
+ .Python
72
+ build/
73
+ develop-eggs/
74
+ dist/
75
+ wheelhouse/
76
+ downloads/
77
+ eggs/
78
+ .eggs/
79
+ lib/
80
+ lib64/
81
+ parts/
82
+ sdist/
83
+ var/
84
+ wheels/
85
+ pip-wheel-metadata/
86
+ share/python-wheels/
87
+ *.egg-info/
88
+ .installed.cfg
89
+ *.egg
90
+ MANIFEST
91
+
92
+ # PyInstaller
93
+ # Usually these files are written by a python script from a template
94
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
95
+ *.manifest
96
+ *.spec
97
+
98
+ # Installer logs
99
+ pip-log.txt
100
+ pip-delete-this-directory.txt
101
+
102
+ # Unit test / coverage reports
103
+ htmlcov/
104
+ .tox/
105
+ .nox/
106
+ .coverage
107
+ .coverage.*
108
+ .cache
109
+ nosetests.xml
110
+ coverage.xml
111
+ *.cover
112
+ .hypothesis/
113
+ .pytest_cache/
114
+
115
+ # Translations
116
+ *.mo
117
+ *.pot
118
+
119
+ # Scrapy stuff:
120
+ .scrapy
121
+
122
+ # Sphinx documentation
123
+ docs/_build/
124
+
125
+ # PyBuilder
126
+ target/
127
+
128
+ # pyenv
129
+ .python-version
130
+
131
+ # pipenv
132
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
133
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
134
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
135
+ # install all needed dependencies.
136
+ #Pipfile.lock
137
+
138
+ # celery beat schedule file
139
+ celerybeat-schedule
140
+
141
+ # SageMath parsed files
142
+ *.sage.py
143
+
144
+ # Spyder project settings
145
+ .spyderproject
146
+ .spyproject
147
+
148
+ # Rope project settings
149
+ .ropeproject
150
+
151
+ # Mr Developer
152
+ .mr.developer.cfg
153
+ .project
154
+ .pydevproject
155
+
156
+ # mkdocs documentation
157
+ /site
158
+
159
+ # mypy
160
+ .mypy_cache/
161
+ .dmypy.json
162
+ dmypy.json
163
+
164
+ # Pyre type checker
165
+ .pyre/
166
+
167
+ # End of https://www.gitignore.io/api/python,c
@@ -0,0 +1,3 @@
1
+ [submodule "vendor/LinearCapR"]
2
+ path = vendor/LinearCapR
3
+ url = https://github.com/hoget157/LinearCapR
@@ -0,0 +1,14 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
+
7
+
8
+ ## [Unreleased]
9
+ [Unreleased]: https://github.com/althonos/pylinearcapr/compare/v0.1.0...HEAD
10
+
11
+ ## [v0.1.0] - 2026-12-01
12
+ [v0.1.0]: https://github.com/althonos/pylinearcapr/compare/b305624...v0.1.0
13
+
14
+ Initial release.
@@ -0,0 +1,27 @@
1
+ cmake_minimum_required(VERSION 3.20)
2
+ project(${SKBUILD_PROJECT_NAME} VERSION ${SKBUILD_PROJECT_VERSION} LANGUAGES C CXX)
3
+
4
+ set(BUILD_SHARED_LIBS OFF)
5
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
6
+
7
+ if(WIN32)
8
+ set(CMAKE_CXX_STANDARD 20)
9
+ else()
10
+ set(CMAKE_CXX_STANDARD 17)
11
+ endif()
12
+ set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
13
+
14
+ message(STATUS "Building ${SKBUILD_PROJECT_NAME} for ${CMAKE_SYSTEM_PROCESSOR}")
15
+
16
+ # --- Setup include folders ----------------------------------------------------
17
+
18
+ set_property(GLOBAL PROPERTY PYTHON_EXTENSIONS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
19
+ set(CYTHON_HEADERS_DIR ${CMAKE_CURRENT_LIST_DIR}/include)
20
+
21
+ # --- Add scripts for Cython ---------------------------------------------------
22
+
23
+ include("src/scripts/cmake/CythonExtension.cmake")
24
+
25
+ # --- Compile code -------------------------------------------------------------
26
+
27
+ add_subdirectory(src)
@@ -0,0 +1,45 @@
1
+ # Contributing to PyLinearCapR
2
+
3
+ For bug fixes or new features, please file an issue before submitting a
4
+ pull request. If the change isn't trivial, it may be best to wait for
5
+ feedback.
6
+
7
+ ## Setting up a local repository
8
+
9
+ Make sure you clone the repository in recursive mode, so you also get the
10
+ wrapped code of LinearCapR which is exposed as a ``git`` submodule:
11
+
12
+ ```console
13
+ $ git clone --recursive https://github.com/althonos/pylinearcapr
14
+ ```
15
+
16
+ ## Running tests
17
+
18
+ Tests are written as usual Python unit tests with the `unittest` module of
19
+ the standard library. Running them requires the extension to be built
20
+ locally:
21
+
22
+ ```console
23
+ $ python -m pip install -v -e . --no-build-isolation
24
+ $ python -m unittest -vv pylinearcapr.tests
25
+ ```
26
+
27
+ ## Coding guidelines
28
+
29
+ This project targets Python 3.8 or later. The CI runs tests for Python 3.10 and later,
30
+ so compatibility for Python 3.8 and 3.9 is offered on a best effort basis.
31
+
32
+ Python objects should be typed; since it is not supported by Cython,
33
+ you must manually declare types in type stubs (`.pyi` files). In Python
34
+ files, you can add type annotations to function signatures (supported in
35
+ Python 3.5) and in variable assignments (supported from Python
36
+ 3.6 onward).
37
+
38
+ ### Interfacing with C/C++
39
+
40
+ When interfacing with C or C++, and in particular with pointers, use
41
+ assertions everywhere you assume the pointer to be non-NULL. Also consider
42
+ using assertions when accessing raw C arrays, if applicable.
43
+
44
+ For C++, consider using smart pointers (`std::unique_ptr` and `std::shared_ptr`)
45
+ rather than raw pointers when wrapping FFI types in Python objects.