Commit 70323388 authored by André Anjos's avatar André Anjos 💬 Committed by Samuel GAIST

Add nitpick exceptions for documentation

parent 59d4f847
......@@ -66,8 +66,8 @@ def setup_scalar(formatname, attrname, dtype, value, casting, add_defaults):
dtype (numpy.dtype): The datatype of every element on the array
value (:std:term:`object`, Optional): A representation of the value. This
object will be cast into a scalar with the dtype defined by the
value (:std:term:`file object`, Optional): A representation of the value.
This object will be cast into a scalar with the dtype defined by the
``dtype`` parameter.
casting (str): See :py:func:`numpy.can_cast` for a description of possible
......@@ -145,9 +145,9 @@ def setup_array(formatname, attrname, shape, dtype, value, casting,
dtype (numpy.dtype): The datatype of every element on the array
value (:std:term:`object`, Optional): A representation of the value. This
object will be cast into a numpy array with the dtype defined by the
``dtype`` parameter.
value (:std:term:`file object`, Optional): A representation of the value.
This object will be cast into a numpy array with the dtype defined by
the ``dtype`` parameter.
casting (str): See :py:func:`numpy.can_cast` for a description of possible
values for this field.
......@@ -231,10 +231,10 @@ def pack_array(dtype, value, fd):
dtype (numpy.dtype): The datatype of the array (taken from the format
descriptor)
value (:std:term:`object`, Optional): The :py:class:`numpy.ndarray`
value (:std:term:`file object`, Optional): The :py:class:`numpy.ndarray`
representing the value to be encoded
fd (:std:term:`file`): The file where to encode the input
fd (:std:term:`file object`): The file where to encode the input
"""
......@@ -269,7 +269,7 @@ def pack_scalar(dtype, value, fd):
value (:std:term:`object`, Optional): An object representing the value to
be encoded
fd (:std:term:`file`): The file where to encode the input
fd (:std:term:`file object`): The file where to encode the input
"""
......@@ -312,7 +312,7 @@ def unpack_array(shape, dtype, fd):
dtype (numpy.dtype): The datatype of every element on the array
fd (:std:term:`file`): The file where to encode the input
fd (:std:term:`file object`): The file where to encode the input
Returns:
......@@ -353,7 +353,7 @@ def unpack_scalar(dtype, fd):
dtype (numpy.dtype): The datatype of every element on the array
fd (:std:term:`file`): The file where to encode the input
fd (:std:term:`file object`): The file where to encode the input
Returns:
......
......@@ -823,9 +823,11 @@ class StdoutDataSink(DataSink):
"""
if self.display_data:
print('%s(%d -> %d): %s' % (self.prefix, start_data_index, end_data_index, str(data)))
print('%s(%d -> %d): %s' % \
(self.prefix, start_data_index, end_data_index, str(data)))
else:
print('%s(%d -> %d): <data>' % (self.prefix, start_data_index, end_data_index))
print('%s(%d -> %d): <data>' % \
(self.prefix, start_data_index, end_data_index))
def isConnected(self):
......
......@@ -754,9 +754,8 @@ class DatabaseTester:
if len(connected_outputs) == 0:
return
print("Testing '{}', with {} output(s): {}".format(
self.name, len(connected_outputs),
', '.join(connected_outputs)))
print("Testing '%s', with %d output(s): %s" % \
(self.name, len(connected_outputs), ', '.join(connected_outputs)))
# Create the mock outputs
connected_outputs = dict([ x for x in self.outputs_declaration.items()
......@@ -820,8 +819,7 @@ class DatabaseTester:
# Check the number of data produced on the regular outputs
for name in connected_outputs.keys():
print(' - {}: {} data'.format(name,
len(outputs[name].written_data)))
print(' - %s: %d data' % (name, len(outputs[name].written_data)))
if name not in self.irregular_outputs:
assert(len(outputs[name].written_data) == next_index / connected_outputs[name])
......
......@@ -387,19 +387,19 @@ class DataFormat(object):
def validate(self, data):
"""Validates a piece of data provided by the user
In order to validate, the data object must be complete and safe-castable to
this dataformat. For any other validation operation that would require
special settings, use instead the :py:meth:`type` method to generate a
valid type and use either ``from_dict``, ``unpack`` or ``unpack_from``
depending on your use-case.
In order to validate, the data object must be complete and
safe-castable to this dataformat. For any other validation operation
that would require special settings, use instead the :py:meth:`type`
method to generate a valid type and use either ``from_dict``,
``unpack`` or ``unpack_from`` depending on your use-case.
Parameters:
data (dict, str, :std:term:`file`): This parameter represents the data to be
validated. It may be a dictionary with the JSON representation of
a data blob or, else, a binary blob (represented by either a string
or a file descriptor object) from which the data will be read. If
problems occur, an exception is raised.
data (dict, str, :std:term:`file object`): This parameter represents
the data to be validated. It may be a dictionary with the JSON
representation of a data blob or, else, a binary blob (represented
by either a string or a file descriptor object) from which the data
will be read. If problems occur, an exception is raised.
Returns:
......
# Not available in Python 2.7, but ok in Python 3.x
py:exc TypeError
py:exc RuntimeError
py:exc ValueError
py:exc KeyError
py:class tuple
py:class list
# Issue on the simplejson documentation
py:class simplejson.encoder.JSONEncoder
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment