directedstructure 0.1.1__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 (75) hide show
  1. directedstructure-0.1.1/.copier-answers.yml +14 -0
  2. directedstructure-0.1.1/.git_archival.txt +3 -0
  3. directedstructure-0.1.1/.gitattributes +1 -0
  4. directedstructure-0.1.1/.github/CONTRIBUTING.md +77 -0
  5. directedstructure-0.1.1/.github/dependabot.yml +11 -0
  6. directedstructure-0.1.1/.github/release.yml +5 -0
  7. directedstructure-0.1.1/.github/workflows/cd.yml +95 -0
  8. directedstructure-0.1.1/.github/workflows/ci.yml +77 -0
  9. directedstructure-0.1.1/.github/workflows/release.yml +114 -0
  10. directedstructure-0.1.1/.gitignore +188 -0
  11. directedstructure-0.1.1/.pre-commit-config.yaml +104 -0
  12. directedstructure-0.1.1/.readthedocs.yaml +16 -0
  13. directedstructure-0.1.1/CMakeLists.txt +25 -0
  14. directedstructure-0.1.1/LICENSE +19 -0
  15. directedstructure-0.1.1/Makefile +62 -0
  16. directedstructure-0.1.1/PKG-INFO +120 -0
  17. directedstructure-0.1.1/README.md +88 -0
  18. directedstructure-0.1.1/TODO.md +23 -0
  19. directedstructure-0.1.1/docs/conf.py +65 -0
  20. directedstructure-0.1.1/docs/examples/prediction.md +6 -0
  21. directedstructure-0.1.1/docs/examples/speed_test.md +6 -0
  22. directedstructure-0.1.1/docs/examples/visualization.md +6 -0
  23. directedstructure-0.1.1/docs/index.md +18 -0
  24. directedstructure-0.1.1/docs/modules.md +8 -0
  25. directedstructure-0.1.1/examples/consensus.py +27 -0
  26. directedstructure-0.1.1/examples/data/networks/business_depts.gml +39732 -0
  27. directedstructure-0.1.1/examples/data/networks/friends.gml +987 -0
  28. directedstructure-0.1.1/examples/data/networks/friends_raw.gml +1079 -0
  29. directedstructure-0.1.1/examples/data/networks/highschool_30.gml +11912 -0
  30. directedstructure-0.1.1/examples/data/networks/highschool_30_raw.gml +12183 -0
  31. directedstructure-0.1.1/examples/data/networks/highschool_51.gml +6414 -0
  32. directedstructure-0.1.1/examples/data/networks/highschool_51_raw.gml +6307 -0
  33. directedstructure-0.1.1/examples/data/networks/highschool_84.gml +15947 -0
  34. directedstructure-0.1.1/examples/data/networks/highschool_84_raw.gml +15219 -0
  35. directedstructure-0.1.1/examples/data/process_friendship_nominations.py +42 -0
  36. directedstructure-0.1.1/examples/data/samples/friends.csv +4491 -0
  37. directedstructure-0.1.1/examples/data/samples/highschool_51.csv +1075 -0
  38. directedstructure-0.1.1/examples/data/take_samples.py +19 -0
  39. directedstructure-0.1.1/examples/data/test_2.gml +21 -0
  40. directedstructure-0.1.1/examples/prediction.py +1 -0
  41. directedstructure-0.1.1/examples/sampling.py +1 -0
  42. directedstructure-0.1.1/examples/speed_test.py +1 -0
  43. directedstructure-0.1.1/examples/testing copy.png +0 -0
  44. directedstructure-0.1.1/examples/testing.png +0 -0
  45. directedstructure-0.1.1/examples/testing.py +96 -0
  46. directedstructure-0.1.1/examples/visualization.py +12 -0
  47. directedstructure-0.1.1/noxfile.py +121 -0
  48. directedstructure-0.1.1/pyproject.toml +183 -0
  49. directedstructure-0.1.1/src/MCMC_bookkeeping.cpp +605 -0
  50. directedstructure-0.1.1/src/MCMC_core.cpp +728 -0
  51. directedstructure-0.1.1/src/MCMC_core.h +220 -0
  52. directedstructure-0.1.1/src/MCMC_merge_split.cpp +738 -0
  53. directedstructure-0.1.1/src/MCMC_proposals.cpp +807 -0
  54. directedstructure-0.1.1/src/consensus.cpp +132 -0
  55. directedstructure-0.1.1/src/consensus.h +27 -0
  56. directedstructure-0.1.1/src/directedstructure/MCMC_core.pyi +27 -0
  57. directedstructure-0.1.1/src/directedstructure/__init__.py +21 -0
  58. directedstructure-0.1.1/src/directedstructure/_core.pyi +4 -0
  59. directedstructure-0.1.1/src/directedstructure/_graph_cache.py +38 -0
  60. directedstructure-0.1.1/src/directedstructure/_util.py +173 -0
  61. directedstructure-0.1.1/src/directedstructure/_version.py +34 -0
  62. directedstructure-0.1.1/src/directedstructure/_version.pyi +4 -0
  63. directedstructure-0.1.1/src/directedstructure/bayes_factor.py +101 -0
  64. directedstructure-0.1.1/src/directedstructure/clusterings.py +130 -0
  65. directedstructure-0.1.1/src/directedstructure/core.py +571 -0
  66. directedstructure-0.1.1/src/directedstructure/input_output.py +488 -0
  67. directedstructure-0.1.1/src/directedstructure/prediction.py +126 -0
  68. directedstructure-0.1.1/src/directedstructure/py.typed +0 -0
  69. directedstructure-0.1.1/src/directedstructure/sample.py +338 -0
  70. directedstructure-0.1.1/src/directedstructure/sample_analysis.py +126 -0
  71. directedstructure-0.1.1/src/globals.h +53 -0
  72. directedstructure-0.1.1/src/helpers.cpp +458 -0
  73. directedstructure-0.1.1/src/helpers.h +96 -0
  74. directedstructure-0.1.1/tests/mcmc_core_test.cpp +515 -0
  75. directedstructure-0.1.1/tests/test_package.py +9 -0
