changeset 1293:6952e7a560f8

benchmark: wrapped long string literals and docstrings
author Martin Geisler <mg@cs.au.dk>
date Fri, 16 Oct 2009 19:08:46 +0200
parents 9c49d09e2dac
children cefcb223c892
files apps/benchmark.py apps/benchmark_classes.py
diffstat 2 files changed, 19 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/apps/benchmark.py	Fri Oct 16 19:04:04 2009 +0200
+++ b/apps/benchmark.py	Fri Oct 16 19:08:46 2009 +0200
@@ -128,11 +128,18 @@
 parser.add_option("-f", "--fake", action="store_true",
                   help="skip local computations using fake field elements")
 parser.add_option("--args", type="string",
-                  help="additional arguments to the runtime, the format is a comma separated list of id=value pairs e.g. --args s=1,d=0,lambda=1")
+                  help=("additional arguments to the runtime, the format is "
+                        "a comma separated list of id=value pairs e.g. "
+                        "--args s=1,d=0,lambda=1"))
 parser.add_option("--needed_data", type="string",
-                  help="name of a file containing already computed dictionary of needed_data. Useful for skipping generating the needed data, which usually elliminates half the execution time. Format of file: \"{('random_triple', (Zp,)): [(3, 1), (3, 4)]}\"")
+                  help=("name of a file containing already computed "
+                        "dictionary of needed_data. Useful for skipping "
+                        "generating the needed data, which usually "
+                        "elliminates half the execution time. Format of file: "
+                        "\"{('random_triple', (Zp,)): [(3, 1), (3, 4)]}\""))
 parser.add_option("--pc", type="string",
-                  help="The program counter to start from when using explicitly provided needed_data. Format: [3,0]")
+                  help=("The program counter to start from when using "
+                        "explicitly provided needed_data. Format: [3,0]"))
 
 parser.set_defaults(modulus=2**65, threshold=1, count=10,
                     runtime="PassiveRuntime", mixins="", num_players=2, prss=True,
--- a/apps/benchmark_classes.py	Fri Oct 16 19:04:04 2009 +0200
+++ b/apps/benchmark_classes.py	Fri Oct 16 19:08:46 2009 +0200
@@ -47,8 +47,9 @@
 class Benchmark(object):
     """Abstract base class for all Benchmarks.
 
-    For concrete classes see the `ParallelBenchmark` and `SequentialBenchmark` classes.
-    A concrete class must be mixed with a `BenchmarkStrategy` and an `Operator`.
+    For concrete classes see the `ParallelBenchmark` and
+    `SequentialBenchmark` classes. A concrete class must be mixed with
+    a `BenchmarkStrategy` and an `Operator`.
     """
 
     def __init__(self, rt, operation, field, count):
@@ -127,7 +128,8 @@
 
 
 class SequentialBenchmark(Benchmark):
-    """A benchmark where the operations are executed one after each other."""
+    """A benchmark where the operations are executed one after each
+    other."""
 
     def run_test(self, _, termination_function, d):
         record_start("sequential test")
@@ -222,7 +224,8 @@
 
 
 class SelfcontainedBenchmarkStrategy(BenchmarkStrategy):
-    """In a self contained benchmark strategy, all the needed data is generated on the fly."""
+    """In a self contained benchmark strategy, all the needed data is
+    generated on the fly."""
 
     def benchmark(self, *args):
         sys.stdout.flush()
@@ -233,8 +236,8 @@
 
 
 class NeededDataBenchmarkStrategy(BenchmarkStrategy):
-    """In a needed data benchmark strategy, all the needed data has to have been generated
-    before the test is run."""
+    """In a needed data benchmark strategy, all the needed data has to
+    have been generated before the test is run."""
 
     def benchmark(self, needed_data, pc, *args):
         self.pc = pc