Skip to content

test(rf3): clear easy-tier mypy modules and add first unit tests#301

Open
lyskov-ai wants to merge 3 commits into
RosettaCommons:productionfrom
lyskov-ai:0015-rf3-mypy-easy-and-units
Open

test(rf3): clear easy-tier mypy modules and add first unit tests#301
lyskov-ai wants to merge 3 commits into
RosettaCommons:productionfrom
lyskov-ai:0015-rf3-mypy-easy-and-units

Conversation

@lyskov-ai
Copy link
Copy Markdown
Contributor

Two rf3 changes:

  • Type-checking: fix the three rf3 modules that each had a single mypy error (data/extra_xforms.py, callbacks/metrics_logging.py, utils/predict_and_score.py) and remove them from the per-module ignore list, so they are now type-checked. Annotation / type-honesty only — no behavior change.
  • Tests: add the first CPU unit tests for rf3 in a new tests/rf3/ directory — 15 tests pinning utils/frames.py (rigid_from_3_points, is_atom) and metrics/metric_utils.py (bin midpoints, logit unbinning, chain/interface masks, subsampled mean/min). Small inline fixtures — no data files, GPU, or checkpoints.

lyskov and others added 3 commits June 3, 2026 22:03
Fixture-backed CPU unit tests for the pure symmetry geometry in
rfd3.inference.symmetry: cyclic/dihedral frame generation, the
framecoord <-> (R, t) round-trip, pack/unpack, Kabsch _align/_rms
recovery, symmetry-id parsing, and contig-string expansion.

New tests/rfd3/ dir, auto-collected by testpaths and kept separate
from the cluster-only models/rfd3/tests/. No source or config changes.

Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
Add models/rf3/src/rf3 to [tool.mypy].files and seed a fresh per-module
ignore_errors ratchet listing the 26 rf3 modules with pre-existing errors
(158 total), mirroring the rfd3 bootstrap. mypy now type-checks the 28
already-clean rf3 modules; the 26 are cleared slice-by-slice in follow-ups.

Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
mypy: fix the 3 one-error rf3 modules (extra_xforms setattr,
metrics_logging set[str], predict_and_score assert-narrow on run()'s
dict|None return) and drop them from the ignore_errors ratchet (26 -> 23).
Annotation/type-honesty only, no behavior change.

tests: add tests/rf3/ first pass — 15 fixture-backed CPU unit tests
pinning utils/frames.py (rigid_from_3_points proper-rotation/origin/batch
/NA-branch, is_atom) and metrics/metric_utils.py (bin midpoints, unbin
expectation, chain/interface masks, subsampled mean/min).

Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
@lyskov-ai lyskov-ai requested a review from woodsh17 June 3, 2026 22:06
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.

2 participants