-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23fb84d
commit 0e9dc01
Showing
18 changed files
with
121 additions
and
104 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
utils/scatter_plot_plugin/Dockerfile → utils/plotting/scatter_plot_tool/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
version=$(<VERSION) | ||
docker build . -t polusai/scatter-plot-tool:${version} |
6 changes: 3 additions & 3 deletions
6
utils/scatter_plot_plugin/ict.yml → utils/plotting/scatter_plot_tool/ict.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
specVersion: "0.1.0" | ||
name: scatter_plot | ||
version: 0.1.0 | ||
container: scatter-plot-plugin | ||
container: scatter-plot-tool | ||
entrypoint: | ||
title: scatter_plot | ||
description: Generate a scatter plot | ||
author: Data Scientist | ||
contact: [email protected] | ||
author: Brandon Walker, Nazanin Donyapour | ||
contact: [email protected], [email protected] | ||
repository: | ||
documentation: | ||
citation: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
59 changes: 59 additions & 0 deletions
59
utils/plotting/scatter_plot_tool/src/polus/mm/utils/scatter_plot/__main__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
"""parse arguments and call scatter_plot.""" | ||
import argparse | ||
import logging | ||
from os import environ | ||
|
||
from polus.mm.utils.scatter_plot.scatter_plot import scatter_plot | ||
|
||
logging.basicConfig( | ||
format="%(asctime)s - %(name)-8s - %(levelname)-8s - %(message)s", | ||
datefmt="%d-%b-%y %H:%M:%S", | ||
) | ||
POLUS_LOG = getattr(logging, environ.get("POLUS_LOG", "INFO")) | ||
logger = logging.getLogger("polus.mm.utils.scatter_plot.") | ||
logger.setLevel(POLUS_LOG) | ||
|
||
|
||
def main(xs: list, ys: list, ys2: list, output_png_path: str) -> None: | ||
"""scatter_plot.""" | ||
logger.info(f"xs: {xs}") | ||
logger.info(f"ys: {ys}") | ||
logger.info(f"ys2: {ys2}") | ||
logger.info(f"output_png_path: {output_png_path}") | ||
|
||
scatter_plot(xs=xs, ys=ys, ys2=ys2, output_png_path=output_png_path) | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser(description="scatter_plot") | ||
parser.add_argument( | ||
"--xs", | ||
type=float, | ||
nargs="+", | ||
required=True, | ||
help="List of x values", | ||
) | ||
parser.add_argument( | ||
"--ys", | ||
type=float, | ||
nargs="+", | ||
required=True, | ||
help="List of y values", | ||
) | ||
parser.add_argument( | ||
"--ys2", | ||
type=float, | ||
nargs="+", | ||
help="Optional second list of y values", | ||
) | ||
parser.add_argument( | ||
"--output_png_path", | ||
type=str, | ||
required=True, | ||
help="Path to the output \ | ||
png file", | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
main(xs=args.xs, ys=args.ys, ys2=args.ys2, output_png_path=args.output_png_path) |
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions
37
utils/plotting/scatter_plot_tool/tests/test_scatter_plot.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"""Tests for scatter_plot.""" | ||
from pathlib import Path | ||
|
||
from polus.mm.utils.scatter_plot.scatter_plot import scatter_plot | ||
from sophios.api.pythonapi import Step | ||
from sophios.api.pythonapi import Workflow | ||
|
||
|
||
def test_scatter_plot() -> None: | ||
"""Test scatter_plot.""" | ||
scatter_plot([1, 2, 3], [1, 2, 3], [], "test.png") | ||
assert Path("test.png").exists() | ||
|
||
|
||
def test_duplicate() -> None: | ||
"""Test scatter plot CWL.""" | ||
cwl_file_str = "scatter_plot_0@[email protected]" | ||
cwl_file = Path(__file__).resolve().parent.parent / Path(cwl_file_str) | ||
|
||
scatter_plot = Step(clt_path=cwl_file) | ||
scatter_plot.xs = [1, 2, 3] | ||
scatter_plot.ys = [1, 2, 3] | ||
scatter_plot.ys2 = [1, 2, 3] | ||
scatter_plot.output_png_path = "test.png" | ||
|
||
steps = [scatter_plot] | ||
filename = "scatter_plot" | ||
viz = Workflow(steps, filename) | ||
|
||
viz.run() | ||
|
||
outdir = Path("outdir") | ||
files = list(outdir.rglob("test.png")) | ||
|
||
assert ( | ||
files | ||
), f"The file 'test.png' does not exist in any subdirectory of '{outdir}'." |
54 changes: 0 additions & 54 deletions
54
utils/scatter_plot_plugin/src/polus/mm/utils/scatter_plot/__main__.py
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.