zarr-particle-tools 0.3.4__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 (48) hide show
  1. zarr_particle_tools-0.3.4/.github/workflows/conventional-commits.yml +22 -0
  2. zarr_particle_tools-0.3.4/.github/workflows/py-formatting.yml +26 -0
  3. zarr_particle_tools-0.3.4/.github/workflows/pytest.yml +105 -0
  4. zarr_particle_tools-0.3.4/.github/workflows/release-please.yml +64 -0
  5. zarr_particle_tools-0.3.4/.gitignore +219 -0
  6. zarr_particle_tools-0.3.4/.pre-commit-config.yaml +12 -0
  7. zarr_particle_tools-0.3.4/.release-please.manifest.json +3 -0
  8. zarr_particle_tools-0.3.4/CHANGELOG.md +54 -0
  9. zarr_particle_tools-0.3.4/CONTRIBUTING.md +159 -0
  10. zarr_particle_tools-0.3.4/LICENSE +21 -0
  11. zarr_particle_tools-0.3.4/PKG-INFO +283 -0
  12. zarr_particle_tools-0.3.4/README.md +222 -0
  13. zarr_particle_tools-0.3.4/SECURITY.md +3 -0
  14. zarr_particle_tools-0.3.4/pyproject.toml +84 -0
  15. zarr_particle_tools-0.3.4/pytest.ini +3 -0
  16. zarr_particle_tools-0.3.4/release-please.config.json +29 -0
  17. zarr_particle_tools-0.3.4/src/zarr_particle_tools/__init__.py +1 -0
  18. zarr_particle_tools-0.3.4/src/zarr_particle_tools/cli/__init__.py +0 -0
  19. zarr_particle_tools-0.3.4/src/zarr_particle_tools/cli/options.py +254 -0
  20. zarr_particle_tools-0.3.4/src/zarr_particle_tools/cli/types.py +58 -0
  21. zarr_particle_tools-0.3.4/src/zarr_particle_tools/core/backprojection.py +326 -0
  22. zarr_particle_tools-0.3.4/src/zarr_particle_tools/core/constants.py +89 -0
  23. zarr_particle_tools-0.3.4/src/zarr_particle_tools/core/ctf.py +172 -0
  24. zarr_particle_tools-0.3.4/src/zarr_particle_tools/core/data.py +180 -0
  25. zarr_particle_tools-0.3.4/src/zarr_particle_tools/core/dose.py +65 -0
  26. zarr_particle_tools-0.3.4/src/zarr_particle_tools/core/forwardprojection.py +340 -0
  27. zarr_particle_tools-0.3.4/src/zarr_particle_tools/core/helpers.py +202 -0
  28. zarr_particle_tools-0.3.4/src/zarr_particle_tools/core/mask.py +50 -0
  29. zarr_particle_tools-0.3.4/src/zarr_particle_tools/core/symmetry.py +500 -0
  30. zarr_particle_tools-0.3.4/src/zarr_particle_tools/core/symmetry_constants.py +289 -0
  31. zarr_particle_tools-0.3.4/src/zarr_particle_tools/generate/__init__.py +0 -0
  32. zarr_particle_tools-0.3.4/src/zarr_particle_tools/generate/cdp_cache.py +440 -0
  33. zarr_particle_tools-0.3.4/src/zarr_particle_tools/generate/cdp_generate_starfiles.py +746 -0
  34. zarr_particle_tools-0.3.4/src/zarr_particle_tools/generate/copick_generate_starfiles.py +95 -0
  35. zarr_particle_tools-0.3.4/src/zarr_particle_tools/pipeliner/__init__.py +0 -0
  36. zarr_particle_tools-0.3.4/src/zarr_particle_tools/pipeliner/subtomo_extract_pipeliner_job.py +77 -0
  37. zarr_particle_tools-0.3.4/src/zarr_particle_tools/pipeliner/subtomo_reconstruct_pipeliner_job.py +82 -0
  38. zarr_particle_tools-0.3.4/src/zarr_particle_tools/subtomo_extract.py +918 -0
  39. zarr_particle_tools-0.3.4/src/zarr_particle_tools/subtomo_reconstruct.py +810 -0
  40. zarr_particle_tools-0.3.4/src/zarr_particle_tools/tools/__init__.py +0 -0
  41. zarr_particle_tools-0.3.4/src/zarr_particle_tools/tools/compare_mrcs.py +307 -0
  42. zarr_particle_tools-0.3.4/tests/__init__.py +0 -0
  43. zarr_particle_tools-0.3.4/tests/conftest.py +94 -0
  44. zarr_particle_tools-0.3.4/tests/helpers/compare.py +143 -0
  45. zarr_particle_tools-0.3.4/tests/test_extract.py +190 -0
  46. zarr_particle_tools-0.3.4/tests/test_generate.py +166 -0
  47. zarr_particle_tools-0.3.4/tests/test_reconstruct.py +215 -0
  48. zarr_particle_tools-0.3.4/uv.lock +3296 -0
