Conversation
There was a problem hiding this comment.
Pull request overview
This PR makes the dask dependency optional for alphaquant to reduce the base installation footprint. The dask library is now only required when processing very large PTM files that don't fit in memory.
Changes:
- Removed
daskandpyfastafrom core requirements files - Created separate optional dependency groups (
daskanddask-stable) inpyproject.toml - Added runtime checks in PTM mapping code to gracefully handle missing
daskdependency - Updated all build scripts, Docker configurations, and CI workflows to include the
daskextra - Added documentation in README explaining when and how to install the optional
daskextra
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| requirements/requirements_loose.txt | Removed dask and pyfasta from loose dependencies |
| requirements/requirements.txt | Removed dask and pyfasta from pinned dependencies |
| requirements/requirements_dask_loose.txt | Created new file for optional dask dependency without version pin |
| requirements/requirements_dask.txt | Created new file for optional dask dependency with pinned version |
| pyproject.toml | Added dask and dask-stable as optional dependency groups |
| alphaquant/ptm/ptmsite_mapping.py | Added try/except import for dask with helpful error messages |
| README.md | Added documentation for installing the optional dask extra |
| release/windows/build_installer_windows.ps1 | Updated installer to include dask-stable extra |
| release/macos/build_installer_macos.sh | Updated installer to include dask-stable extra |
| release/linux/build_installer_linux.sh | Updated installer to include dask-stable extra |
| Dockerfile | Updated Docker build to include dask-stable extra |
| .binder/Dockerfile | Updated Binder Docker build to include dask-stable extra |
| .github/workflows/run_example_nbs.yml | Updated CI workflow to include dask extra |
| .github/workflows/install_and_unit_tests_multiple_platforms.yml | Updated CI workflow to include dask extras |
| .github/workflows/install_and_unit_tests.yml | Updated CI workflow to include dask extra |
| .github/workflows/e2e_tests_quick_multiple_platforms.yml | Updated CI workflow to include dask extras |
| .github/workflows/e2e_tests_quick.yml | Updated CI workflow to include dask extra |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
alphaquant/ptm/ptmsite_mapping.py
Outdated
| except ModuleNotFoundError: | ||
| HAS_DASK = False | ||
| warnings.warn( | ||
| "Dependency 'dask' not installed. If you want to use its functionality, install alphaquant with the 'dask' extra. Falling back to non-dask based processing." |
There was a problem hiding this comment.
The warning message mentions "Falling back to non-dask based processing" but the code doesn't actually provide a fallback implementation. The assign_dataset_chunkwise function will raise an ImportError if called without dask. The warning should be removed or clarified to indicate that dask functionality will not be available rather than suggesting a fallback exists.
| "Dependency 'dask' not installed. If you want to use its functionality, install alphaquant with the 'dask' extra. Falling back to non-dask based processing." | |
| "Dependency 'dask' not installed. Dask-based out-of-memory PTM site mapping will be unavailable. " | |
| "If you want to use this functionality, install alphaquant with the 'dask' extra." |
66b0c73 to
8d825cb
Compare
Motivation: have slimmer dependencies for alphapeptools