@@ -0,0 +1,14 @@
1
+ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2
+ _commit: 2025.11.21-25-gad4434f
3
+ _src_path: gh:scientific-python/cookie
4
+ backend: skbuild
5
+ docs: sphinx
6
+ email: mjerdee@santafe.edu
7
+ full_name: Maximilian Jerdee
8
+ license: MIT
9
+ org: maxjerdee
10
+ project_name: directedstructure
11
+ project_short_description: Infer communities, hierarchies, and their connection in
12
+ directed graphs
13
+ url: https://github.com/maxjerdee/directedstructure
14
+ vcs: true
@@ -0,0 +1,3 @@
1
+ node: $Format:%H$
2
+ node-date: $Format:%cI$
3
+ describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
@@ -0,0 +1 @@
1
+ .git_archival.txt export-subst
@@ -0,0 +1,77 @@
1
+ See the [Scientific Python Developer Guide][spc-dev-intro] for a detailed
2
+ description of best practices for developing scientific packages.
3
+
4
+ [spc-dev-intro]: https://learn.scientific-python.org/development/
5
+
6
+ # Quick development
7
+
8
+ The fastest way to start with development is to use nox. If you don't have nox,
9
+ you can use `uvx nox` to run it without installing, or `uv tool install nox`. If
10
+ you don't have uv, you can
11
+ [install it a variety of ways](https://docs.astral.sh/uv/getting-started/installation/),
12
+ including with pip, pipx, brew, and just downloading the binary (single file).
13
+
14
+ To use, run `nox`. This will lint and test using every installed version of
15
+ Python on your system, skipping ones that are not installed. You can also run
16
+ specific jobs:
17
+
18
+ ```console
19
+ $ nox -s lint # Lint only
20
+ $ nox -s tests # Python tests
21
+ $ nox -s docs # Build and serve the docs
22
+ $ nox -s build # Make an SDist and wheel
23
+ ```
24
+
25
+ Nox handles everything for you, including setting up an temporary virtual
26
+ environment for each run.
27
+
28
+ # Setting up a development environment manually
29
+
30
+ You can set up a development environment by running:
31
+
32
+ ```bash
33
+ uv sync
34
+ ```
35
+
36
+ # Pre-commit
37
+
38
+ You should prepare pre-commit or prek, which will help you by checking that
39
+ commits pass required checks:
40
+
41
+ ```bash
42
+ uv tool install pre-commit # or brew install pre-commit on macOS
43
+ pre-commit install # Will install a pre-commit hook into the git repo
44
+ ```
45
+
46
+ You can also/alternatively run `pre-commit run` (changes only) or
47
+ `pre-commit run --all-files` to check even without installing the hook.
48
+
49
+ # Testing
50
+
51
+ Use pytest to run the unit checks:
52
+
53
+ ```bash
54
+ uv run pytest
55
+ ```
56
+
57
+ # Coverage
58
+
59
+ Use pytest-cov to generate coverage reports:
60
+
61
+ ```bash
62
+ uv run pytest --cov=directedstructure
63
+ ```
64
+
65
+ # Building docs
66
+
67
+ You can build and serve the docs using:
68
+
69
+ ```bash
70
+ nox -s docs
71
+ ```
72
+
73
+ You can build the docs only with:
74
+
75
+ ```bash
76
+ nox -s docs --non-interactive
77
+ ```
@@ -0,0 +1,11 @@
1
+ version: 2
2
+ updates:
3
+ # Maintain dependencies for GitHub Actions
4
+ - package-ecosystem: "github-actions"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ groups:
9
+ actions:
10
+ patterns:
11
+ - "*"
@@ -0,0 +1,5 @@
1
+ changelog:
2
+ exclude:
3
+ authors:
4
+ - dependabot[bot]
5
+ - pre-commit-ci[bot]
@@ -0,0 +1,95 @@
1
+ name: wheels
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ release:
6
+ types:
7
+ - published
8
+ pull_request:
9
+ paths:
10
+ - .github/workflows/cd.yml
11
+
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ env:
17
+ # Many color libraries just need this to be set to any value, but at least
18
+ # one distinguishes color depth, where "3" -> "256-bit color".
19
+ FORCE_COLOR: 3
20
+
21
+ jobs:
22
+ make_sdist:
23
+ name: Make SDist
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v6
27
+ with:
28
+ fetch-depth: 0
29
+
30
+ - name: Build SDist
31
+ run: pipx run build --sdist
32
+
33
+ - uses: actions/upload-artifact@v6
34
+ with:
35
+ name: cibw-sdist
36
+ path: dist/*.tar.gz
37
+
38
+ build_wheels:
39
+ name: Wheel on ${{ matrix.os }}
40
+ runs-on: ${{ matrix.os }}
41
+ strategy:
42
+ fail-fast: false
43
+ matrix:
44
+ os:
45
+ - ubuntu-latest
46
+ - ubuntu-24.04-arm
47
+ - windows-latest
48
+ - windows-11-arm
49
+ - macos-15-intel
50
+ - macos-latest
51
+
52
+ steps:
53
+ - uses: actions/checkout@v6
54
+ with:
55
+ fetch-depth: 0
56
+
57
+ - uses: astral-sh/setup-uv@v7
58
+
59
+ - uses: pypa/cibuildwheel@v3.3
60
+ env:
61
+ CIBW_BUILD: cp310-* cp311-* cp312-* cp313-*
62
+
63
+ - name: Upload wheels
64
+ uses: actions/upload-artifact@v6
65
+ with:
66
+ name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
67
+ path: wheelhouse/*.whl
68
+
69
+ upload_all:
70
+ needs: [build_wheels, make_sdist]
71
+ environment: pypi
72
+ permissions:
73
+ id-token: write
74
+ attestations: write
75
+ contents: read
76
+ runs-on: ubuntu-latest
77
+ if: github.event_name == 'release' && github.event.action == 'published'
78
+
79
+ steps:
80
+ - uses: actions/download-artifact@v7
81
+ with:
82
+ pattern: cibw-*
83
+ path: dist
84
+ merge-multiple: true
85
+
86
+ - name: Generate artifact attestations
87
+ uses: actions/attest-build-provenance@v3
88
+ with:
89
+ subject-path: "dist/*"
90
+
91
+ - uses: pypa/gh-action-pypi-publish@release/v1
92
+ with:
93
+ # Remember to tell (test-)pypi about this repo before publishing
94
+ # Remove this line to publish to PyPI
95
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,77 @@
1
+ name: CI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request:
6
+ push:
7
+ branches:
8
+ - main
9
+
10
+ concurrency:
11
+ group: ${{ github.workflow }}-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ env:
15
+ # Many color libraries just need this variable to be set to any value.
16
+ # Set it to 3 to support 8-bit color graphics (256 colors per channel)
17
+ # for libraries that care about the value set.
18
+ FORCE_COLOR: 3
19
+
20
+ jobs:
21
+ pre-commit:
22
+ name: Format
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v6
26
+ with:
27
+ fetch-depth: 0
28
+ - uses: actions/setup-python@v6
29
+ with:
30
+ python-version: "3.x"
31
+
32
+ - uses: astral-sh/setup-uv@v7
33
+
34
+ - uses: pre-commit/action@v3.0.1
35
+ with:
36
+ extra_args: --hook-stage manual --all-files
37
+ - name: Run Pylint
38
+ run: uvx nox -s pylint -- --output-format=github
39
+
40
+ checks:
41
+ name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
42
+ runs-on: ${{ matrix.runs-on }}
43
+ needs: [pre-commit]
44
+ strategy:
45
+ fail-fast: false
46
+ matrix:
47
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
48
+ runs-on: [ubuntu-latest, windows-latest, macos-latest, macos-15-intel]
49
+
50
+ include:
51
+ - python-version: "pypy-3.11"
52
+ runs-on: ubuntu-latest
53
+
54
+ steps:
55
+ - uses: actions/checkout@v6
56
+ with:
57
+ fetch-depth: 0
58
+
59
+ - uses: actions/setup-python@v6
60
+ with:
61
+ python-version: ${{ matrix.python-version }}
62
+ allow-prereleases: true
63
+
64
+ - uses: astral-sh/setup-uv@v7
65
+
66
+ - name: Install package
67
+ run: uv sync
68
+
69
+ - name: Test package
70
+ run: >-
71
+ uv run pytest -ra --cov --cov-report=xml --cov-report=term
72
+ --durations=20
73
+
74
+ - name: Upload coverage report
75
+ uses: codecov/codecov-action@v5
76
+ with:
77
+ token: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,114 @@
1
+ name: release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ release:
6
+ types:
7
+ - published
8
+ pull_request:
9
+ paths:
10
+ - .github/workflows/cd.yml
11
+
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ env:
17
+ # Many color libraries just need this to be set to any value, but at least
18
+ # one distinguishes color depth, where "3" -> "256-bit color".
19
+ FORCE_COLOR: 3
20
+
21
+ jobs:
22
+ make_sdist:
23
+ name: Make SDist
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+ with:
28
+ fetch-depth: 0
29
+
30
+ - name: Build SDist
31
+ run: pipx run build --sdist
32
+
33
+ - uses: actions/upload-artifact@v4
34
+ with:
35
+ name: cibw-sdist
36
+ path: dist/*.tar.gz
37
+
38
+ build_wheels:
39
+ name: Wheel on ${{ matrix.os }}
40
+ runs-on: ${{ matrix.os }}
41
+ strategy:
42
+ fail-fast: false
43
+ matrix:
44
+ os: [macos-14, ubuntu-latest, windows-latest]
45
+
46
+ steps:
47
+ - uses: actions/checkout@v4
48
+ with:
49
+ fetch-depth: 0
50
+
51
+ - name: Install system dependencies for Pillow (Ubuntu)
52
+ if: runner.os == 'Linux'
53
+ run: |
54
+ sudo apt-get update
55
+ sudo apt-get install -y libjpeg-dev
56
+
57
+ - name: Install correct numpy version
58
+ run: python -m pip install "numpy==2.0.2"
59
+
60
+ - name: Install cibuildwheel
61
+ run: python -m pip install cibuildwheel==2.20
62
+
63
+ # Building all wheels for Python 3.10-3.13
64
+ - name: Build Wheel
65
+ env:
66
+ CIBW_BUILD: cp310-* cp311-* cp312-* cp313-*
67
+ CIBW_ARCHS_WINDOWS: AMD64
68
+ CIBW_BEFORE_ALL_LINUX: |
69
+ if command -v apk &> /dev/null; then
70
+ apk add --no-cache jpeg-dev zlib-dev
71
+ elif command -v yum &> /dev/null; then
72
+ yum install -y libjpeg-devel zlib-devel
73
+ elif command -v apt-get &> /dev/null; then
74
+ apt-get update && apt-get install -y libjpeg-dev zlib1g-dev
75
+ fi
76
+ CIBW_TEST_REQUIRES: pytest
77
+ CIBW_TEST_COMMAND: pytest {project}/tests
78
+ run: cibuildwheel --output-dir wheelhouse
79
+
80
+ - name: Upload wheels
81
+ uses: actions/upload-artifact@v4
82
+ with:
83
+ name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
84
+ path: wheelhouse/*.whl
85
+
86
+ upload_all:
87
+ needs: [build_wheels, make_sdist]
88
+ environment: pypi
89
+ permissions:
90
+ id-token: write
91
+ attestations: write
92
+ contents: read
93
+ runs-on: ubuntu-latest
94
+ steps:
95
+ - uses: actions/download-artifact@v4
96
+ with:
97
+ pattern: cibw-*
98
+ path: dist
99
+ merge-multiple: true
100
+
101
+ - name: Generate artifact attestations
102
+ uses: actions/attest-build-provenance@v1.4.1
103
+ with:
104
+ subject-path: "dist/*"
105
+
106
+ - uses: pypa/gh-action-pypi-publish@release/v1
107
+ with:
108
+ # Remember to tell (test-)pypi about this repo before publishing
109
+ # repository-url: https://test.pypi.org/legacy/
110
+ repository-url: https://upload.pypi.org/legacy/
111
+ username: __token__
112
+ # password: ${{ secrets.TEST_PYPI_API_TOKEN }}
113
+ password: ${{ secrets.PYPI_API_TOKEN }}
114
+ verbose: true
@@ -0,0 +1,188 @@
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
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ #.idea/
169
+
170
+ # setuptools_scm
171
+ src/*/_version.py
172
+
173
+
174
+ # ruff
175
+ .ruff_cache/
176
+
177
+ # OS specific stuff
178
+ .DS_Store
179
+ .DS_Store?
180
+ ._*
181
+ .Spotlight-V100
182
+ .Trashes
183
+ ehthumbs.db
184
+ Thumbs.db
185
+
186
+ # Common editor files
187
+ *~
188
+ *.swp
@@ -0,0 +1,104 @@
1
+ ci:
2
+ autoupdate_commit_msg: "chore(deps): update pre-commit hooks"
3
+ autofix_commit_msg: "style: pre-commit fixes"
4
+ autoupdate_schedule: "monthly"
5
+
6
+ exclude: ^.cruft.json|.copier-answers.yml$
7
+
8
+ repos:
9
+ - repo: https://github.com/adamchainz/blacken-docs
10
+ rev: "1.20.0"
11
+ hooks:
12
+ - id: blacken-docs
13
+ additional_dependencies: [black==25.*]
14
+
15
+ - repo: https://github.com/pre-commit/pre-commit-hooks
16
+ rev: "v6.0.0"
17
+ hooks:
18
+ - id: check-added-large-files
19
+ - id: check-case-conflict
20
+ - id: check-merge-conflict
21
+ - id: check-symlinks
22
+ - id: check-yaml
23
+ - id: debug-statements
24
+ - id: end-of-file-fixer
25
+ - id: mixed-line-ending
26
+ - id: name-tests-test
27
+ args: ["--pytest-test-first"]
28
+ - id: requirements-txt-fixer
29
+ - id: trailing-whitespace
30
+
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
+ - id: rst-inline-touching-normal
37
+
38
+ - repo: https://github.com/rbubley/mirrors-prettier
39
+ rev: "v3.7.4"
40
+ hooks:
41
+ - id: prettier
42
+ types_or: [yaml, markdown, html, css, scss, javascript, json]
43
+ args: [--prose-wrap=always]
44
+
45
+ - repo: https://github.com/astral-sh/ruff-pre-commit
46
+ rev: "v0.14.11"
47
+ hooks:
48
+ - id: ruff-check
49
+ args: ["--fix", "--show-fixes"]
50
+ - id: ruff-format
51
+
52
+ - repo: https://github.com/pre-commit/mirrors-clang-format
53
+ rev: "v21.1.8"
54
+ hooks:
55
+ - id: clang-format
56
+ types_or: [c++, c, cuda]
57
+
58
+ - repo: https://github.com/pre-commit/mirrors-mypy
59
+ rev: "v1.19.1"
60
+ hooks:
61
+ - id: mypy
62
+ files: src|tests|noxfile.py
63
+ args: []
64
+ additional_dependencies:
65
+ - nox
66
+ - pytest
67
+
68
+ - repo: https://github.com/codespell-project/codespell
69
+ rev: "v2.4.1"
70
+ hooks:
71
+ - id: codespell
72
+ additional_dependencies:
73
+ - tomli; python_version<'3.11'
74
+
75
+ - repo: https://github.com/shellcheck-py/shellcheck-py
76
+ rev: "v0.11.0.1"
77
+ hooks:
78
+ - id: shellcheck
79
+
80
+ - repo: local
81
+ hooks:
82
+ - id: disallow-caps
83
+ name: Disallow improper capitalization
84
+ language: pygrep
85
+ entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
86
+ exclude: .pre-commit-config.yaml
87
+
88
+ - repo: https://github.com/cheshirekow/cmake-format-precommit
89
+ rev: "v0.6.13"
90
+ hooks:
91
+ - id: cmake-format
92
+
93
+ - repo: https://github.com/abravalheri/validate-pyproject
94
+ rev: "v0.24.1"
95
+ hooks:
96
+ - id: validate-pyproject
97
+ additional_dependencies: ["validate-pyproject-schema-store[all]"]
98
+
99
+ - repo: https://github.com/python-jsonschema/check-jsonschema
100
+ rev: "0.36.0"
101
+ hooks:
102
+ - id: check-dependabot
103
+ - id: check-github-workflows
104
+ - id: check-readthedocs