Skip to content

Improve handling of versions - #22

Merged
cthoyt merged 18 commits into
mainfrom
integer-versions
Aug 23, 2025
Merged

Improve handling of versions#22
cthoyt merged 18 commits into
mainfrom
integer-versions

Conversation

@cthoyt

@cthoyt cthoyt commented Aug 22, 2025

Copy link
Copy Markdown
Owner

This was motivated by #21, where it was annoying to do str(version) when looping through versions. Now, functions in chembl-downloader will also accept integer versions.

This also makes some more careful testing of the way that versions are normalized, especially for versions before v10 and the two instances of versions that have a minor (i.e., v22.1 and v24.1)

This allows:

import chembl_downloader

for version in range(30, 36):
    count = chembl_downloader.query_scalar(
        'SELECT COUNT(activity_id) FROM activities', 
        version=version,
    )

cthoyt added 2 commits August 22, 2025 14:15
This makes it much easier to work in a loop
@codecov

codecov Bot commented Aug 23, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.30435% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.30%. Comparing base (80c7afc) to head (cdebcde).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/chembl_downloader/api.py 91.30% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #22      +/-   ##
==========================================
+ Coverage   41.21%   48.30%   +7.09%     
==========================================
  Files           4        4              
  Lines         330      354      +24     
  Branches       55       56       +1     
==========================================
+ Hits          136      171      +35     
+ Misses        164      157       -7     
+ Partials       30       26       -4     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cthoyt
cthoyt enabled auto-merge (squash) August 23, 2025 08:04
@cthoyt
cthoyt disabled auto-merge August 23, 2025 08:08
@cthoyt
cthoyt enabled auto-merge (squash) August 23, 2025 08:31
@cthoyt
cthoyt merged commit f6aa725 into main Aug 23, 2025
11 checks passed
@cthoyt
cthoyt deleted the integer-versions branch August 23, 2025 08:39
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