Skip to content

Clear errors at the edges, and one read that should not happen - #106

Merged
timtreis merged 7 commits into
mainfrom
fix/papercuts
Sep 21, 2026
Merged

timtreis merged 7 commits into
mainfrom
fix/papercuts

Conversation

@timtreis

Copy link
Copy Markdown
Member

Four review findings, one commit each, all independent.

A test per fix, each verified to fail on main and pass here. test_backed.py's read-counting setup is now a reads fixture, shared by the existing test and the new one.

n_components=1 fitted one component and then read embedding[:, 1], so the
caller saw an IndexError from inside matplotlib's argument rather than the
parameter that was wrong. Closes #54.
pl.transport read levels[-1] off an empty table. Its siblings pl.subpopulation_hits
and pl.pathway_coherence both raise a ValueError naming what produced nothing, and
an empty table is a plausible result when no pair of settings is comparable. Closes #55.
numpy's nan-functions raise theirs through warnings.warn, not through the
floating-point error state, so np.errstate never reached them: a feature that
failed on every cell left three RuntimeWarnings in the caller's output. The
catch_warnings idiom here is the one pp/_qc.py already uses. Closes #57.
np.empty_like(get_matrix(adata, layer)) read every row to learn a shape and a
dtype it then threw away, which on a backed object is a full read on top of the
per-group reads the streaming path was written to do. Closes #67.
@read-the-docs-community

read-the-docs-community Bot commented Sep 20, 2026

Copy link
Copy Markdown

Documentation build overview

📚 mantispy | 🛠️ Build #34664678 | 📁 Comparing 66cd0a4 against latest (16a425c)

  🔍 Preview build  

2 files changed
± generated/mantispy.pl.control_drift.html
± generated/mantispy.pl.transport.html

@codecov-commenter

codecov-commenter commented Sep 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.06%. Comparing base (16a425c) to head (66cd0a4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #106   +/-   ##
=======================================
  Coverage   89.05%   89.06%           
=======================================
  Files          80       80           
  Lines        5884     5887    +3     
=======================================
+ Hits         5240     5243    +3     
  Misses        644      644           
Files with missing lines Coverage Δ
src/mantispy/_core/_reduce.py 97.56% <100.00%> (ø)
src/mantispy/_core/_stats.py 100.00% <100.00%> (ø)
src/mantispy/pl/_common.py 100.00% <100.00%> (ø)
src/mantispy/pl/_diagnostics.py 97.59% <100.00%> (+0.05%) ⬆️
src/mantispy/pl/_heterogeneity.py 96.47% <100.00%> (-0.09%) ⬇️
src/mantispy/pl/_moa.py 98.95% <100.00%> (-0.03%) ⬇️
src/mantispy/pl/_transport.py 96.66% <100.00%> (ø)
src/mantispy/pp/_qc.py 97.97% <100.00%> (-0.10%) ⬇️
src/mantispy/pp/_select.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Three plots repeated the same two lines after _table handed them a frame, with
only the trailing reason differing, so pl._common.table takes it as when_empty
and both halves of the contract live beside each other.
pp.filter_features and feature_select's variance_threshold state the same rule,
and _qc's comment says they must agree, so the wrapper belongs in _core._stats
rather than in both. np.errstate is not part of it: numpy delivers a floating
point invalid through warnings.warn as a RuntimeWarning, which the filter
already ignores.
…ogether

adata.shape is the shape. The two read-counting tests differed only in which
function they called, so they are one parametrized test, without the dtype and
shape assertions test_reduce already makes.
@timtreis
timtreis merged commit 81ec537 into main Sep 21, 2026
13 checks passed
@timtreis
timtreis deleted the fix/papercuts branch September 21, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants