From 6b95ddf68226658bdc0c07f3f89de8e8b6669c6b Mon Sep 17 00:00:00 2001 From: Can Ergen Date: Mon, 19 Jun 2023 03:52:51 -0700 Subject: [PATCH] Fixes to PopV. --- popv/algorithms/_onclass.py | 6 +++++- pyproject.toml | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/popv/algorithms/_onclass.py b/popv/algorithms/_onclass.py index db44f02..490b22a 100644 --- a/popv/algorithms/_onclass.py +++ b/popv/algorithms/_onclass.py @@ -86,11 +86,15 @@ def make_cell_ontology_id(self, adata, celltype_dict, ontology_key): Default will be _cell_ontology_id """ ontology_id = [] + single_warning = [] # print a single warning per missing cell-type for label in adata.obs[self.labels_key]: if label != adata.uns["unknown_celltype_label"]: if label not in celltype_dict: - logging.warning("Following label not in celltype_dict ", label) + if label not in single_warning: + logging.warning("Following label not in celltype_dict ", label) + single_warning.append(label) + ontology_id.append("unknown") ontology_id.append(celltype_dict[label]) else: ontology_id.append("unknown") diff --git a/pyproject.toml b/pyproject.toml index 36ac902..e1a684c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ description = "Automatic annotation of single cell data using a labelled referen packages = [ {include = "popv"}, ] -version = "0.3.1" +version = "0.3.2" readme = "README.md" [tool.poetry.dependencies] @@ -48,7 +48,7 @@ nbformat = {version = ">=4.4.0", optional = true} nbsphinx = {version = "*", optional = true} nbsphinx-link = {version = "*", optional = true} onclass = "^1.2" -pandas = ">=1.4" +pandas = ">=1.4,<2.0" pre-commit = {version = ">=2.7.1", optional = true} pytest = {version = ">=4.4", optional = true} rich = ">=9.1.0"