Skip to content

Conversation

@rodvrees
Copy link
Member

@rodvrees rodvrees commented Jan 8, 2026

No description provided.

@rodvrees rodvrees added this to the v2.0 milestone Jan 8, 2026
@rodvrees rodvrees marked this pull request as ready for review January 19, 2026 13:36
@rodvrees rodvrees requested a review from Copilot January 19, 2026 13:36
@rodvrees rodvrees requested a review from RalfG January 19, 2026 13:36
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 PR introduces IM2Deep 2.0 API, a major refactoring from version 1.2.0 to 2.0.0-beta. The changes modernize the codebase with comprehensive test coverage, refactored architecture using PyTorch Lightning, and an improved API design with better separation of concerns.

Changes:

  • Complete API refactoring with new modular structure (core, calibration, model_ops, constants)
  • Added comprehensive test suite with 9 test modules covering ~90% of functionality
  • Replaced DeepLC-based models with native PyTorch Lightning implementations
  • Updated dependencies: removed version constraint on deeplc, added torch and lightning as core dependencies
  • Enhanced CLI with better argument handling and profiling support

Reviewed changes

Copilot reviewed 27 out of 36 changed files in this pull request and generated 29 comments.

Show a summary per file
File Description
tests/* New comprehensive test suite with fixtures, unit tests, and integration tests
pytest.ini Pytest configuration with markers for integration and slow tests
pyproject.toml Updated dependencies: removed deeplc constraint and er extras, added torch/lightning
im2deep/utils.py Major expansion with input parsing, validation, CCS conversion, and CLI utilities
im2deep/_model_ops.py New file for PyTorch model loading and prediction operations
im2deep/core.py New high-level API with predict() and predict_and_calibrate() functions
im2deep/constants.py New file centralizing model paths, configurations, and physical constants
im2deep/calibration.py Refactored calibration with abstract base class and LinearCCSCalibration implementation
im2deep/_architecture.py New file with PyTorch Lightning model architectures (IM2Deep, IM2DeepMulti, IM2DeepMultiTransfer)
im2deep/_exceptions.py Minor formatting improvements to exception classes
im2deep/main.py Major CLI refactor with DefaultCommandGroup, improved argument handling, and profiling
im2deep/init.py Updated to version 2.0.0-beta with new API exports
README.md Comprehensive documentation update with CLI examples and API usage
.github/workflows/test.yml New CI/CD workflow for automated testing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

from im2deep.constants import DEFAULT_MODEL

if DEFAULT_MODEL is not None:
model_path = Path(DEFAULT_MODEL)
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

Variable model_path is not used.

Copilot uses AI. Check for mistakes.
from im2deep.constants import DEFAULT_MULTI_MODEL

if DEFAULT_MULTI_MODEL is not None:
model_path = Path(DEFAULT_MULTI_MODEL)
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

Variable model_path is not used.

Copilot uses AI. Check for mistakes.
from im2deep.constants import DEFAULT_REFERENCE_DATASET_PATH

if DEFAULT_REFERENCE_DATASET_PATH is not None:
dataset_path = Path(DEFAULT_REFERENCE_DATASET_PATH)
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

Variable dataset_path is not used.

Copilot uses AI. Check for mistakes.
from im2deep.constants import DEFAULT_MULTI_REFERENCE_DATASET_PATH

if DEFAULT_MULTI_REFERENCE_DATASET_PATH is not None:
dataset_path = Path(DEFAULT_MULTI_REFERENCE_DATASET_PATH)
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

Variable dataset_path is not used.

Copilot uses AI. Check for mistakes.
from im2deep import constants

# Store original values
original_model = constants.DEFAULT_MODEL
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

Variable original_model is not used.

Copilot uses AI. Check for mistakes.
import pandas as pd
import numpy as np
from pathlib import Path
from psm_utils import PSM, PSMList, Peptidoform
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

Import of 'PSM' is not used.
Import of 'Peptidoform' is not used.

Copilot uses AI. Check for mistakes.

from __future__ import annotations

import sys
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

Import of 'sys' is not used.

Suggested change
import sys

Copilot uses AI. Check for mistakes.
from typing import Any
import logging
from rich.text import Text
import gzip
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

Import of 'gzip' is not used.

Suggested change
import gzip

Copilot uses AI. Check for mistakes.
with pytest.raises(IM2DeepError):
raise CalibrationError("calibration failed")

with pytest.raises(CalibrationError, match="calibration failed"):
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

This statement is unreachable.

Copilot uses AI. Check for mistakes.
except ValueError as e:
raise CalibrationError("wrapped error") from e

assert exc_info.value.__cause__ is original_error
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

This statement is unreachable.

Copilot uses AI. Check for mistakes.
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.

2 participants