From 16e5d817829beee794b134178f64b9954e7570b1 Mon Sep 17 00:00:00 2001 From: RalfG Date: Wed, 2 Apr 2025 10:17:08 +0200 Subject: [PATCH] Avoid incompatibility between CUDA_VISIBLE_DEVICES env variable and XGBoost (see dmlc/xgboost#11283) --- ms2rescore/__init__.py | 12 ++++++++---- ms2rescore/feature_generators/ms2pip.py | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ms2rescore/__init__.py b/ms2rescore/__init__.py index 6c0f6a2..a552949 100644 --- a/ms2rescore/__init__.py +++ b/ms2rescore/__init__.py @@ -1,6 +1,10 @@ -"""MS²Rescore: Sensitive PSM rescoring with predicted MS² peak intensities and RTs.""" +"""Modular and user-friendly platform for AI-assisted rescoring of peptide identifications .""" -__version__ = "3.2.0.dev1" +__version__ = "3.2.0.dev2" +__all__ = [ + "parse_configurations", + "rescore", +] from warnings import filterwarnings @@ -12,5 +16,5 @@ module="psims.mzmlb", ) -from ms2rescore.config_parser import parse_configurations # noqa: F401 E402 -from ms2rescore.core import rescore # noqa: F401 E402 +from ms2rescore.config_parser import parse_configurations # noqa: E402 +from ms2rescore.core import rescore # noqa: E402 diff --git a/ms2rescore/feature_generators/ms2pip.py b/ms2rescore/feature_generators/ms2pip.py index fefad5e..c830a79 100644 --- a/ms2rescore/feature_generators/ms2pip.py +++ b/ms2rescore/feature_generators/ms2pip.py @@ -25,6 +25,7 @@ import logging import multiprocessing +import os import warnings from itertools import chain from typing import List, Optional, Union @@ -194,6 +195,7 @@ def add_features(self, psm_list: PSMList) -> None: spectrum_filename = infer_spectrum_path(self.spectrum_path, run) logger.debug(f"Using spectrum file `{spectrum_filename}`") try: + os.environ.pop("CUDA_VISIBLE_DEVICES", None) ms2pip_results = correlate( psms=psm_list_run, spectrum_file=str(spectrum_filename),