From 95c5673910e6edc1afd051d18e8cae90aa096a05 Mon Sep 17 00:00:00 2001 From: d33bs Date: Fri, 18 Oct 2024 14:52:01 -0600 Subject: [PATCH 1/3] refactor(collate): deprecationwarning for collate --- pycytominer/cyto_utils/collate.py | 11 +++++++++++ pyproject.toml | 3 +++ 2 files changed, 14 insertions(+) diff --git a/pycytominer/cyto_utils/collate.py b/pycytominer/cyto_utils/collate.py index 4d51b249..4bdb6adb 100644 --- a/pycytominer/cyto_utils/collate.py +++ b/pycytominer/cyto_utils/collate.py @@ -3,6 +3,7 @@ import subprocess import sys import sqlite3 +import warnings def run_check_errors(cmd): @@ -81,6 +82,16 @@ def collate( """ ) + # show a warning about collate deprecation + warnings.warn( + ( + "pycytominer.cyto_utils.collate is deprecated and will be removed in future versions of Pycytominer. " + "Please consider using CellProfiler's ExportToDatabase module to create single-cell " + "profile SQLite files or CytoTable to create similar Parquet file output." + ), + DeprecationWarning, + ) + # Set up directories (these need to be abspaths to keep from confusing makedirs later) input_dir = pathlib.Path(f"{base_directory}/analysis/{batch}/{plate}/{csv_dir}") backend_dir = pathlib.Path(f"{base_directory}/backend/{batch}/{plate}") diff --git a/pyproject.toml b/pyproject.toml index 327378f6..ae05d1d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -175,6 +175,9 @@ lint.per-file-ignores."tests/*" = [ "S101" ] [tool.pytest.ini_options] testpaths = "tests" +filterwarnings = [ + "ignore::DeprecationWarning:pycytominer.*", +] [tool.mypy] exclude = [ From 2c4ffd90ce4b0a6a519a3d54e60d2bb27d22495c Mon Sep 17 00:00:00 2001 From: Dave Bunten Date: Wed, 6 Nov 2024 13:47:58 -0700 Subject: [PATCH 2/3] Update pycytominer/cyto_utils/collate.py Co-authored-by: Gregory Way --- pycytominer/cyto_utils/collate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pycytominer/cyto_utils/collate.py b/pycytominer/cyto_utils/collate.py index 4bdb6adb..61a6cdbe 100644 --- a/pycytominer/cyto_utils/collate.py +++ b/pycytominer/cyto_utils/collate.py @@ -85,9 +85,9 @@ def collate( # show a warning about collate deprecation warnings.warn( ( - "pycytominer.cyto_utils.collate is deprecated and will be removed in future versions of Pycytominer. " + With the deprecation of cytominer-database, "pycytominer.cyto_utils.collate will be removed in future versions of Pycytominer. " "Please consider using CellProfiler's ExportToDatabase module to create single-cell " - "profile SQLite files or CytoTable to create similar Parquet file output." + "SQLite files or CytoTable to create single-cell Parquet files." ), DeprecationWarning, ) From 3cb971c25044a8bc66eb6b1a570f3fac8a200a3d Mon Sep 17 00:00:00 2001 From: d33bs Date: Wed, 6 Nov 2024 13:52:53 -0700 Subject: [PATCH 3/3] linting --- pycytominer/cyto_utils/collate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pycytominer/cyto_utils/collate.py b/pycytominer/cyto_utils/collate.py index 61a6cdbe..6dcc282f 100644 --- a/pycytominer/cyto_utils/collate.py +++ b/pycytominer/cyto_utils/collate.py @@ -85,9 +85,10 @@ def collate( # show a warning about collate deprecation warnings.warn( ( - With the deprecation of cytominer-database, "pycytominer.cyto_utils.collate will be removed in future versions of Pycytominer. " + "With the deprecation of cytominer-database", + "pycytominer.cyto_utils.collate will be removed in future versions of Pycytominer. " "Please consider using CellProfiler's ExportToDatabase module to create single-cell " - "SQLite files or CytoTable to create single-cell Parquet files." + "SQLite files or CytoTable to create single-cell Parquet files.", ), DeprecationWarning, )