Commit 6c6a3de6 authored by André Anjos's avatar André Anjos 💬

Be more verbose about types

parent 17d9ed6d
Pipeline #4147 failed with stage
in 6 minutes and 9 seconds
......@@ -22,9 +22,9 @@ def open_file(filename, mode='rt'):
Parameters:
filename (:obj:`str`, :obj:`file`): The name of the score file to open, or
a file-like object open for reading. If a file name is given, the
according file might be a raw text file or a (compressed) tar file
filename (:py:class:`str`, file object): The name of the score file to
open, or a file-like object open for reading. If a file name is given,
the according file might be a raw text file or a (compressed) tar file
containing a raw text file.
......@@ -74,8 +74,8 @@ def four_column(filename):
Parameters:
filename (:obj:`str`, :obj:`file`): The file object that will be opened
with :py:func:`open_file` containing the scores.
filename (:py:class:`str`, :py:class:`File`): The file object that will be
opened with :py:func:`open_file` containing the scores.
Returns:
......@@ -119,8 +119,8 @@ def split_four_column(filename):
Parameters:
filename (:obj:`str`, :obj:`file`): The file object that will be opened
with :py:func:`open_file` containing the scores.
filename (:py:class:`str`, :py:class:`File`): The file object that will be
opened with :py:func:`open_file` containing the scores.
Returns:
......@@ -155,8 +155,8 @@ def cmc_four_column(filename):
Parameters:
filename (:obj:`str`, :obj:`file`): The file object that will be opened
with :py:func:`open_file` containing the scores.
filename (:py:class:`str`, :py:class:`File`): The file object that will be
opened with :py:func:`open_file` containing the scores.
Returns:
......@@ -201,8 +201,8 @@ def five_column(filename):
Parameters:
filename (:obj:`str`, :obj:`file`): The file object that will be opened with
:py:func:`open_file` containing the scores.
filename (:py:class:`str`, :py:class:`File`): The file object that will be
opened with :py:func:`open_file` containing the scores.
Returns:
......@@ -248,8 +248,8 @@ def split_five_column(filename):
Parameters:
filename (:obj:`str`, :obj:`file`): The file object that will be opened with
:py:func:`open_file` containing the scores.
filename (:py:class:`str`, :py:class:`File`): The file object that will be
opened with :py:func:`open_file` containing the scores.
Returns:
......@@ -284,8 +284,8 @@ def cmc_five_column(filename):
Parameters:
filename (:obj:`str`, :obj:`file`): The file object that will be opened with
:py:func:`open_file` containing the scores.
filename (:py:class:`str`, :py:class:`File`): The file object that will be
opened with :py:func:`open_file` containing the scores.
Returns:
......@@ -317,12 +317,12 @@ def load_score(filename, ncolumns=None):
Parameters:
filename (:obj:`str`, :obj:`file`): The file object that will be opened
with :py:func:`open_file` containing the scores.
filename (:py:class:`str`, :py:class:`File`): The file object that will be
opened with :py:func:`open_file` containing the scores.
ncolumns (:obj:`int`, optional): 4, 5 or None (the default), specifying the
number of columns in the score file. If None is provided, the number of
columns will be guessed.
ncolumns (:py:class:`int`, optional): 4, 5 or None (the default),
specifying the number of columns in the score file. If None is provided,
the number of columns will be guessed.
Returns:
......
......@@ -50,9 +50,9 @@ def write_matrix(
The mask file defines, which values are positives, negatives or to be
ignored. Usually, the file name extension is ``.mask``
model_names (:obj:`str`, optional): If given, the matrix will be written in
the same order as the given model names. The model names must be
identical with the second column in the 5-column ``score_file``.
model_names (py:py:class:`str`, optional): If given, the matrix will be
written in the same order as the given model names. The model names must
be identical with the second column in the 5-column ``score_file``.
.. note::
......@@ -62,24 +62,24 @@ def write_matrix(
Only the scores of the given models will be considered.
probe_names (:obj:`list`, optional): A list of strings. If given, the
matrix will be written in the same order as the given probe names (the
``path`` of the probe). The probe names are identical to the third
probe_names (:py:py:class:`list`, optional): A list of strings. If given,
the matrix will be written in the same order as the given probe names
(the ``path`` of the probe). The probe names are identical to the third
column of the 4-column (or the fourth column of the 5-column)
``score_file``. Only the scores of the given probe names will be
considered in this case.
score_file_format (:obj:`str`, optional): One of ``('4column',
score_file_format (:py:class:`str`, optional): One of ``('4column',
'5column')``. The format, in which the ``score_file`` is; defaults to
``'4column'``
gallery_file_name (:obj:`str`, optional): The name of the gallery file that
will be written in the header of the OpenBR files.
gallery_file_name (:py:class:`str`, optional): The name of the gallery file
that will be written in the header of the OpenBR files.
probe_file_name (:obj:`str`, optional): The name of the probe file that
probe_file_name (:py:class:`str`, optional): The name of the probe file that
will be written in the header of the OpenBR files.
search (:obj:`int`, optional): If given, the scores will be sorted per
search (:py:class:`int`, optional): If given, the scores will be sorted per
probe, keeping the specified number of highest scores. If the given
number is higher than the models, ``NaN`` values will be added, and the
mask will contain ``0x00`` values.
......@@ -226,39 +226,40 @@ def write_score_file(
score_file (str): Path to the 4 or 5 column style score file that should be
written.
models_ids (:obj:`list`, optional): A list of strings with the client ids
of the models that will be written in the first column of the score file.
If given, the size must be identical to the number of models (gallery
templates) in the OpenBR files. If not given, client ids of the model
will be identical to the **gallery index** in the matrix file.
models_ids (:py:class:`list`, optional): A list of strings with the client
ids of the models that will be written in the first column of the score
file. If given, the size must be identical to the number of models
(gallery templates) in the OpenBR files. If not given, client ids of the
model will be identical to the **gallery index** in the matrix file.
probes_ids (:obj:`list`, optional): A list of strings with the client ids
of the probes that will be written in the second/third column of the
probes_ids (:py:class:`list`, optional): A list of strings with the client
ids of the probes that will be written in the second/third column of the
four/five column score file. If given, the size must be identical to the
number of probe templates in the OpenBR files. It will be checked that
the OpenBR mask fits to the model/probe client ids. If not given, the
probe ids will be estimated automatically, i.e., to fit the OpenBR
matrix.
model_names (:obj:`list`, optional): A list of strings with the model path
written in the second column of the five column score file. If not given,
the model index in the OpenBR file will be used.
model_names (:py:class:`list`, optional): A list of strings with the model
path written in the second column of the five column score file. If not
given, the model index in the OpenBR file will be used.
.. note::
This entry is ignored in the four column score file format.
probe_names (:obj:`list`, optional): A list of probe path to be written in
the third/fourth column in the four/five column score file. If given, the
size must be identical to the number of probe templates in the OpenBR
files. If not given, the probe index in the OpenBR file will be used.
probe_names (:py:class:`list`, optional): A list of probe path to be
written in the third/fourth column in the four/five column score file. If
given, the size must be identical to the number of probe templates in the
OpenBR files. If not given, the probe index in the OpenBR file will be
used.
score_file_format (:obj:`str`, optional): One of ``('4column',
score_file_format (:py:class:`str`, optional): One of ``('4column',
'5column')``. The format, in which the ``score_file`` is; defaults to
``'4column'``
replace_nan (:obj:`float`, optional): If NaN values are encountered in the
OpenBR matrix (which are not ignored due to the mask being non-NULL),
replace_nan (:py:class:`float`, optional): If NaN values are encountered in
the OpenBR matrix (which are not ignored due to the mask being non-NULL),
this value will be written instead. If ``None``, the values will not be
written in the score file at all.
......
......@@ -15,14 +15,14 @@ def log_values(min_step = -4, counts_per_step = 4):
Parameters:
min_step (:obj:`int`, optional): The power of 10 that will be the minimum value.
E.g., the default ``-4`` will result in the first number to be
:math:`10^{-4}` = ``0.00001`` or ``0.01%``
min_step (:py:class:`int`, optional): The power of 10 that will be the
minimum value. E.g., the default ``-4`` will result in the first number
to be :math:`10^{-4}` = ``0.00001`` or ``0.01%``
counts_per_step (:obj:`int`, optional): The number of values that will be put
between two adjacent powers of 10. With the default value ``4`` (and
default values of ``min_step``), we will get ``log_list[0] == 1e-4``,
``log_list[4] == 1e-3``, ..., ``log_list[16] == 1``.
counts_per_step (:py:class:`int`, optional): The number of values that will
be put between two adjacent powers of 10. With the default value ``4``
(and default values of ``min_step``), we will get ``log_list[0] ==
1e-4``, ``log_list[4] == 1e-3``, ..., ``log_list[16] == 1``.
Returns:
......@@ -65,15 +65,15 @@ def roc(negatives, positives, npoints=100, CAR=False, **kwargs):
"positive" (signal, class) samples of your classifier. See
(:py:func:`bob.measure.roc`)
npoints (:obj:`int`, optional): The number of points for the plot. See
npoints (:py:class:`int`, optional): The number of points for the plot. See
(:py:func:`bob.measure.roc`)
CAR (:obj:`bool`, optional): If set to ``True``, it will plot the CAR over FAR in
using :py:func:`matplotlib.pyplot.semilogx`, otherwise the FAR over FRR
linearly using :py:func:`matplotlib.pyplot.plot`.
CAR (:py:class:`bool`, optional): If set to ``True``, it will plot the CAR
over FAR in using :py:func:`matplotlib.pyplot.semilogx`, otherwise the
FAR over FRR linearly using :py:func:`matplotlib.pyplot.plot`.
kwargs (:obj:`dict`, optional): Extra plotting parameters, which are passed
directly to :py:func:`matplotlib.pyplot.plot`.
kwargs (:py:class:`dict`, optional): Extra plotting parameters, which are
passed directly to :py:func:`matplotlib.pyplot.plot`.
Returns:
......@@ -123,11 +123,11 @@ def roc_for_far(negatives, positives, far_values = log_values(), **kwargs):
"positive" (signal, class) samples of your classifier. See
(:py:func:`bob.measure.roc`)
far_values (:obj:`list`, optional): The values for the FAR, where the CAR should
be plotted; each value should be in range [0,1].
far_values (:py:class:`list`, optional): The values for the FAR, where the
CAR should be plotted; each value should be in range [0,1].
kwargs (:obj:`dict`, optional): Extra plotting parameters, which are passed
directly to :py:func:`matplotlib.pyplot.plot`.
kwargs (:py:class:`dict`, optional): Extra plotting parameters, which are
passed directly to :py:func:`matplotlib.pyplot.plot`.
Returns:
......@@ -167,16 +167,15 @@ def precision_recall_curve(negatives, positives, npoints=100, **kwargs):
"negative" (noise, non-class) samples of your classifier. See
(:py:func:`bob.measure.precision_recall_curve`)
positives (array): 1D float array that contains the scores of the
"positive" (signal, class) samples of your classifier. See
(:py:func:`bob.measure.precision_recall_curve`)
npoints (:obj:`int`, optional): The number of points for the plot. See
npoints (:py:class:`int`, optional): The number of points for the plot. See
(:py:func:`bob.measure.precision_recall_curve`)
kwargs (:obj:`dict`, optional): Extra plotting parameters, which are passed
directly to :py:func:`matplotlib.pyplot.plot`.
kwargs (:py:class:`dict`, optional): Extra plotting parameters, which are
passed directly to :py:func:`matplotlib.pyplot.plot`.
Returns:
......@@ -225,7 +224,6 @@ def epc(dev_negatives, dev_positives, test_negatives, test_positives,
"negative" (noise, non-class) samples of your classifier, from the
development set. See (:py:func:`bob.measure.epc`)
dev_positives (array): 1D float array that contains the scores of the
"positive" (signal, class) samples of your classifier, from the
development set. See (:py:func:`bob.measure.epc`)
......@@ -238,11 +236,11 @@ def epc(dev_negatives, dev_positives, test_negatives, test_positives,
"positive" (signal, class) samples of your classifier, from the test set.
See (:py:func:`bob.measure.epc`)
npoints (:obj:`int`, optional): The number of points for the plot. See
npoints (:py:class:`int`, optional): The number of points for the plot. See
(:py:func:`bob.measure.epc`)
kwargs (:obj:`dict`, optional): Extra plotting parameters, which are passed
directly to :py:func:`matplotlib.pyplot.plot`.
kwargs (:py:class:`dict`, optional): Extra plotting parameters, which are
passed directly to :py:func:`matplotlib.pyplot.plot`.
Returns:
......@@ -327,14 +325,14 @@ def det(negatives, positives, npoints=100, axisfontsize='x-small', **kwargs):
"positive" (signal, class) samples of your classifier. See
(:py:func:`bob.measure.det`)
npoints (:obj:`int`, optional): The number of points for the plot. See
npoints (:py:class:`int`, optional): The number of points for the plot. See
(:py:func:`bob.measure.det`)
axisfontsize (:obj:`str`, optional): The size to be used by x/y-tick-labels to set
the font size on the axis
axisfontsize (:py:class:`str`, optional): The size to be used by
x/y-tick-labels to set the font size on the axis
kwargs (:obj:`dict`, optional): Extra plotting parameters, which are passed
directly to :py:func:`matplotlib.pyplot.plot`.
kwargs (:py:class:`dict`, optional): Extra plotting parameters, which are
passed directly to :py:func:`matplotlib.pyplot.plot`.
Returns:
......@@ -399,14 +397,14 @@ def det_axis(v, **kwargs):
Parameters:
v (list, tuple): A sequence contaiing the X and Y limits in the order
``(xmin, xmax, ymin, ymax)``. Expected values should be in percentage
(between 0 and 100%). If ``v`` is not a list or tuple that contains 4
numbers it is passed without further inspection to
:py:func:`matplotlib.pyplot.axis`.
v (:py:class:`list`, :py:class:`tuple`): A sequence contaiing the X and Y
limits in the order ``(xmin, xmax, ymin, ymax)``. Expected values should
be in percentage (between 0 and 100%). If ``v`` is not a list or tuple
that contains 4 numbers it is passed without further inspection to
:py:func:`matplotlib.pyplot.axis`.
kwargs (:obj:`dict`, optional): Extra plotting parameters, which are passed
directly to :py:func:`matplotlib.pyplot.axis`.
kwargs (:py:class:`dict`, optional): Extra plotting parameters, which are
passed directly to :py:func:`matplotlib.pyplot.axis`.
Returns:
......@@ -465,12 +463,12 @@ def cmc(cmc_scores, logx = True, **kwargs):
cmc_scores (array): 1D float array containing the CMC values (See
:py:func:`bob.measure.cmc`)
logx (:obj:`bool`, optional): If set (the default), plots the rank axis in
logarithmic scale using :py:func:`matplotlib.pyplot.semilogx` or in
linear scale using :py:func:`matplotlib.pyplot.plot`
logx (:py:class:`bool`, optional): If set (the default), plots the rank
axis in logarithmic scale using :py:func:`matplotlib.pyplot.semilogx` or
in linear scale using :py:func:`matplotlib.pyplot.plot`
kwargs (:obj:`dict`, optional): Extra plotting parameters, which are passed
directly to :py:func:`matplotlib.pyplot.plot`.
kwargs (:py:class:`dict`, optional): Extra plotting parameters, which are
passed directly to :py:func:`matplotlib.pyplot.plot`.
Returns:
......@@ -515,17 +513,18 @@ def detection_identification_curve(cmc_scores, far_values = log_values(), rank
cmc_scores (array): 1D float array containing the CMC values (See
:py:func:`bob.measure.cmc`)
rank (:obj:`int`, optional): The rank for which the curve should be plotted
rank (:py:class:`int`, optional): The rank for which the curve should be
plotted
far_values (:obj:`list`, optional): The values for the FAR, where the CAR should
be plotted; each value should be in range [0,1].
far_values (:py:class:`list`, optional): The values for the FAR, where the
CAR should be plotted; each value should be in range [0,1].
logx (:obj:`bool`, optional): If set (the default), plots the rank axis in
logarithmic scale using :py:func:`matplotlib.pyplot.semilogx` or in
linear scale using :py:func:`matplotlib.pyplot.plot`
logx (:py:class:`bool`, optional): If set (the default), plots the rank
axis in logarithmic scale using :py:func:`matplotlib.pyplot.semilogx` or
in linear scale using :py:func:`matplotlib.pyplot.plot`
kwargs (:obj:`dict`, optional): Extra plotting parameters, which are passed
directly to :py:func:`matplotlib.pyplot.plot`.
kwargs (:py:class:`dict`, optional): Extra plotting parameters, which are
passed directly to :py:func:`matplotlib.pyplot.plot`.
Returns:
......
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