@@ -0,0 +1,22 @@
1
+ # Validates PR title follows conventional commits
2
+ name: conventional-commits
3
+ permissions:
4
+ contents: read
5
+
6
+ on:
7
+ pull_request:
8
+ branches: [main]
9
+ types:
10
+ - edited
11
+ - opened
12
+ - synchronize
13
+ - reopened
14
+
15
+ concurrency:
16
+ group: ${{ github.workflow }}-${{ github.ref }}
17
+ cancel-in-progress: true
18
+ jobs:
19
+ conventional_commit_title:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: chanzuckerberg/github-actions/.github/actions/conventional-commits@9a7a0d55060523befd055d301c29d9190cd0244f
@@ -0,0 +1,26 @@
1
+ name: Python Linting
2
+
3
+ permissions:
4
+ contents: read
5
+
6
+ on:
7
+ pull_request:
8
+ push:
9
+ branches: [main]
10
+
11
+ jobs:
12
+ pre_commit_checks:
13
+ name: pre-commit checks
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
17
+ - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
18
+ with:
19
+ python-version: "3.12.6"
20
+ - name: Install action-validator with asdf
21
+ uses: asdf-vm/actions/install@b7bcd026f18772e44fe1026d729e1611cc435d47
22
+ with:
23
+ tool_versions: |
24
+ action-validator 0.6.0
25
+ - name: check linting
26
+ uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd
@@ -0,0 +1,105 @@
1
+ name: Run Pytest
2
+ permissions:
3
+ contents: read
4
+
5
+ on:
6
+ push:
7
+ branches: [main]
8
+ pull_request:
9
+ branches: [main]
10
+ workflow_dispatch:
11
+
12
+ concurrency:
13
+ group: pytest
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ test:
18
+ runs-on: ubuntu-latest
19
+
20
+ strategy:
21
+ matrix:
22
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
23
+ include:
24
+ - python-version: "3.10"
25
+ cache: true
26
+
27
+ steps:
28
+ - name: Maximize build space (#1)
29
+ uses: mathio/gha-cleanup@aca3d43a05bf564f5fc69acb929a65b01797f22b
30
+ with:
31
+ remove-browsers: true
32
+ verbose: true
33
+
34
+ - name: Maximize build space (#2)
35
+ run: |
36
+ set +e
37
+ sudo apt-get purge temurin-*-jdk adoptopenjdk-* adoptium-ca-certificates openjdk-* session-manager-plugin azure-cli google-cloud-cli heroku
38
+ sudo apt-get purge postgresql-* libpq-dev libmysqlclient* msodbcsql* mssql-tools unixodbc-dev mysql-client* mysql-common mysql-server* php*-*sql sphinxsearch mongodb*
39
+ sudo rm -rf /usr/share/dotnet
40
+ sudo rm -rf /usr/local/lib/android
41
+ sudo rm -rf /opt/ghc
42
+ sudo rm -rf /usr/local/lib/terraform
43
+ sudo rm -rf /usr/lib/jvm/ /usr/local/graalvm /usr/share/java/selenium-server*.jar
44
+ sudo rm -rf /usr/share/mysql* /opt/mssql-tools /usr/local/sqlpackage
45
+ sudo rm -rf /usr/local/bin/aliyun /usr/local/bin/aws /usr/local/bin/aws_completer /usr/local/aws-cli /usr/local/aws /usr/local/aws-sam-cli /usr/local/bin/azcopy* /usr/share/az_* /opt/az /usr/bin/az /usr/share/google-cloud-sdk /usr/lib/google-cloud-sdk /usr/local/bin/bicep /usr/local/bin/oc /usr/local/bin/oras /usr/local/lib/heroku
46
+ docker rm -vf $(docker ps -aq)
47
+ docker rmi -f $(docker images -aq)
48
+ docker system df
49
+
50
+ - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
51
+
52
+ - name: Set up Python
53
+ uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
54
+ with:
55
+ python-version: ${{ matrix.python-version }}
56
+
57
+ - name: Install dependencies
58
+ run: |
59
+ python -m pip install --upgrade pip
60
+ pip install uv
61
+ uv pip install --system -e .[dev]
62
+
63
+ - name: Restore test data from cache
64
+ id: cache
65
+ uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830
66
+ with:
67
+ path: tests/data
68
+ key: zenodo-17529862
69
+
70
+ - name: Download test data from Zenodo (cache miss)
71
+ if: steps.cache.outputs.cache-hit != 'true'
72
+ shell: bash
73
+ run: |
74
+ set -euxo pipefail
75
+ mkdir -p tests/data
76
+ cd tests/data
77
+
78
+ # Download both files with retries and resume
79
+ curl -L --fail --retry 5 --retry-delay 5 --continue-at - \
80
+ -o zarr_particle_tools_test_data_large.tar.gz \
81
+ "https://zenodo.org/records/17529862/files/zarr_particle_tools_test_data_large.tar.gz?download=1"
82
+
83
+ curl -L --fail --retry 5 --retry-delay 5 --continue-at - \
84
+ -o zarr_particle_tools_test_data_small.tar.gz \
85
+ "https://zenodo.org/records/17529862/files/zarr_particle_tools_test_data_small.tar.gz?download=1"
86
+
87
+ - name: Save test data to cache
88
+ if: ${{ matrix.cache && steps.cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/main' }}
89
+ uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830
90
+ with:
91
+ path: tests/data
92
+ key: zenodo-17529862
93
+
94
+ - name: Extract test data from tar.gz files
95
+ run: |
96
+ # Extract
97
+ cd tests/data
98
+ for f in *.tar.gz; do tar -xzf "$f"; done
99
+
100
+ - name: List contents
101
+ run: ls -lah tests/data
102
+
103
+ - name: Run tests
104
+ run: |
105
+ pytest -n auto -vvv
@@ -0,0 +1,64 @@
1
+ name: Create Release PRs
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches:
7
+ - main
8
+
9
+ permissions:
10
+ contents: write
11
+ issues: write
12
+ pull-requests: write
13
+
14
+ jobs:
15
+ release-please:
16
+ concurrency:
17
+ group: ${{ github.workflow }}-${{ github.ref }}
18
+ cancel-in-progress: true
19
+
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - name: release please
23
+ uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38
24
+ id: release
25
+ with:
26
+ manifest-file: ".release-please.manifest.json"
27
+ config-file: "release-please.config.json"
28
+ target-branch: "main"
29
+ token: ${{ secrets.GITHUB_TOKEN }}
30
+
31
+ outputs:
32
+ paths_released: ${{ steps.release.outputs.paths_released }}
33
+
34
+ publish-pypi-package:
35
+ name: Build and publish Python package to PyPI
36
+ runs-on: ubuntu-latest
37
+ needs: release-please
38
+ if: contains(needs.release-please.outputs.paths_released, '.')
39
+ environment:
40
+ name: pypi
41
+ url: https://pypi.org/p/zarr-particle-tools
42
+ permissions:
43
+ id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
44
+ steps:
45
+ - name: Checkout ref branch
46
+ uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
47
+ with:
48
+ ref: ${{ github.ref }}
49
+ fetch-depth: 0
50
+
51
+ - name: Install uv
52
+ uses: astral-sh/setup-uv@5a7eac68fb9809dea845d802897dc5c723910fa3
53
+ with:
54
+ version: "0.7.13"
55
+ python-version: "3.12"
56
+
57
+ - name: build
58
+ run: |
59
+ uv build
60
+
61
+ - name: Publish distribution 📦 to PyPI
62
+ uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
63
+ with:
64
+ packages-dir: dist
@@ -0,0 +1,219 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
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
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
208
+
209
+ # analysis results
210
+ mrc_comparison_results*/
211
+
212
+ # test output files
213
+ tests/output/
214
+
215
+ # test data (input) files
216
+ tests/data/
217
+
218
+ # demo scripts and whatnot
219
+ demo/
@@ -0,0 +1,12 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.12.10
4
+ hooks:
5
+ - id: ruff
6
+ args: [--fix, --exit-non-zero-on-fix]
7
+ types_or: [python, pyi]
8
+
9
+ - repo: https://github.com/psf/black
10
+ rev: 25.1.0
11
+ hooks:
12
+ - id: black
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.3.4"
3
+ }
@@ -0,0 +1,54 @@
1
+ # Changelog
2
+
3
+ ## [0.3.4](https://github.com/czimaginginstitute/zarr-particle-tools/compare/zarr-particle-tools-v0.3.3...zarr-particle-tools-v0.3.4) (2025-11-17)
4
+
5
+
6
+ ### 🐞 Bug Fixes
7
+
8
+ * Remove CCPEM-pipeliner extra dependency. ([#16](https://github.com/czimaginginstitute/zarr-particle-tools/issues/16)) ([1ca9f32](https://github.com/czimaginginstitute/zarr-particle-tools/commit/1ca9f3260bc47613caba2f90efb4d64433bccba2))
9
+
10
+ ## [0.3.3](https://github.com/czimaginginstitute/zarr-particle-tools/compare/zarr-particle-tools-v0.3.2...zarr-particle-tools-v0.3.3) (2025-11-17)
11
+
12
+
13
+ ### 🧹 Miscellaneous Chores
14
+
15
+ * Enable publishing workflow for PyPI ([#14](https://github.com/czimaginginstitute/zarr-particle-tools/issues/14)) ([3b1fa32](https://github.com/czimaginginstitute/zarr-particle-tools/commit/3b1fa32e61150e758adc92bd79e6d2966c4546b5))
16
+
17
+ ## [0.3.2](https://github.com/czimaginginstitute/zarr-particle-tools/compare/zarr-particle-tools-v0.3.1...zarr-particle-tools-v0.3.2) (2025-11-17)
18
+
19
+
20
+ ### 🧹 Miscellaneous Chores
21
+
22
+ * Address medium security vulnerabilities. ([#11](https://github.com/czimaginginstitute/zarr-particle-tools/issues/11)) ([bdd500b](https://github.com/czimaginginstitute/zarr-particle-tools/commit/bdd500b5a0ac668169544d8d3dad7fa125af8147))
23
+
24
+ ## [0.3.1](https://github.com/czimaginginstitute/zarr-particle-tools/compare/zarr-particle-tools-v0.3.0...zarr-particle-tools-v0.3.1) (2025-11-17)
25
+
26
+
27
+ ### 🐞 Bug Fixes
28
+
29
+ * add CONTRIBUTING.md ([#8](https://github.com/czimaginginstitute/zarr-particle-tools/issues/8)) ([d1a6a07](https://github.com/czimaginginstitute/zarr-particle-tools/commit/d1a6a071c10ba2a48c973dda187155d6220957f2))
30
+ * use caching for pytest only on main ([#7](https://github.com/czimaginginstitute/zarr-particle-tools/issues/7)) ([c2f7f99](https://github.com/czimaginginstitute/zarr-particle-tools/commit/c2f7f99218f145fac2f5ca2e6e3671cf431de506))
31
+
32
+ ## [0.3.0](https://github.com/czimaginginstitute/zarr-particle-tools/compare/zarr-particle-tools-v0.2.0...zarr-particle-tools-v0.3.0) (2025-11-14)
33
+
34
+
35
+ ### ✨ Features
36
+
37
+ * add rich logging, minor README updates, add tests & bugfix extraction from data portal ([#4](https://github.com/czimaginginstitute/zarr-particle-tools/issues/4)) ([b9feb7e](https://github.com/czimaginginstitute/zarr-particle-tools/commit/b9feb7e90464dfb33e09e7650b319ecb849ba624))
38
+
39
+
40
+ ### 🐞 Bug Fixes
41
+
42
+ * pytest caching ([#5](https://github.com/czimaginginstitute/zarr-particle-tools/issues/5)) ([8102fd9](https://github.com/czimaginginstitute/zarr-particle-tools/commit/8102fd9297085fafcfb912f1cba7c44a90ec3f5e))
43
+
44
+ ## [0.2.0](https://github.com/czimaginginstitute/zarr-particle-tools/compare/zarr-particle-tools-v0.1.0...zarr-particle-tools-v0.2.0) (2025-11-14)
45
+
46
+
47
+ ### ✨ Features
48
+
49
+ * setup ci/cd pytest and improve tests ([#2](https://github.com/czimaginginstitute/zarr-particle-tools/issues/2)) ([552c2ad](https://github.com/czimaginginstitute/zarr-particle-tools/commit/552c2ad1a51eed3ba637cd68524c542d00c97b37))
50
+
51
+
52
+ ### 🧹 Miscellaneous Chores
53
+
54
+ * add RP, prep for open source ([#1](https://github.com/czimaginginstitute/zarr-particle-tools/issues/1)) ([add0ae1](https://github.com/czimaginginstitute/zarr-particle-tools/commit/add0ae1ba0ba1ff3b93751b153ae18ec344e492f))
@@ -0,0 +1,159 @@
1
+ # Contributing to zarr-particle-tools
2
+
3
+ Thank you for your interest in contributing to zarr-particle-tools! This document provides guidelines and instructions for contributing to the project.
4
+
5
+ ## Ways to Contribute
6
+
7
+ There are many ways to contribute to zarr-particle-tools:
8
+
9
+ - **Report bugs**: Open an issue describing the bug and how to reproduce it
10
+ - **Suggest features**: Open an issue describing the feature you'd like to see
11
+ - **Improve documentation**: Fix typos, clarify instructions, or add examples
12
+ - **Write tests**: Increase test coverage or add tests for edge cases
13
+ - **Fix bugs**: Submit a pull request fixing an open issue
14
+ - **Add features**: Implement new functionality or address limitations listed in the README
15
+
16
+ ## Getting Started
17
+
18
+ ### Development Setup
19
+
20
+ 1. **Fork and clone the repository**:
21
+ ```bash
22
+ git clone git@github.com:YOUR-USERNAME/zarr-particle-tools.git
23
+ cd zarr-particle-tools
24
+ ```
25
+
26
+ 2. **Create a conda environment** (recommended):
27
+ ```bash
28
+ conda create -n zarr-particle-tools-dev python=3.12
29
+ conda activate zarr-particle-tools-dev
30
+ pip install uv
31
+ ```
32
+
33
+ 3. **Install the package in development mode**:
34
+ ```bash
35
+ uv pip install -e .[dev]
36
+ ```
37
+
38
+ 4. **Set up pre-commit hooks**:
39
+ ```bash
40
+ pre-commit install
41
+ ```
42
+
43
+ This will automatically run code formatters and linters before each commit.
44
+
45
+ ### Download Test Data (Optional)
46
+
47
+ To run the full test suite, you'll need to download the test data:
48
+
49
+ ```bash
50
+ mkdir -p tests/data
51
+ cd tests/data
52
+
53
+ # Download test data from Zenodo
54
+ curl -L --fail --retry 5 --retry-delay 5 --continue-at - \
55
+ -o zarr_particle_tools_test_data_large.tar.gz \
56
+ "https://zenodo.org/records/17338016/files/zarr_particle_tools_test_data_large.tar.gz?download=1"
57
+ curl -L --fail --retry 5 --retry-delay 5 --continue-at - \
58
+ -o zarr_particle_tools_test_data_small.tar.gz \
59
+ "https://zenodo.org/records/17338016/files/zarr_particle_tools_test_data_small.tar.gz?download=1"
60
+
61
+ # Extract
62
+ for f in *.tar.gz; do tar -xzf "$f"; done
63
+ ```
64
+
65
+ ## Development Workflow
66
+
67
+ ### Making Changes
68
+
69
+ 1. **Create a new branch** for your changes:
70
+ ```bash
71
+ git checkout -b your-feature-branch
72
+ ```
73
+
74
+ 2. **Make your changes** following the code style guidelines below
75
+
76
+ 3. **Run tests** to ensure your changes don't break existing functionality:
77
+ ```bash
78
+ pytest
79
+ ```
80
+
81
+ 4. **Commit your changes** with a clear, descriptive commit message:
82
+ ```bash
83
+ git add .
84
+ git commit -m "Add feature X" -m "Detailed description of changes"
85
+ ```
86
+
87
+ 5. **Push to your fork**:
88
+ ```bash
89
+ git push origin your-feature-branch
90
+ ```
91
+
92
+ ### Code Style
93
+
94
+ This project uses automated code formatting and linting tools:
95
+
96
+ - **[Black](https://black.readthedocs.io/)**: Code formatter with line length 120
97
+ - **[Ruff](https://docs.astral.sh/ruff/)**: Fast Python linter
98
+
99
+ Pre-commit hooks will automatically format your code when you commit. You can also run these tools manually:
100
+
101
+ ```bash
102
+ # Format code with Black
103
+ black src/ tests/
104
+
105
+ # Run Ruff linter
106
+ ruff check src/ tests/ --fix
107
+ ```
108
+
109
+ ### Code Guidelines
110
+
111
+ - Follow PEP 8 style guidelines (enforced by Ruff)
112
+ - Write clear, descriptive variable and function names
113
+ - Add docstrings to all public functions and classes
114
+ - Keep functions focused and modular
115
+ - Add type hints where appropriate
116
+ - Comment complex logic or algorithms
117
+
118
+ ### Testing
119
+
120
+ - Write tests for new features or bug fixes
121
+ - Place tests in the `tests/` directory
122
+ - Run the test suite with `pytest`
123
+ - Run tests in parallel with `pytest -n auto` (requires pytest-xdist)
124
+ - Ensure all tests pass before submitting a pull request
125
+
126
+ The test suite compares output with RELION 5.0 to ensure numerical precision. Different tolerance levels are used for:
127
+ - float16 data (relaxed tolerance due to reduced precision)
128
+ - Experimental data (relaxed tolerance due to noise)
129
+
130
+ ### Documentation
131
+
132
+ - Update the README.md if you add new features or change existing behavior
133
+ - Add examples for new command-line options
134
+ - Update docstrings for modified functions
135
+ - Add entries to CHANGELOG.md for notable changes
136
+
137
+ ## Submitting a Pull Request
138
+
139
+ 1. **Ensure your code passes all tests** and follows the code style guidelines
140
+ 2. **Update documentation** as needed
141
+ 3. **Push your changes** to your fork
142
+ 4. **Open a pull request** against the `main` branch of the main repository
143
+ 5. **Describe your changes** in the pull request description:
144
+ - What problem does it solve?
145
+ - What changes did you make?
146
+ - Are there any breaking changes?
147
+ - Have you added tests?
148
+
149
+ ## Code of Conduct
150
+
151
+ This project adheres to the Contributor Covenant [code of conduct](https://github.com/chanzuckerberg/.github/blob/main/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [opensource@chanzuckerberg.com](mailto:opensource@chanzuckerberg.com).
152
+
153
+ ## Security Issues
154
+
155
+ If you believe you have found a security issue, please responsibly disclose by contacting us at [security@chanzuckerberg.com](mailto:security@chanzuckerberg.com). Do not open a public issue.
156
+
157
+ ## License
158
+
159
+ By contributing to zarr-particle-tools, you agree that your contributions will be licensed under the [MIT License](LICENSE).
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Chan Zuckerberg Imaging Institute (CZII)
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.