Skip to content

Commit

Permalink
updating filepattern and vaex package
Browse files Browse the repository at this point in the history
  • Loading branch information
hamshkhawar committed Jan 25, 2024
1 parent e4d7262 commit d8c6e4e
Showing 1 changed file with 83 additions and 84 deletions.
167 changes: 83 additions & 84 deletions clustering/feature-subsetting-plugin/tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,92 +1,91 @@
# """Test Command line Tool."""
# from typer.testing import CliRunner
# from polus.plugins.clustering.feature_subsetting.__main__ import app
# import shutil
# from pathlib import Path
"""Test Command line Tool."""
from typer.testing import CliRunner
from polus.plugins.clustering.feature_subsetting.__main__ import app
import shutil
from pathlib import Path


# def test_cli(generate_synthetic_data: tuple[Path, Path, Path, str]) -> None:
# """Test the command line."""
# inp_dir, tabular_dir, out_dir, _ = generate_synthetic_data
# file_pattern='x{x+}_y{y+}_p{p+}_c{c+}.ome.tif'
# image_feature="intensity_image"
# tabular_feature = "MEAN"
# padding=0
# group_var="p,c"
def test_cli(generate_synthetic_data: tuple[Path, Path, Path, str]) -> None:
"""Test the command line."""
inp_dir, tabular_dir, out_dir, _ = generate_synthetic_data
file_pattern = "x{x+}_y{y+}_p{p+}_c{c+}.ome.tif"
image_feature = "intensity_image"
tabular_feature = "MEAN"
padding = 0
group_var = "p,c"

runner = CliRunner()
result = runner.invoke(
app,
[
"--inpDir",
inp_dir,
"--tabularDir",
tabular_dir,
"--filePattern",
file_pattern,
"--imageFeature",
image_feature,
"--tabularFeature",
tabular_feature,
"--padding",
padding,
"--groupVar",
group_var,
"--percentile",
0.8,
"--removeDirection",
"Below",
"--writeOutput",
"--outDir",
out_dir,
],
)

# runner = CliRunner()
# result = runner.invoke(
# app,
# [
# "--inpDir",
# inp_dir,
# "--tabularDir",
# tabular_dir,
# "--filePattern",
# file_pattern,
# "--imageFeature",
# image_feature,
# "--tabularFeature",
# tabular_feature,
# "--padding",
# padding,
# "--groupVar",
# group_var,
# "--percentile",
# 0.8,
# "--removeDirection",
# "Below",
# "--writeOutput",
# "--outDir",
# out_dir,
# ],
# )
assert result.exit_code == 0
shutil.rmtree(inp_dir)
shutil.rmtree(out_dir)
shutil.rmtree(tabular_dir)

# assert result.exit_code == 0
# shutil.rmtree(inp_dir)
# shutil.rmtree(out_dir)
# shutil.rmtree(tabular_dir)

def test_short_cli(generate_synthetic_data: tuple[Path, Path, Path, str]) -> None:
"""Test short cli command line."""
inp_dir, tabular_dir, out_dir, _ = generate_synthetic_data
file_pattern = "x{x+}_y{y+}_p{p+}_c{c+}.ome.tif"
image_feature = "intensity_image"
tabular_feature = "MEAN"
padding = 0
group_var = "p,c"

# def test_short_cli(generate_synthetic_data: tuple[Path, Path, Path, str]) -> None:
# """Test short cli command line."""
# inp_dir, tabular_dir, out_dir, _ = generate_synthetic_data
# file_pattern='x{x+}_y{y+}_p{p+}_c{c+}.ome.tif'
# image_feature="intensity_image"
# tabular_feature = "MEAN"
# padding=0
# group_var="p,c"
runner = CliRunner()
result = runner.invoke(
app,
[
"-i",
inp_dir,
"-t",
tabular_dir,
"-f",
file_pattern,
"-if",
image_feature,
"-tf",
tabular_feature,
"-p",
padding,
"-g",
group_var,
"-pc",
0.8,
"-r",
"Below",
"-w",
"-o",
out_dir,
],
)

# runner = CliRunner()
# result = runner.invoke(
# app,
# [
# "-i",
# inp_dir,
# "-t",
# tabular_dir,
# "-f",
# file_pattern,
# "-if",
# image_feature,
# "-tf",
# tabular_feature,
# "-p",
# padding,
# "-g",
# group_var,
# "-pc",
# 0.8,
# "-r",
# "Below",
# "-w",
# "-o",
# out_dir,
# ],
# )

# assert result.exit_code == 0
# shutil.rmtree(inp_dir)
# shutil.rmtree(out_dir)
# shutil.rmtree(tabular_dir)
assert result.exit_code == 0
shutil.rmtree(inp_dir)
shutil.rmtree(out_dir)
shutil.rmtree(tabular_dir)

0 comments on commit d8c6e4e

Please sign in to comment.