Skip to content

Add --epsilon flag to cell-eval run - #244

Merged
LeonHafner merged 2 commits into
mainfrom
leonhafner/expose-epsilon-cli
Jul 14, 2026
Merged

Add --epsilon flag to cell-eval run#244
LeonHafner merged 2 commits into
mainfrom
leonhafner/expose-epsilon-cli

Conversation

@LeonHafner

@LeonHafner LeonHafner commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

What

Adds an --epsilon flag to cell-eval run that forwards a pseudocount to pdex for the log fold-change denominator.

Why

Epsilon is currently pinned to 0.0 internally with no CLI override. Exposing it lets users pass e.g. 1e-9 (matching pdex>=0.2.5 behavior) to avoid unstable / divide-by-zero log fold-changes when a gene's reference mean is 0.

Details

  • New --epsilon argument, type=float, default=0.0 — no behavior change for existing invocations.
  • Forwarded via pdex_kwargs to both the --celltype-col split path and the single-evaluator path, so it also reaches the data-ceiling DE (mirrors how --cpm-filter is handled).

Also (CI fix)

Drops three now-unused # ty: ignore[invalid-argument-type] suppressions (src/cell_eval/_baseline.py, src/cell_eval/_cli/_prep.py, tutorials/vcc/vcc.ipynb). A newer ty no longer reports invalid-argument-type on AnnData.write_h5ad, so these were failing the typing job as unused-ignore-comment. Pure comment removals, no functional change.

Test plan

  • cell-eval run --help shows --epsilon with [default: 0.0]
  • ruff format --check, ruff check, ty check all pass locally

Versioning: no version bump in this PR — this repo bumps versions in dedicated release commits, so it's intentionally left to the maintainer's release process.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new --epsilon command-line argument to forward a pseudocount to pdex for log fold-change calculations, updating the evaluator setup to pass this parameter. The review feedback recommends adding validation to ensure that the epsilon value is non-negative to prevent potential mathematical errors during computation.

Comment thread src/cell_eval/_cli/_run.py
Expose pdex's log fold-change pseudocount as a CLI option. Defaults to 0.0
(no behavior change from the current pinned default); pass e.g. 1e-9 to match
pdex>=0.2.5 behavior. Forwarded via pdex_kwargs to both the --celltype-col
split path and the single-evaluator path, and thus into the data-ceiling DE,
mirroring how --cpm-filter is handled.
@LeonHafner
LeonHafner force-pushed the leonhafner/expose-epsilon-cli branch from ecd83ff to 6f0eb1c Compare July 14, 2026 18:32
A newer ty no longer reports invalid-argument-type on AnnData.write_h5ad,
so these three suppressions are now flagged unused-ignore-comment and fail
the typing CI. Remove them (no functional change).
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@LeonHafner
LeonHafner merged commit 9fec2db into main Jul 14, 2026
16 checks passed
@LeonHafner
LeonHafner deleted the leonhafner/expose-epsilon-cli branch July 14, 2026 18:42
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.

1 participant