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

Improve ScoringFile read methods #59

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Improve ScoringFile read methods #59

wants to merge 5 commits into from

Conversation

nebfield
Copy link
Member

@nebfield nebfield commented Dec 6, 2024

Currently the only method of reading rows from a ScoringFile is by iterating over a generator of ScoreVariants by using the variants property.

This isn't particularly helpful for some applications, like validating scoring files, because the generator stops when the first exception in a scoring file is raised.

  • Add a context managed read() method which returns a csv.DictReader ready for iteration (ino data validation done)
  • Add a read_variants() method which calls read() and yields ScoreVariants from the dictionaries (data is validated)
  • The variants property now just returns the generator from read_variants()
  • Clean up simplfified read functions

Copy link

codecov bot commented Dec 9, 2024

Codecov Report

Attention: Patch coverage is 96.29630% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.66%. Comparing base (f570666) to head (f23e044).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...catalog.core/src/pgscatalog/core/lib/scorefiles.py 96.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #59      +/-   ##
==========================================
+ Coverage   89.61%   89.66%   +0.04%     
==========================================
  Files          54       53       -1     
  Lines        3467     3425      -42     
==========================================
- Hits         3107     3071      -36     
+ Misses        360      354       -6     
Flag Coverage Δ
pgscatalog.core 92.78% <96.29%> (+0.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

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