viff

changeset 715:55a855aa41e9

Remove some more epytext.
author Martin Geisler <mg@daimi.au.dk>
date Wed, 23 Apr 2008 23:11:22 +0200
parents 9aebdc00f58f
children 760b07b6e6ea
files viff/runtime.py
diffstat 1 files changed, 32 insertions(+), 53 deletions(-) [+]
line diff
     1.1 --- a/viff/runtime.py	Wed Apr 23 16:18:25 2008 +0200
     1.2 +++ b/viff/runtime.py	Wed Apr 23 23:11:22 2008 +0200
     1.3 @@ -349,13 +349,11 @@
     1.4  
     1.5  
     1.6  def increment_pc(method):
     1.7 -    """Make method automatically increment the program counter.
     1.8 +    """Make *method* automatically increment the program counter.
     1.9  
    1.10 -    Adding this decorator to a L{Runtime} method will ensure that the
    1.11 -    program counter is incremented correctly when entering the method.
    1.12 -
    1.13 -    @param method: the method.
    1.14 -    @type method: a method of L{Runtime}
    1.15 +    Adding this decorator to a :class:`Runtime` method will ensure
    1.16 +    that the program counter is incremented correctly when entering
    1.17 +    the method.
    1.18      """
    1.19  
    1.20      @wrapper(method)
    1.21 @@ -373,15 +371,14 @@
    1.22      """Track calls to this method.
    1.23  
    1.24      The decorated method will be replaced with a proxy method which
    1.25 -    first tries to get the data needed from C{self._pool}, and if that
    1.26 -    fails it falls back to the original method.
    1.27 +    first tries to get the data needed from
    1.28 +    :attr:`BasicRuntime._pool`, and if that fails it falls back to the
    1.29 +    original method.
    1.30  
    1.31 -    The C{generator} method is only used to record where the data
    1.32 -    should be generated from, the method is not actually called.
    1.33 -
    1.34 -    @param generator: Use this method as the generator for
    1.35 -    pre-processed data.
    1.36 -    @type generator: C{str}
    1.37 +    The *generator* method is only used to record where the data
    1.38 +    should be generated from, the method is not actually called. This
    1.39 +    must be the name of the method (a string) and not the method
    1.40 +    itself.
    1.41      """
    1.42  
    1.43      def preprocess_decorator(method):
    1.44 @@ -438,8 +435,8 @@
    1.45          Initialized a runtime owned by the given, the threshold, and
    1.46          optionally a set of options. The runtime has no network
    1.47          connections and knows of no other players -- the
    1.48 -        L{create_runtime} function should be used instead to create a
    1.49 -        usable runtime.
    1.50 +        :func:`create_runtime` function should be used instead to
    1.51 +        create a usable runtime.
    1.52          """
    1.53          #: ID of this player.
    1.54          self.id = player.id
    1.55 @@ -553,9 +550,6 @@
    1.56          """Make the runtime wait for the variables given.
    1.57  
    1.58          The runtime is shut down when all variables are calculated.
    1.59 -
    1.60 -        @param vars: variables to wait for.
    1.61 -        @type  vars: list of L{Deferred}s
    1.62          """
    1.63          dl = DeferredList(vars)
    1.64          dl.addCallback(lambda _: self.shutdown())
    1.65 @@ -571,12 +565,7 @@
    1.66          Deferred as usual.
    1.67  
    1.68          Any extra arguments are passed to the callback as with
    1.69 -        addCallback.
    1.70 -
    1.71 -        @param deferred: the Deferred.
    1.72 -        @param func: the callback.
    1.73 -        @param args: extra arguments.
    1.74 -        @param kwargs: extra keyword arguments.
    1.75 +        :meth:`addCallback`.
    1.76          """
    1.77          # TODO, http://tracker.viff.dk/issue22: When several callbacks
    1.78          # are scheduled from the same method, they all save the same
    1.79 @@ -647,25 +636,21 @@
    1.80      def preprocess(self, program):
    1.81          """Generate preprocess material.
    1.82  
    1.83 -        The C{program} specifies which methods to call and with which
    1.84 +        The *program* specifies which methods to call and with which
    1.85          arguments. The generator methods called must adhere to the
    1.86          following interface:
    1.87  
    1.88 -          - They must return a C{(int, Deferred)} tuple where the
    1.89 -            C{int} tells us how many items of pre-processed data the
    1.90 -            Deferred will yield.
    1.91 +        - They must return a ``(int, Deferred)`` tuple where the
    1.92 +          ``int`` tells us how many items of pre-processed data the
    1.93 +          :class:`Deferred` will yield.
    1.94  
    1.95 -          - The Deferred must yield a C{list} of the promissed length.
    1.96 +        - The Deferred must yield a list of the promissed length.
    1.97  
    1.98 -          - The C{list} contains the actual data. This data can be
    1.99 -            either a Deferred or a C{tuple} of Deferreds.
   1.100 +        - The list contains the actual data. This data can be either a
   1.101 +          Deferred or a tuple of Deferreds.
   1.102  
   1.103 -        The L{ActiveRuntime.generate_triples} method is an example of
   1.104 -        a method fulfilling this interface.
   1.105 -
   1.106 -        @param program: A description of the needed data.
   1.107 -        @type program: C{dict} mapping C{(str, args)} tuples to
   1.108 -        program counters
   1.109 +        The :meth:`ActiveRuntime.generate_triples` method is an
   1.110 +        example of a method fulfilling this interface.
   1.111          """
   1.112  
   1.113          def update(results, program_counters):
   1.114 @@ -1054,7 +1039,7 @@
   1.115      """A runtime secure against active adversaries.
   1.116  
   1.117      This class currently inherits most of its functionality from the
   1.118 -    normal L{Runtime} class and is thus I{not} yet secure.
   1.119 +    normal :class:`Runtime` class and is thus **not** yet secure.
   1.120      """
   1.121  
   1.122      def __init__(self, player, threshold, options=None):
   1.123 @@ -1124,13 +1109,9 @@
   1.124          """Share a random secret.
   1.125  
   1.126          The guarantee is that a number of shares are made and out of
   1.127 -        those, the T that are returned by this method will be correct
   1.128 -        sharings of a random number using C{degree} as the polynomial
   1.129 -        degree.
   1.130 -
   1.131 -        @param T: The number of shares output.
   1.132 -        @param degree: The degree of the polynomial.
   1.133 -        @param field: The field over which to share the secret.
   1.134 +        those, the *T* that are returned by this method will be
   1.135 +        correct sharings of a random number using *degree* as the
   1.136 +        polynomial degree.
   1.137          """
   1.138          # TODO: Move common code between single_share and
   1.139          # double_share_random out to their own methods.
   1.140 @@ -1322,13 +1303,11 @@
   1.141      def generate_triples(self, field):
   1.142          """Generate multiplication triples.
   1.143  
   1.144 -        These are random numbers M{a}, M{b}, and M{c} such that M{c =
   1.145 -        ab}. This function can be used in pre-processing.
   1.146 +        These are random numbers *a*, *b*, and *c* such that ``c =
   1.147 +        ab``. This function can be used in pre-processing.
   1.148  
   1.149 -        @return: Number of triples returned and a Deferred which will
   1.150 -        yield a C{list} of 3-tuples.
   1.151 -        @returntype: (C{int}, C{list} of Deferred C{(Share, Share,
   1.152 -        Share)})
   1.153 +        Returns a tuple with the number of triples generated and a
   1.154 +        Deferred which will yield a list of 3-tuples.
   1.155          """
   1.156          n = self.num_players
   1.157          t = self.threshold
   1.158 @@ -1497,7 +1476,7 @@
   1.159  
   1.160  
   1.161  def create_runtime(id, players, threshold, options=None, runtime_class=Runtime):
   1.162 -    """Create a L{Runtime} and connect to the other players.
   1.163 +    """Create a :class:`Runtime` and connect to the other players.
   1.164  
   1.165      This function should be used in normal programs instead of
   1.166      instantiating the Runtime directly. This function makes sure that