From ad20452340d052570c1b3203259d10e1ad94a236 Mon Sep 17 00:00:00 2001 From: Eric Enns Date: Fri, 9 Oct 2015 10:08:48 -0500 Subject: [PATCH 1/3] Fix output to print values and not hash key --- tools/stats/gsummary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/stats/gsummary.py b/tools/stats/gsummary.py index 10b22a78f11..149ddb8f685 100755 --- a/tools/stats/gsummary.py +++ b/tools/stats/gsummary.py @@ -110,7 +110,7 @@ def main(): stop_err( "Computation resulted in the following error: %s" % str( s ) ) summary = summary.as_py( BASIC_CONVERSION ) outfile.write( "#%s\n" % headings_str ) - outfile.write( "%s\n" % "\t".join( [ "%g" % k for k in summary ] ) ) + outfile.write( "%s\n" % "\t".join( [ "%g" % summary[k] for k in summary ] ) ) outfile.close() if skipped_lines: From ad4458a458d7ccb5238094ab3d1967072b5a0b76 Mon Sep 17 00:00:00 2001 From: Eric Enns Date: Fri, 9 Oct 2015 10:34:20 -0500 Subject: [PATCH 2/3] Revert to previous changes if using rpy2 --- tools/stats/gsummary.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/stats/gsummary.py b/tools/stats/gsummary.py index 149ddb8f685..eaf2a0c5855 100755 --- a/tools/stats/gsummary.py +++ b/tools/stats/gsummary.py @@ -110,7 +110,12 @@ def main(): stop_err( "Computation resulted in the following error: %s" % str( s ) ) summary = summary.as_py( BASIC_CONVERSION ) outfile.write( "#%s\n" % headings_str ) - outfile.write( "%s\n" % "\t".join( [ "%g" % summary[k] for k in summary ] ) ) + if type(summary) is dict: + #using rpy + outfile.write( "%s\n" % "\t".join( [ "%g" % summary[k] for k in summary ] ) ) + else: + #using rpy2 + outfile.write( "%s\n" % "\t".join( [ "%g" % k for k in summary ] ) ) outfile.close() if skipped_lines: From 0ec1b17794d53ae1a535b00f13d955c62f702a94 Mon Sep 17 00:00:00 2001 From: Eric Enns Date: Wed, 14 Oct 2015 08:28:30 -0500 Subject: [PATCH 3/3] Update list comprehension to go through headings instead of summary so that we output in the order we want. --- tools/stats/gsummary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/stats/gsummary.py b/tools/stats/gsummary.py index eaf2a0c5855..5b9d13d7eab 100755 --- a/tools/stats/gsummary.py +++ b/tools/stats/gsummary.py @@ -112,7 +112,7 @@ def main(): outfile.write( "#%s\n" % headings_str ) if type(summary) is dict: #using rpy - outfile.write( "%s\n" % "\t".join( [ "%g" % summary[k] for k in summary ] ) ) + outfile.write( "%s\n" % "\t".join( [ "%g" % summary[k] for k in headings ] ) ) else: #using rpy2 outfile.write( "%s\n" % "\t".join( [ "%g" % k for k in summary ] ) )