Repository navigation
Package cp_parallel as an installable library #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jenna-tomkinson
merged 7 commits into
WayScience:main
from
jenna-tomkinson:add_cp_parallel
Nov 20, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5dae777
Package cp_parallel as an installable library, with tests, uv, pre-co…
jenna-tomkinson 9cb833c
add functionality to use all cores
jenna-tomkinson 0e72240
update run_parallel name and add tree to tutorial
jenna-tomkinson 86ed81e
add ty to precommit
jenna-tomkinson 0f09bd5
add test for installing via outside link
jenna-tomkinson bf3272c
add dynamic versioning
jenna-tomkinson d336c4f
add citations file
jenna-tomkinson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| name: Test | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # full history + tags, so setuptools-scm sees the real version | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v10.4.0 | ||
| - name: Install dependencies | ||
| run: uv sync --group dev | ||
| - name: Run pre-commit | ||
| run: uv run pre-commit run --all-files | ||
|
|
||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| # Kept in sync with `[tool.uv] environments` in pyproject.toml: the dev | ||
| # dependency group (pytest, pre-commit, ...) only resolves on these | ||
| # versions. Compatibility with CellProfiler's own (older) Python, down to | ||
| # the package's real `requires-python` floor, is covered by the | ||
| # `compat` job below instead, via a plain `pip install` with no dev deps. | ||
| python-version: ["3.10", "3.11", "3.12"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # full history + tags, so setuptools-scm sees the real version | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v10.4.0 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install dependencies | ||
| run: uv sync --group dev | ||
| - name: Run tests | ||
| run: uv run pytest --cov=cp_parallel --cov-report=term-missing | ||
|
|
||
| compat: | ||
| # Smoke-tests that the published package itself -- no dev tooling -- still | ||
| # installs and imports on the older Python versions that real CellProfiler | ||
| # conda environments commonly run (e.g. CellProfiler 4.x on Python 3.8). | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.8", "3.9"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # full history + tags, so setuptools-scm sees the real version | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install the package (no dev dependencies) | ||
| run: pip install . | ||
| - name: Import sanity check | ||
| run: python -c "import cp_parallel; print(cp_parallel.run_parallel)" | ||
|
|
||
| install-from-github: | ||
| # Installs the package the way the README tells users to -- straight from a | ||
| # GitHub URL with `pip install git+https://...` -- with no local checkout, so | ||
| # it catches anything missing from the built package (e.g. files only present | ||
| # in the repo tree). Pinned to the commit under test: for a PR, that's the | ||
| # PR's head commit, which GitHub exposes on the base repo even for forks. | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.8", "3.12"] | ||
| env: | ||
| INSTALL_URL: git+https://github.com/${{ github.repository }}.git@${{ github.event.pull_request.head.sha || github.sha }} | ||
| steps: | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install from GitHub URL | ||
| run: pip install "$INSTALL_URL" | ||
| - name: Import sanity check (outside any source tree) | ||
| working-directory: ${{ runner.temp }} | ||
| run: | | ||
| python -c "import cp_parallel; print(cp_parallel.__file__); print(cp_parallel.run_parallel)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -145,6 +145,9 @@ venv.bak/ | |
| .dmypy.json | ||
| dmypy.json | ||
|
|
||
| # ruff | ||
| .ruff_cache/ | ||
|
|
||
| # Pyre type checker | ||
| .pyre/ | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| repos: | ||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
|
jenna-tomkinson marked this conversation as resolved.
Resolved
|
||
| rev: v0.17.5 | ||
| hooks: | ||
| - id: ruff-check | ||
| args: [--fix] | ||
| - id: ruff-format | ||
|
|
||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v6.0.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - id: mixed-line-ending | ||
| args: [--fix=lf] | ||
| - id: check-yaml | ||
| - id: check-toml | ||
| - id: check-added-large-files | ||
| - id: check-merge-conflict | ||
|
|
||
| - repo: local | ||
| hooks: | ||
| - id: ty | ||
| name: ty check | ||
| # Runs the ty version pinned in uv.lock (dev group), so pre-commit and | ||
| # `uv run ty check` always agree. | ||
| entry: uv run ty check | ||
| language: system | ||
| types: [python] | ||
| pass_filenames: false | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.11 | ||
|
jenna-tomkinson marked this conversation as resolved.
Resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| cff-version: 1.2.0 | ||
| message: >- | ||
| If you use cp_parallel in your work, please cite it using the metadata below, | ||
| and also cite CellProfiler, which cp_parallel runs (see "references"). | ||
| title: "cp_parallel: run CellProfiler headless in parallel across plates or wells" | ||
| type: software | ||
| authors: | ||
| - given-names: Jenna | ||
| family-names: Tomkinson | ||
| affiliation: University of Colorado Anschutz Medical Campus | ||
| - given-names: Dave | ||
| family-names: Bunten | ||
| affiliation: University of Colorado Anschutz Medical Campus | ||
| - given-names: Mike | ||
| family-names: Lippincott | ||
| affiliation: University of Colorado Anschutz Medical Campus | ||
| repository-code: "https://github.com/WayScience/CP_Parallel" | ||
| abstract: >- | ||
| cp_parallel is a small Python package that runs CellProfiler headless on | ||
| multiple plates (or wells) in parallel, writing one log file per run. It | ||
| supports plate- and well-level grouping, LoadData CSVs, batch processing by | ||
| image-set range, and running inside Apptainer/Singularity containers on HPC. | ||
| keywords: | ||
| - CellProfiler | ||
| - Cell Painting | ||
| - image analysis | ||
| - parallel processing | ||
| - high-content screening | ||
| license: BSD-3-Clause | ||
| references: | ||
| - type: article | ||
| title: "CellProfiler 4: improvements in speed, utility and usability" | ||
| authors: | ||
| - given-names: David R. | ||
| family-names: Stirling | ||
| - given-names: Madison J. | ||
| family-names: Swain-Bowden | ||
| - given-names: Alice M. | ||
| family-names: Lucas | ||
| - given-names: Anne E. | ||
| family-names: Carpenter | ||
| - given-names: Beth A. | ||
| family-names: Cimini | ||
| - given-names: Allen | ||
| family-names: Goodman | ||
| journal: BMC Bioinformatics | ||
| volume: 22 | ||
| start: 433 | ||
| year: 2021 | ||
| doi: 10.1186/s12859-021-04344-9 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.