Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type errors in titer models #1688

Merged
merged 4 commits into from
Dec 23, 2024

Conversation

huddlej
Copy link
Contributor

@huddlej huddlej commented Nov 21, 2024

Description of proposed changes

Adds unit tests to catch type errors in titer model code and adds fixes for that code. The affected code is only accessible through the developer's Python API but these type errors prevented me from running cross-validation of titer models with that API.

Related issue(s)

Checklist

  • Automated checks pass
  • Check if you need to add a changelog message
  • Check if you need to add tests
  • Check if you need to update docs

@huddlej huddlej marked this pull request as draft November 21, 2024 19:48
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.79%. Comparing base (293ceee) to head (6340cf0).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1688      +/-   ##
==========================================
+ Coverage   72.31%   72.79%   +0.48%     
==========================================
  Files          79       79              
  Lines        8271     8271              
  Branches     1691     1691              
==========================================
+ Hits         5981     6021      +40     
+ Misses       2005     1961      -44     
- Partials      285      289       +4     

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

@huddlej huddlej marked this pull request as ready for review December 20, 2024 23:56
@huddlej huddlej force-pushed the fix-type-error-in-titer-cross-validation branch from fefdec7 to 98b761d Compare December 23, 2024 19:56
Adds unit tests for validation of both tree and substitution titer
models including public test data from Bedford et al. 2014 (titers and
sequences). These tests cover code that is only accessible through the
Python API and which previously had type errors caused by changes in
core Python since the code was last run (probably circa late 2016).

Several doctest updates in this commit reflect the change of test titer
data.
Fixes type errors in titer model code that is only accessible through
the developer's Python API but which prevented me from running
cross-validation of titer models with that API. It looks like these were
the only references to the dictionary methods of keys and values that
didn't get updated in the past.
Fixes a type error "Population must be a sequence.  For dicts or sets,
use sorted(d)."
@huddlej huddlej force-pushed the fix-type-error-in-titer-cross-validation branch from 98b761d to 6340cf0 Compare December 23, 2024 20:29
@huddlej huddlej changed the title Fix type error in titer model cross-validation Fix type errors in titer models Dec 23, 2024
@huddlej huddlej merged commit 77ae31e into master Dec 23, 2024
36 checks passed
@huddlej huddlej deleted the fix-type-error-in-titer-cross-validation branch December 23, 2024 21:01
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