Skip to content

Add Markov quality model test coverage and fix invalid test data#270

Merged
keshav-gandhi merged 1 commit into
developfrom
test/markov-coverage
May 1, 2026
Merged

Add Markov quality model test coverage and fix invalid test data#270
keshav-gandhi merged 1 commit into
developfrom
test/markov-coverage

Conversation

@joshfactorial
Copy link
Copy Markdown
Collaborator

test_qual_score_models.py:

  • Fix two tests that used -1 as a quality score key in position_distributions (invalid data that bypassed real validation); replace with valid scores
  • Add 11 new tests covering the previously untested Markov chain path: transition chain is exercised, fallback to marginal for unknown q_prev, wrong transition_distributions length raises, out-of-range score clamping, length=0/1 edge cases, read-length interpolation via _position_index_for_length

test_error_models.py:

  • Remove two stub tests that imported from error_models.MarkovQualityModel (a dead TODO class never called at runtime); they passed unconditionally and gave false confidence about the real model

test_markov_utils.py (new):

  • 36 tests covering all previously untested functions in markov_utils.py: _down_bin_quality (6), compute_initial_distribution (4), compute_position_distributions (4), compute_transition_distributions (5), read_quality_lists (6), build_markov_model (3)

test_qual_score_models.py:
- Fix two tests that used -1 as a quality score key in position_distributions
  (invalid data that bypassed real validation); replace with valid scores
- Add 11 new tests covering the previously untested Markov chain path:
  transition chain is exercised, fallback to marginal for unknown q_prev,
  wrong transition_distributions length raises, out-of-range score clamping,
  length=0/1 edge cases, read-length interpolation via _position_index_for_length

test_error_models.py:
- Remove two stub tests that imported from error_models.MarkovQualityModel
  (a dead TODO class never called at runtime); they passed unconditionally
  and gave false confidence about the real model

test_markov_utils.py (new):
- 36 tests covering all previously untested functions in markov_utils.py:
  _down_bin_quality (6), compute_initial_distribution (4),
  compute_position_distributions (4), compute_transition_distributions (5),
  read_quality_lists (6), build_markov_model (3)

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

Finished combing through the tests! The changes all make sense to me.

@keshav-gandhi keshav-gandhi merged commit f7beb1e into develop May 1, 2026
1 check passed
@joshfactorial joshfactorial deleted the test/markov-coverage branch May 3, 2026 13:16
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