From c8f189c6af368cac10703056f114fbbffe3148df Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Wed, 28 Nov 2012 16:01:04 -0800 Subject: [PATCH] Remove prints that were being called in test code. It messes up my dots. Unfortunately the fastq validator is still ugly. But at least its messages are a lot shorter. There was one debugging function ls_tree in simulate_runfolder that I renamed to print_ls_tree because I'll occasionally remember to grep for print to find things I shouldn't commit. --- encode_submission/test_encode_find.py | 1 - htsworkflow/pipelines/test/simulate_runfolder.py | 4 +++- htsworkflow/pipelines/test/test_eland.py | 1 - htsworkflow/pipelines/test/test_runfolder_casava_1_7.py | 3 --- htsworkflow/submission/condorfastq.py | 6 +++--- htsworkflow/submission/results.py | 3 --- htsworkflow/util/test/test_makebed.py | 1 - 7 files changed, 6 insertions(+), 13 deletions(-) diff --git a/encode_submission/test_encode_find.py b/encode_submission/test_encode_find.py index 6844fa4..77c7585 100644 --- a/encode_submission/test_encode_find.py +++ b/encode_submission/test_encode_find.py @@ -12,7 +12,6 @@ from htsworkflow.util.rdfhelp import add_default_schemas, \ from htsworkflow.util.rdfinfer import Infer SOURCE_PATH = os.path.split(os.path.abspath(__file__))[0] -print SOURCE_PATH class TestEncodeFind(TestCase): def setUp(self): diff --git a/htsworkflow/pipelines/test/simulate_runfolder.py b/htsworkflow/pipelines/test/simulate_runfolder.py index 6734b96..afa2edf 100644 --- a/htsworkflow/pipelines/test/simulate_runfolder.py +++ b/htsworkflow/pipelines/test/simulate_runfolder.py @@ -681,7 +681,9 @@ HWI-ST0787\t102\t{lane}\t1101\t1625\t1994\t{index}\t1\tAANAATGCTACAGAGACAAAACAAA """.format(lane=lane, index=index_seq) return body -def ls_tree(root): +def print_ls_tree(root): + """List tree contents, useful for debugging. + """ for dirpath, dirnames, filenames in os.walk(root): for filename in filenames: print os.path.join(dirpath, filename) diff --git a/htsworkflow/pipelines/test/test_eland.py b/htsworkflow/pipelines/test/test_eland.py index 43953fc..57ad62c 100644 --- a/htsworkflow/pipelines/test/test_eland.py +++ b/htsworkflow/pipelines/test/test_eland.py @@ -239,7 +239,6 @@ class ElandTests(TestCase): e.results[sl1] = 'Lane1' e_list = e.values() - print e.items() self.assertEqual(e_list[0], 'Lane1') self.assertEqual(e_list[1], 'Lane3') self.assertEqual(e_list[2], 'Lane5') diff --git a/htsworkflow/pipelines/test/test_runfolder_casava_1_7.py b/htsworkflow/pipelines/test/test_runfolder_casava_1_7.py index ae91055..c0b12b4 100644 --- a/htsworkflow/pipelines/test/test_runfolder_casava_1_7.py +++ b/htsworkflow/pipelines/test/test_runfolder_casava_1_7.py @@ -197,7 +197,6 @@ class RunfolderTests(TestCase): def test_eland(self): - ls_tree(self.runfolder_dir) hg_map = {'Lambda.fa': 'Lambda.fa'} for i in range(1,22): short_name = 'chr%d.fa' % (i,) @@ -299,8 +298,6 @@ class RunfolderTests(TestCase): glob.fnmatch.fnmatch("s_1_0001_qseq.txt", pattern), False) - print pattern - def suite(): from unittest2 import TestSuite, defaultTestLoader diff --git a/htsworkflow/submission/condorfastq.py b/htsworkflow/submission/condorfastq.py index f78a964..d79502d 100644 --- a/htsworkflow/submission/condorfastq.py +++ b/htsworkflow/submission/condorfastq.py @@ -99,8 +99,8 @@ class CondorFastqExtract(object): conversion = conversion_funcs.get(condor_type, None) if conversion is None: errmsg = "Unrecognized type: {0} for {1}" - print errmsg.format(condor_type, - pformat(available_sources)) + LOGGER.error(errmsg.format(condor_type, + pformat(available_sources))) continue sources = available_sources.get(condor_type, None) @@ -108,7 +108,7 @@ class CondorFastqExtract(object): condor_entries.setdefault(condor_type, []).append( conversion(sources, target_pathname)) else: - print " need file", target_pathname + LOGGER.warn(" need file %s", target_pathname) return condor_entries diff --git a/htsworkflow/submission/results.py b/htsworkflow/submission/results.py index ca6f1e9..c9000e4 100644 --- a/htsworkflow/submission/results.py +++ b/htsworkflow/submission/results.py @@ -48,7 +48,6 @@ class ResultMap(MutableMapping): def make_tree_from(self, source_path, destpath = None): """Create a tree using data files from source path. """ - print source_path, destpath if destpath is None: destpath = os.getcwd() @@ -62,14 +61,12 @@ class ResultMap(MutableMapping): source_rel_dir = os.path.join(source_path, lib_path) source_lib_dir = os.path.abspath(source_rel_dir) - print "source_lib_dir", source_lib_dir for filename in os.listdir(source_lib_dir): source_pathname = os.path.join(source_lib_dir, filename) target_pathname = os.path.join(lib_destination, filename) if not os.path.exists(source_pathname): raise IOError( "{0} does not exist".format(source_pathname)) - print target_pathname if not os.path.exists(target_pathname): os.symlink(source_pathname, target_pathname) LOGGER.info( diff --git a/htsworkflow/util/test/test_makebed.py b/htsworkflow/util/test/test_makebed.py index b701e08..af815b6 100644 --- a/htsworkflow/util/test/test_makebed.py +++ b/htsworkflow/util/test/test_makebed.py @@ -43,7 +43,6 @@ class testMakeBed(TestCase): out = StringIO() out = list(makebed.make_bed_from_multi_eland_generator(instream, 'name', 'desc', 'mm9_chr', 1)) - print out self.failUnlessEqual(len(out), 1) -- 2.30.2