From 7ecce69a09ef166dbe759ba76a45dd01270d758e Mon Sep 17 00:00:00 2001 From: Justin Hiemstra Date: Tue, 7 Nov 2023 20:49:08 +0000 Subject: [PATCH] Cleanup after intense rebase --- Snakefile | 1 - spras/allpairs.py | 5 ++--- spras/analysis/cytoscape.py | 9 +-------- spras/containers.py | 1 + spras/domino.py | 5 ++--- spras/meo.py | 5 ++--- spras/mincostflow.py | 5 ++--- spras/omicsintegrator1.py | 5 ++--- spras/omicsintegrator2.py | 6 +++--- spras/pathlinker.py | 5 ++--- test/test_config.py | 2 +- test/test_util.py | 17 +++-------------- 12 files changed, 21 insertions(+), 45 deletions(-) diff --git a/Snakefile b/Snakefile index 08c9c92e..52ee101d 100644 --- a/Snakefile +++ b/Snakefile @@ -3,7 +3,6 @@ from spras import runner import shutil import yaml from spras.dataset import Dataset -from spras.util import process_config from spras.analysis import ml, summary, graphspace, cytoscape from spras.dataset import Dataset from spras.analysis import ml, summary, graphspace, cytoscape diff --git a/spras/allpairs.py b/spras/allpairs.py index 49646036..f51aa4f6 100644 --- a/spras/allpairs.py +++ b/spras/allpairs.py @@ -3,10 +3,9 @@ import pandas as pd -from spras.prm import PRM -from spras.util import prepare_volume -from spras.containers import run_container import spras.config as config +from spras.containers import prepare_volume, run_container +from spras.prm import PRM __all__ = ['AllPairs'] diff --git a/spras/analysis/cytoscape.py b/spras/analysis/cytoscape.py index 7b429a1c..ce7e8074 100644 --- a/spras/analysis/cytoscape.py +++ b/spras/analysis/cytoscape.py @@ -2,14 +2,8 @@ from shutil import rmtree from typing import List, Union -<<<<<<< HEAD:spras/analysis/cytoscape.py import spras.config as config -from spras.containers import run_container -from spras.util import prepare_volume -======= -import src.config as config -from src.containers import prepare_volume, run_container ->>>>>>> 75b746c (Move container framework to algorith run call and fix hash lengths):src/analysis/cytoscape.py +from spras.containers import prepare_volume, run_container def run_cytoscape(pathways: List[Union[str, PurePath]], output_file: str, container_framework="docker") -> None: @@ -55,7 +49,6 @@ def run_cytoscape(pathways: List[Union[str, PurePath]], output_file: str, contai print('Running Cytoscape with arguments: {}'.format(' '.join(command)), flush=True) - # TODO consider making this a string in the config file instead of a Boolean container_prefix = "py4cytoscape:v1" out = run_container(container_framework, container_prefix, diff --git a/spras/containers.py b/spras/containers.py index cede895b..96ebf535 100644 --- a/spras/containers.py +++ b/spras/containers.py @@ -7,6 +7,7 @@ import docker import spras.config as config +from spras.util import hash_filename def prepare_path_docker(orig_path: PurePath) -> str: diff --git a/spras/domino.py b/spras/domino.py index e764f65a..a1f35ed5 100644 --- a/spras/domino.py +++ b/spras/domino.py @@ -3,10 +3,9 @@ import pandas as pd -from spras.prm import PRM -from spras.util import prepare_volume -from spras.containers import run_container import spras.config as config +from spras.containers import prepare_volume, run_container +from spras.prm import PRM __all__ = ['DOMINO', 'pre_domino_id_transform', 'post_domino_id_transform'] diff --git a/spras/meo.py b/spras/meo.py index 0e3fc30c..1000b41e 100644 --- a/spras/meo.py +++ b/spras/meo.py @@ -2,10 +2,9 @@ import pandas as pd -from spras.prm import PRM -from spras.util import prepare_volume -from spras.containers import run_container import spras.config as config +from spras.containers import prepare_volume, run_container +from spras.prm import PRM __all__ = ['MEO', 'write_properties'] diff --git a/spras/mincostflow.py b/spras/mincostflow.py index 89d67705..f7d250ee 100644 --- a/spras/mincostflow.py +++ b/spras/mincostflow.py @@ -2,10 +2,9 @@ import pandas as pd -from spras.prm import PRM -from spras.util import prepare_volume -from spras.containers import run_container import spras.config as config +from spras.containers import prepare_volume, run_container +from spras.prm import PRM __all__ = ['MinCostFlow'] diff --git a/spras/omicsintegrator1.py b/spras/omicsintegrator1.py index 984c8bf2..af304c88 100644 --- a/spras/omicsintegrator1.py +++ b/spras/omicsintegrator1.py @@ -2,10 +2,9 @@ import pandas as pd -from spras.prm import PRM -from spras.util import prepare_volume -from spras.containers import run_container import spras.config as config +from spras.containers import prepare_volume, run_container +from spras.prm import PRM __all__ = ['OmicsIntegrator1', 'write_conf'] diff --git a/spras/omicsintegrator2.py b/spras/omicsintegrator2.py index bad88a03..2dbe78c0 100644 --- a/spras/omicsintegrator2.py +++ b/spras/omicsintegrator2.py @@ -2,11 +2,11 @@ import pandas as pd +import spras.config as config +from spras.containers import prepare_volume, run_container from spras.dataset import Dataset from spras.prm import PRM -from spras.util import add_rank_column, prepare_volume -from spras.containers import run_container -import spras.config as config +from spras.util import add_rank_column __all__ = ['OmicsIntegrator2'] diff --git a/spras/pathlinker.py b/spras/pathlinker.py index e86d051f..b4dfa11f 100644 --- a/spras/pathlinker.py +++ b/spras/pathlinker.py @@ -3,10 +3,9 @@ import pandas as pd -from spras.prm import PRM -from spras.util import prepare_volume -from spras.containers import run_container import spras.config as config +from spras.containers import prepare_volume, run_container +from spras.prm import PRM __all__ = ['PathLinker'] diff --git a/test/test_config.py b/test/test_config.py index 196226ac..fc45bc42 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -1,6 +1,6 @@ import pytest -import src.config as config +import spras.config as config # Set up a dummy config for testing. For now, only include things that MUST exist in the dict diff --git a/test/test_util.py b/test/test_util.py index 9c4afb3b..baf9db0e 100644 --- a/test/test_util.py +++ b/test/test_util.py @@ -2,20 +2,9 @@ import pytest - -from spras.util import ( - hash_params_sha1_base32, - prepare_volume, -) - -from spras.containers import ( - convert_docker_path, - prepare_path_docker, -) -from src.util import ( - hash_params_sha1_base32, - prepare_volume, -) +import spras.config as config +from spras.containers import convert_docker_path, prepare_path_docker, prepare_volume +from spras.util import hash_params_sha1_base32 config.init_from_file("config/config.yaml")