Skip to content

Commit

Permalink
use enumerate instead of incrementing an integer
Browse files Browse the repository at this point in the history
  • Loading branch information
nebfield committed Dec 6, 2024
1 parent 5678442 commit 4e6153f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pgscatalog.core/src/pgscatalog/core/lib/scorefiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,11 @@ def read_variants(self) -> Generator[ScoreVariant, None, None]:
ScoreVariant(rsID='rs6061231', chr_name='20', ...
ScoreVariant(rsID='rs10774214', chr_name='12', ...
"""
row_nr = 0
with self.read() as reader:
for variant in reader:
for row_nr, variant in enumerate(reader):
yield ScoreVariant(
**variant, **{"accession": self.pgs_id, "row_nr": row_nr}
) # type: ignore
row_nr += 1
)


class ScoringFiles:
Expand Down

0 comments on commit 4e6153f

Please sign in to comment.