Skip to content

Conversation

@RalfG
Copy link
Member

@RalfG RalfG commented Jun 11, 2025

  • Adds full support for typing with MyPy
  • Removed support for Python 3.9
  • CI: Replaced file hash-based tests for idxml with proper unit tests.
  • CI: Add format checks.

@codecov
Copy link

codecov bot commented Aug 8, 2025

Codecov Report

❌ Patch coverage is 80.04751% with 252 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.18%. Comparing base (95e8218) to head (6c3df17).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
psm_utils/io/mzid.py 39.02% 50 Missing ⚠️
psm_utils/io/ionbot.py 14.28% 30 Missing ⚠️
psm_utils/io/idxml.py 82.09% 29 Missing ⚠️
psm_utils/io/percolator.py 44.68% 26 Missing ⚠️
psm_utils/io/peptide_record.py 66.66% 22 Missing ⚠️
psm_utils/psm_list.py 46.87% 17 Missing ⚠️
psm_utils/io/tsv.py 48.27% 15 Missing ⚠️
psm_utils/peptidoform.py 77.77% 14 Missing ⚠️
psm_utils/io/__init__.py 62.50% 9 Missing ⚠️
psm_utils/io/pepxml.py 55.00% 9 Missing ⚠️
... and 13 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #125      +/-   ##
==========================================
+ Coverage   69.12%   70.18%   +1.05%     
==========================================
  Files          30       30              
  Lines        2802     3052     +250     
==========================================
+ Hits         1937     2142     +205     
- Misses        865      910      +45     
Flag Coverage Δ
unittests 70.18% <80.04%> (+1.05%) ⬆️

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.

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

@RalfG RalfG marked this pull request as ready for review August 8, 2025 13:55
@RalfG RalfG requested a review from paretje August 8, 2025 13:56
@RalfG RalfG added enhancement Improvement of an existing feature Infrastructure Project structure and CI/CD labels Aug 8, 2025
@RalfG RalfG requested a review from Copilot October 24, 2025 11:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds comprehensive typing support with MyPy and removes Python 3.9 compatibility. Key changes include replacing Optional and Union with modern syntax (|), adding type hints throughout the codebase, and transitioning to SQLAlchemy 2.0 patterns.

Key changes:

  • Updated minimum Python version from 3.8/3.9 to 3.10
  • Added MyPy type checking to the development dependencies and CI
  • Replaced hash-based tests with proper unit tests for idXML functionality
  • Added proper type annotations and from __future__ import annotations throughout

Reviewed Changes

Copilot reviewed 35 out of 37 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/test_io/test_proteome_discoverer.py Added comprehensive unit and integration tests for MSFReader class
tests/test_io/test_peptide_record.py Refactored tests to use _analyze_peprec_file function instead of internal class
tests/test_io/test_idxml.py Replaced hash-based file verification with proper content validation tests
pyproject.toml Updated Python version requirement to 3.10+, added MyPy and type checking configuration
psm_utils/utils.py Added type hints and improved type safety with from __future__ import annotations
psm_utils/psm_list.py Enhanced type annotations with overloads for __getitem__ and improved typing throughout
psm_utils/psm.py Added field validators and improved type hints for PSM class
psm_utils/peptidoform.py Added comprehensive type hints and TypedDict for properties, improved type safety
psm_utils/io/xtandem.py Added type annotations and improved error handling
psm_utils/io/tsv.py Enhanced type hints and improved type safety for reader/writer classes
psm_utils/io/sage.py Added type annotations and improved method signatures
psm_utils/io/proteoscape.py Enhanced type hints and improved static method usage
psm_utils/io/proteome_discoverer.py Migrated to SQLAlchemy 2.0 patterns with comprehensive type hints and improved documentation
psm_utils/io/percolator.py Added type hints and improved error handling throughout
psm_utils/io/pepxml.py Enhanced type annotations and improved metadata handling
psm_utils/io/peptide_record.py Refactored to use Pydantic models and improved type safety
psm_utils/io/parquet.py Added type hints and improved error handling
psm_utils/io/mzid.py Enhanced type annotations and improved error handling with comprehensive typing
psm_utils/io/msamanda.py Added type hints and improved error handling
psm_utils/io/maxquant.py Enhanced type annotations and improved documentation
psm_utils/io/ionbot.py Added comprehensive error handling and type hints
psm_utils/io/idxml.py Major refactoring with proper type hints, improved error handling, and better code organization
psm_utils/io/fragpipe.py Added type hints and improved method signatures
psm_utils/io/flashlfq.py Enhanced type annotations and improved array type handling
psm_utils/io/diann.py Added type hints and improved static method usage
psm_utils/io/alphadia.py Enhanced type annotations and improved static method usage
psm_utils/io/_utils.py Added type hints and improved documentation
psm_utils/io/_pd_msf_tables.py Migrated to SQLAlchemy 2.0 ORM patterns with comprehensive type hints
psm_utils/io/_base_classes.py Enhanced type hints and improved abstract base classes
psm_utils/io/init.py Added comprehensive type annotations, TypedDict definitions, and improved documentation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@RalfG RalfG merged commit ddc495d into main Oct 24, 2025
7 checks passed
@RalfG RalfG deleted the typing branch October 24, 2025 12:26
@RalfG RalfG added this to the v1.5 milestone Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement of an existing feature Infrastructure Project structure and CI/CD

Development

Successfully merging this pull request may close these issues.

2 participants