From 1b3d0b91055b23063cc5682ac6e6f36b06b659fd Mon Sep 17 00:00:00 2001 From: Martin Kim <46072231+martinkim0@users.noreply.github.com> Date: Mon, 8 Apr 2024 10:32:37 -0700 Subject: [PATCH] chore(external): add note and warning for solo predict breaking change (#2697) amends #2689 to add a note in the changelog as well as a warning noting that it is a breaking change. --- CHANGELOG.md | 4 ++-- scvi/external/solo/_model.py | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b18fcba44d..9790fd4e6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,8 +60,8 @@ is available in the [commit logs](https://github.com/scverse/scvi-tools/commits/ #### Fixed -- Fix {meth}`scvi.external.SOLO.predict` to correctly return probabiities instead of logits - when passing in `soft=True` {pr}`2689`. +- Breaking change: Fix {meth}`scvi.external.SOLO.predict` to correctly return probabiities + instead of logits when passing in `soft=True` (the default option) {pr}`2689`. ### 1.1.2 (2024-03-01) diff --git a/scvi/external/solo/_model.py b/scvi/external/solo/_model.py index e876fe5abb..99e1b8ffc8 100644 --- a/scvi/external/solo/_model.py +++ b/scvi/external/solo/_model.py @@ -400,6 +400,14 @@ def predict(self, soft: bool = True, include_simulated_doublets: bool = False) - ------- DataFrame with prediction, index corresponding to cell barcode. """ + warnings.warn( + "Prior to scvi-tools 1.1.3, `SOLO.predict` with `soft=True` (the default option) " + "returned logits instead of probabilities. This behavior has since been corrected to " + "return probabiltiies.", + UserWarning, + stacklevel=settings.warnings_stacklevel, + ) + adata = self._validate_anndata(None) scdl = self._make_data_loader(adata=adata)