Skip to content

Commit

Permalink
Bump requests from 2.28.2 to 2.31.0 (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored Nov 13, 2023
1 parent 35c348c commit f5e45af
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 53 deletions.
10 changes: 5 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 1 addition & 48 deletions tests/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
)
from cytotable.exceptions import CytoTableException
from cytotable.presets import config
from cytotable.sources import _get_source_filepaths, _infer_source_datatype
from cytotable.sources import _infer_source_datatype
from cytotable.utils import (
_column_sort,
_duckdb_reader,
Expand Down Expand Up @@ -137,53 +137,6 @@ def test_extend_path(fx_tempdir: str):
assert _expand_path(path=f"{subdir}/..") == pathlib.Path(fx_tempdir).resolve()


def test_get_source_filepaths(
load_parsl_default: None, fx_tempdir: str, data_dir_cellprofiler: str
):
"""
Tests _get_source_filepaths
"""

# test that no sources raises an exception
empty_dir = pathlib.Path(f"{fx_tempdir}/temp")
empty_dir.mkdir(parents=True, exist_ok=True)
with pytest.raises(Exception):
single_dir_result = _get_source_filepaths(
path=empty_dir,
targets=["image", "cells", "nuclei", "cytoplasm"],
).result()

# check that single sqlite file is returned as desired
single_file_result = _get_source_filepaths(
path=pathlib.Path(
f"{data_dir_cellprofiler}/NF1_SchwannCell_data/all_cellprofiler.sqlite"
),
targets=["cells"],
).result()
assert len(set(single_file_result.keys())) == 1

# check that single csv file is returned as desired
single_file_result = _get_source_filepaths(
path=pathlib.Path(f"{data_dir_cellprofiler}/ExampleHuman/Cells.csv"),
targets=["cells"],
).result()
assert len(set(single_file_result.keys())) == 1

single_dir_result = _get_source_filepaths(
path=pathlib.Path(f"{data_dir_cellprofiler}/ExampleHuman"),
targets=["cells"],
).result()
# test that the single dir structure includes 1 unique key (for cells)
assert len(set(single_dir_result.keys())) == 1

single_dir_result = _get_source_filepaths(
path=pathlib.Path(f"{data_dir_cellprofiler}/ExampleHuman"),
targets=["image", "cells", "nuclei", "cytoplasm"],
).result()
# test that the single dir structure includes 4 unique keys
assert len(set(single_dir_result.keys())) == 4


def test_prepend_column_name(load_parsl_default: None, fx_tempdir: str):
"""
Tests _prepend_column_name
Expand Down
49 changes: 49 additions & 0 deletions tests/test_convert_threaded.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@

import parsl
import pyarrow as pa
import pytest
from parsl.config import Config
from parsl.executors import ThreadPoolExecutor
from pyarrow import parquet

from cytotable.convert import convert
from cytotable.sources import _get_source_filepaths


def test_convert_tpe_cellprofiler_csv(
Expand Down Expand Up @@ -198,3 +200,50 @@ def test_convert_s3_path_sqlite(
[(name, "ascending") for name in s3_cytotable_table_nested.schema.names]
)
)


def test_get_source_filepaths(
load_parsl_threaded: None, fx_tempdir: str, data_dir_cellprofiler: str
):
"""
Tests _get_source_filepaths
"""

# test that no sources raises an exception
empty_dir = pathlib.Path(f"{fx_tempdir}/temp")
empty_dir.mkdir(parents=True, exist_ok=True)
with pytest.raises(Exception):
single_dir_result = _get_source_filepaths(
path=empty_dir,
targets=["image", "cells", "nuclei", "cytoplasm"],
).result()

# check that single sqlite file is returned as desired
single_file_result = _get_source_filepaths(
path=pathlib.Path(
f"{data_dir_cellprofiler}/NF1_SchwannCell_data/all_cellprofiler.sqlite"
),
targets=["cells"],
).result()
assert len(set(single_file_result.keys())) == 1

# check that single csv file is returned as desired
single_file_result = _get_source_filepaths(
path=pathlib.Path(f"{data_dir_cellprofiler}/ExampleHuman/Cells.csv"),
targets=["cells"],
).result()
assert len(set(single_file_result.keys())) == 1

single_dir_result = _get_source_filepaths(
path=pathlib.Path(f"{data_dir_cellprofiler}/ExampleHuman"),
targets=["cells"],
).result()
# test that the single dir structure includes 1 unique key (for cells)
assert len(set(single_dir_result.keys())) == 1

single_dir_result = _get_source_filepaths(
path=pathlib.Path(f"{data_dir_cellprofiler}/ExampleHuman"),
targets=["image", "cells", "nuclei", "cytoplasm"],
).result()
# test that the single dir structure includes 4 unique keys
assert len(set(single_dir_result.keys())) == 4

0 comments on commit f5e45af

Please sign in to comment.