Skip to content

Make dask optional#120

Merged
mschwoer merged 4 commits intomainfrom
make-dask-optional
Jan 28, 2026
Merged

Make dask optional#120
mschwoer merged 4 commits intomainfrom
make-dask-optional

Conversation

@mschwoer
Copy link
Copy Markdown
Contributor

Motivation: have slimmer dependencies for alphapeptools

@mschwoer mschwoer requested a review from Copilot January 27, 2026 13:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 dask and pyfasta from core requirements files
  • Created separate optional dependency groups (dask and dask-stable) in pyproject.toml
  • Added runtime checks in PTM mapping code to gracefully handle missing dask dependency
  • Updated all build scripts, Docker configurations, and CI workflows to include the dask extra
  • Added documentation in README explaining when and how to install the optional dask extra

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.

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."
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"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."

Copilot uses AI. Check for mistakes.
@mschwoer mschwoer requested a review from ammarcsj January 28, 2026 11:14
Copy link
Copy Markdown
Member

@ammarcsj ammarcsj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mschwoer mschwoer merged commit c4e3c9b into main Jan 28, 2026
4 checks passed
@mschwoer mschwoer deleted the make-dask-optional branch January 28, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants