Skip to content

Commit

Permalink
refactor(collate): deprecationwarning for collate (#462)
Browse files Browse the repository at this point in the history
* refactor(collate): deprecationwarning for collate

* Update pycytominer/cyto_utils/collate.py

Co-authored-by: Gregory Way <[email protected]>

* linting

---------

Co-authored-by: Gregory Way <[email protected]>
  • Loading branch information
d33bs and gwaybio authored Nov 6, 2024
1 parent cd13690 commit 04607e6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pycytominer/cyto_utils/collate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import subprocess
import sys
import sqlite3
import warnings


def run_check_errors(cmd):
Expand Down Expand Up @@ -81,6 +82,17 @@ 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. "
"Please consider using CellProfiler's ExportToDatabase module to create single-cell "
"SQLite files or CytoTable to create single-cell Parquet files.",
),
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}")
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ lint.per-file-ignores."tests/*" = [ "S101" ]

[tool.pytest.ini_options]
testpaths = "tests"
filterwarnings = [
"ignore::DeprecationWarning:pycytominer.*",
]

[tool.mypy]
exclude = [
Expand Down

0 comments on commit 04607e6

Please sign in to comment.