Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/workflows/test.yml
Comment thread
jenna-tomkinson marked this conversation as resolved.
Resolved
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)"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ venv.bak/
.dmypy.json
dmypy.json

# ruff
.ruff_cache/

# Pyre type checker
.pyre/

Expand Down
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
Comment thread
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
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
Comment thread
jenna-tomkinson marked this conversation as resolved.
Resolved
50 changes: 50 additions & 0 deletions CITATION.cff
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
Loading