Skip to content

test: add unit tests for Variant, ReferenceMapping, Haplotype, and _parse_pop_freqs#16

Open
ameynert wants to merge 1 commit intoam_14_test_haplotypefrom
am_15_test_remap_divref_models
Open

test: add unit tests for Variant, ReferenceMapping, Haplotype, and _parse_pop_freqs#16
ameynert wants to merge 1 commit intoam_14_test_haplotypefrom
am_15_test_remap_divref_models

Conversation

@ameynert
Copy link
Copy Markdown
Collaborator

Summary

Extends tests/tools/test_remap_divref.py with direct unit tests for methods and a private helper that were previously only exercised indirectly through Haplotype.reference_mapping():

  • Variant.render() — SNP, insertion, deletion
  • Haplotype.parsed_variants() — single variant, multiple variants, caching (second call returns the same list object with no re-parsing)
  • Haplotype.contig() — returns chromosome of first variant
  • ReferenceMapping.variants_involved_str() — empty list, single variant, multiple variants
  • _parse_pop_freqs() — all floats, mixed nulls converted to 0.0, single null

None of these require Hail; all are pure Python.

Test plan

  • uv run --directory divref poe check-all passes
  • All 13 new tests pass

🤖 Generated with Claude Code

…arse_pop_freqs

Extends test_remap_divref.py with direct tests for the model methods
and private helper that were previously only exercised indirectly via
reference_mapping():

- Variant.render(): SNP, insertion, deletion
- Haplotype.parsed_variants(): single variant, multiple variants,
  caching (second call returns same list object)
- Haplotype.contig(): returns chromosome of first variant
- ReferenceMapping.variants_involved_str(): empty, single, multiple
- _parse_pop_freqs(): all floats, mixed nulls, single null

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 13, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 152e63f6-d059-4e95-a05a-56aed642bac7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch am_15_test_remap_divref_models

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

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