Skip to content

chore(release): 8.2.1 — unify sig() coercion rigor, document coercion, expand tests - #77

Open
SkyeAv wants to merge 4 commits into
mainfrom
release/8.2.1
Open

chore(release): 8.2.1 — unify sig() coercion rigor, document coercion, expand tests#77
SkyeAv wants to merge 4 commits into
mainfrom
release/8.2.1

Conversation

@SkyeAv

@SkyeAv SkyeAv commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Release 8.2.1. Unifies the statistical_significance_qualifier derivation onto the same fuzzy-matching rigor the four coerce_* steps already use, documents the (previously undocumented) automatic column-coercion behavior, and expands the test suite — including an end-to-end smoke proving the whole coercion pipeline produces the expected canonical Biolink edge fields. Folds the unreleased source.url list breaking change and the build-fullmap --aria2c opt-in into the 8.2.1 notes.

Coercion rigor

  • sig() was the outlier. It picked its p-value column with a naive substring selector ([c for c in names if col in c] + fuzz.ratio(c, "p_value")), while coerce_pvalue_columns / coerce_study_size_columns / coerce_effect_size_columns / coerce_effect_type_columns all share a rigorous pattern: a *_target() regex classifier, a canonical-name-wins guard, and fuzz.ratio against target.replace("_", " ").
  • Now unified. sig() reuses pvalue_target() for candidate classification, prefers a raw p_value column over adjusted_p_value, and applies the same canonical-wins + spaced-reference fuzzy rule. The five-band cascade and the Biolink class rule (qualifier omitted when no p-value column is present) are unchanged.

Design

  • Realistic builds are unaffected. In the pipeline (lib.py _source_ops), coerce_pvalue_columns runs before sig, so by the time sig runs every p-value column is already canonical p_value/adjusted_p_value; old and new selectors pick the same column. The lone divergence is a contrived column that contains a p_value substring but is rejected by pvalue_target (e.g. xp_value), which now correctly omits the qualifier instead of deriving a bogus one.
  • No build-fullmap run needed to verify. The e2e smoke builds a tiny real redb (rs.build_fullmap_db) and drives the full build_pipeline, matching the existing offline smoke pattern.

Docs

  • docs/configuration/table.md: new "Automatic column coercion" subsection documenting that p-value / study-size / effect-size / effect-type columns are auto-normalized to canonical Biolink names (with effect_type values mapped to the EffectTypes enum, unmatched → null, and the legacy relationship_strength renamed forward to effect_size), that statistical_significance_qualifier is auto-derived into five bands, and the Biolink class rules (null effect_type where effect_size is absent; qualifier omitted without a p-value column).

Tests

  • tests/test_lib.py: three sig() rigor tests — raw-p_value-over-adjusted_p_value preference, canonical-column-wins-over-alias, and pvalue_target-based exclusion of a p_value-substring look-alike.
  • tests/test_e2e_smoke.py: test_build_pipeline_coerces_statistical_annotations — declares annotations with raw source spellings (p value, sample size, odds ratio, effect type) and asserts the real pipeline emits canonical p_value (JSON number), effect_size (controlled notation), effect_type (alias → enum), and routes supporting_study_size + the auto-derived statistical_significance_qualifier into the inlined Study.

Release

Testing

  • uv run pytest761 passed, 34 skipped (87% total; src/tablassert/coerce.py at 100%).
  • uv run ruff check src testsAll checks passed!; uv run ruff format --check src tests → all formatted.
  • uv run pyright src/tablassert/coerce.py tests/test_lib.py tests/test_e2e_smoke.py0 errors.
  • uv run pytest tests/test_e2e_smoke.py::test_build_pipeline_coerces_statistical_annotations → passed (real redb, end-to-end).
  • A CODE_REVIEWER pass (fresh-eyes on the diff) returned approve with two release-polish should-fixes, both applied (softened the "unaffected" changelog claim; pinned p_value/effect_size JSON types in the e2e assertion).

SkyeAv added 4 commits August 10, 2026 21:04
…he column coercions

sig() derived statistical_significance_qualifier from a p-value column chosen by a
naive substring selector ([c for c in names if col in c] + fuzz.ratio). The four
coerce_* steps already share a rigorous pattern: a *_target() regex classifier, a
canonical-name-wins guard, and fuzz.ratio against target.replace('_',' '). sig() now
reuses pvalue_target() for the same classification, prefers a raw p_value column over
adjusted_p_value, and applies canonical-wins. Five-band cascade and Biolink class rule
(qualifier omitted without a p-value column) are unchanged.

Coerce_pvalue_columns runs before sig in the pipeline, so realistic builds are
unaffected; only a contrived p_value-substring column that pvalue_target rejects now
correctly omits the qualifier. Adds three rigor tests.
Extends the real-redb build_pipeline smoke to prove the whole coercion pipeline wires
through end-to-end: raw annotation names (p value, sample size, odds ratio, effect type)
normalize to canonical Biolink edge fields (p_value as a JSON number, effect_size in
controlled notation, effect_type with the alias mapped to the EffectTypes enum), while
supporting_study_size and the auto-derived statistical_significance_qualifier route
into the inlined Study. Builds a tiny redb, not a real build-fullmap.
The p_value / supporting_study_size / effect_size / effect_type auto-normalization,
effect_type value-to-enum mapping, relationship_strength forward-rename, the
auto-derived statistical_significance_qualifier bands, and the Biolink class rules were
previously undocumented behavior. Adds an 'Automatic column coercion' subsection to the
table configuration reference.
Bumps version 8.2.0 -> 8.2.1 (pyproject.toml, uv.lock self-package, CITATION.cff) and
folds the unreleased section into 8.2.1: the multi-section source.url list breaking
change, the build-fullmap --aria2c opt-in, the sig() rigor unification, the coercion
docs, and the new tests.
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@SkyeAv, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 4 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 73bbaf7b-e641-4853-9f77-2e0552039d30

📥 Commits

Reviewing files that changed from the base of the PR and between b137fb4 and f6afa66.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • CHANGELOG.md
  • CITATION.cff
  • docs/configuration/table.md
  • pyproject.toml
  • src/tablassert/coerce.py
  • tests/test_e2e_smoke.py
  • tests/test_lib.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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