Skip to content

Port IsEquivalentTo to VerseRef - #425

Open
pmachapman wants to merge 1 commit into
mainfrom
port-is-equivalent-to-verseref
Open

pmachapman wants to merge 1 commit into
mainfrom
port-is-equivalent-to-verseref

Conversation

@pmachapman

@pmachapman pmachapman commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #395

Port of sillsdev/machine#525


This change is Reviewable

@pmachapman
pmachapman requested a review from Enkidu93 November 25, 2026 21:03
@codecov-commenter

codecov-commenter commented Nov 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.96970% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.65%. Comparing base (e063f28) to head (a3043ff).

Files with missing lines Patch % Lines
machine/scripture/verse_ref.py 92.30% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #425   +/-   ##
=======================================
  Coverage   92.64%   92.65%           
=======================================
  Files         424      424           
  Lines       27014    27046   +32     
=======================================
+ Hits        25028    25059   +31     
- Misses       1986     1987    +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread machine/scripture/verse_ref.py Resolved
Comment thread machine/scripture/verse_ref.py Resolved
@claude

This comment has been minimized.

@pmachapman
pmachapman force-pushed the port-is-equivalent-to-verseref branch from d921c5b to a3043ff Compare November 25, 2026 21:55
@claude

claude Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Verdict: approve. Versification.is_equivalent_to now matches the C# IsEquivalentTo from sillsdev/machine#525. That covers the length-mismatch sentinel (via zip_longest) and the unconverted verse-label check.

Most important: F3 at machine/corpora/paratext_project_text_updater_base.py:70 is still open. No test covers the update_usfm branch that now skips conversion when the versifications are equivalent but not equal. It is Low and does not block merging.

Counts: Critical 0, Important 0 open (F1 and F2 addressed), Low 1 (F3).

Ran: at a3043ff, with .venv/bin/python -c: the F1 repro (English vs English + LAO 1:21) returns False both ways, and the F2 repro (MAT 1:25 moved to MAT 2:1) returns False. Ran /code-review high 425. Two candidates were upstream defects, the perf note also matches C#, one candidate was pre-existing, and one duplicated F3; I posted none of them. CI (gh pr checks 425): 3 builds and both comment-hygiene checks pass; 13 builds and claude-review are pending.

Not verified: I did not run the C# tests. The C# parity comes from reading the #525 diff. CI is still pending on most platforms.

Surface changed: new public method Versification.is_equivalent_to (machine.scripture), and ParatextProjectTextUpdaterBase.update_usfm now skips conversion for equivalent versifications. Both now match sillsdev/machine#525.

Upstream in sillsdev/machine, not this PR: ScrVersExtensions.IsEquivalentTo reports versifications as equivalent when they differ only in * verse segments (English + *MAT 1:1,a,b vs English gives True). It also reports them as equivalent when they differ only in the standard-to-versification direction (MAT 1:2 = MAT 1:1 + MAT 1:3 = MAT 1:1 in either order gives True). In both cases UpdateUsfm can skip a needed conversion. The Python port returns True for both cases too.

Findings: F1 addressed, F2 addressed, F3 open.

Reviewed at a3043ff

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.

Port 'Add IsEquivalentTo versification extension method'

2 participants