Repository navigation
Package cp_parallel as an installable library - #11
Conversation
…mmit, and a tutorial notebook Consolidates the cp_parallel.py/cp_utils.py helper that has been copy-pasted and independently patched across ~15 Way Science repos into a single, pip/uv-installable package covering the union of features those copies accumulated: plate- or well-level grouping, image-directory or LoadData CSV input, batch processing by image-set range, HPC support (CPU-affinity-aware worker counts, Apptainer/Singularity), and per-plate plugin directories. - src/cp_parallel/: unified run_cellprofiler_parallel implementation, packaged with pyproject.toml/uv.lock (requires-python >=3.8 to match real CellProfiler conda environments; verified installable and importable there). - tests/: 35 tests, 100% coverage, no real CellProfiler/Apptainer binary needed. - .pre-commit-config.yaml + .github/workflows/: ruff lint/format, pytest, and a Python 3.8/3.9 install-compat smoke test, all wired into CI. - examples/cp_parallel_tutorial.ipynb: runnable walkthrough of every mode. - assets/: a small code-generated SVG logo for the README. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
There was a problem hiding this comment.
I would avoid the cellprofiler simulation and instead use the real deal. Consider also adding some non-notebook prep for this if needed to help configure for running.
There was a problem hiding this comment.
Fwiw, I have never been able to get CP to work in anything under python 3.9 - maybe this is the reason for a simulation?
There was a problem hiding this comment.
Following up - is there anyway to point to a default/prefered docker image? Or easier to allow for the user to pick?
There was a problem hiding this comment.
I made this into an issue so that we can have a new tutorial that shows using CellProfiler in real life, that I can address in a future PR. Thank you both!
There was a problem hiding this comment.
Consider showing simply how running in parallel is faster than serial / normal (and by how much) using perhaps simple timing information or a plot.
There was a problem hiding this comment.
I agree with this but I think it needs to be in a separate file/module and is not the goal of a tutorial.
Showing some profiling would be great.
There was a problem hiding this comment.
Added issue for this to address in another PR, thank you both for this suggestion!
There was a problem hiding this comment.
Fwiw, I have never been able to get CP to work in anything under python 3.9 - maybe this is the reason for a simulation?
There was a problem hiding this comment.
I agree with this but I think it needs to be in a separate file/module and is not the goal of a tutorial.
Showing some profiling would be great.
There was a problem hiding this comment.
Following up - is there anyway to point to a default/prefered docker image? Or easier to allow for the user to pick?
|
@d33bs @MikeLippincott Thank you both for your reviews! I am merging now and hope to address the new issues you both mentioned in a future PR soon! |
Summary
cp_parallel.py/cp_utils.pyhelper copy-pasted and independently patched across ~15 Way Science repos into one pip/uv-installable package (src/cp_parallel/), covering the union of features those copies accumulated: plate- or well-level grouping, image-directory or LoadData CSV input, batch processing by image-set range, HPC support (CPU-affinity-aware worker counts, Apptainer/Singularity), and per-plate plugin directories.requires-python >=3.8to match real CellProfiler conda environments — verified installable and importable in several of the actual WayScience CellProfiler conda envs (CellProfiler 4.x on Python 3.8).tests/, 35 tests, 100% coverage, no real CellProfiler/Apptainer binary needed),ruff+pre-commit+ GitHub Actions CI (lint, multi-version tests, and a Python 3.8/3.9 install-compat smoke test).examples/cp_parallel_tutorial.ipynb) covering every mode, and a small code-generated SVG logo for the README.Test plan
uv run pytest --cov=cp_parallel— 35 passed, 100% coverageuv run ruff check ./uv run ruff format --check .uv run pre-commit run --all-filespip install+import cp_parallelin real WayScience CellProfiler conda environments (Python 3.8)🤖 Generated with Claude Code