Skip to content

Commit 1626bec

Browse files
RalfGCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 8157bdd commit 1626bec

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

im2deep/_architectures/callbacks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Architecture callbacks."""
22

3-
import pytorch_lightning as L
3+
import lightning as L
44

55
try:
66
import wandb # type: ignore[import]

im2deep/core.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from im2deep import _model_ops
1414
from im2deep.calibration import Calibration, LinearCCSCalibration
1515
from im2deep.constants import DEFAULT_MODEL, DEFAULT_MULTI_MODEL
16-
from im2deep.utils import validate_psm_list
16+
from im2deep._io_helpers import validate_psm_list
1717

1818
LOGGER = logging.getLogger(__name__)
1919

@@ -45,7 +45,7 @@ def predict(
4545
LOGGER.info("Predicting CCS values using IM2Deep.")
4646
psm_list = validate_psm_list(psm_list)
4747
return _model_ops.predict(
48-
model=model or DEFAULT_MODEL if not multi else DEFAULT_MULTI_MODEL,
48+
model=model or (DEFAULT_MODEL if not multi else DEFAULT_MULTI_MODEL),
4949
data=DeepLCDataset.from_psm_list(psm_list, add_ccs_features=True),
5050
multi=multi,
5151
**(predict_kwargs or {}),
@@ -99,6 +99,8 @@ def predict_and_calibrate(
9999

100100
# Assign the predicted CCS to the PSM metadata
101101
for idx, psm in enumerate(psm_list):
102+
if psm.metadata is None:
103+
psm.metadata = {}
102104
psm.metadata["predicted_CCS_uncalibrated"] = predicted_ccs[idx]
103105

104106
psm_df = psm_list.to_dataframe()

0 commit comments

Comments
 (0)