Skip to content
Snippets Groups Projects
Commit 6298fa61 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

compromise for Sphinx

parent 28768e34
No related branches found
No related tags found
1 merge request!82Add a function to read features with generators
Pipeline #
import os import os
import tempfile import tempfile
import tarfile import tarfile
try: # this is needed for the sphinx documentation import collections # this is needed for the sphinx documentation
from collections.abc import Callable, Iterable
except ImportError:
from collections import Callable, Iterable
import functools # this is needed for the sphinx documentation import functools # this is needed for the sphinx documentation
import numpy import numpy
import logging import logging
...@@ -185,9 +182,9 @@ def _generate_features(reader, paths): ...@@ -185,9 +182,9 @@ def _generate_features(reader, paths):
Parameters Parameters
---------- ----------
reader : Callable reader : ``collections.Callable``
See the documentation of :py:func:`vstack_features`. See the documentation of :py:func:`vstack_features`.
paths : Iterable paths : ``collections.Iterable``
See the documentation of :py:func:`vstack_features`. See the documentation of :py:func:`vstack_features`.
Yields Yields
...@@ -273,14 +270,14 @@ def vstack_features(reader, paths, same_size=False): ...@@ -273,14 +270,14 @@ def vstack_features(reader, paths, same_size=False):
Parameters Parameters
---------- ----------
reader : Callable reader : ``collections.Callable``
The function to load the features. The function should only take one The function to load the features. The function should only take one
argument being the path to the features. Use argument being the path to the features. Use
:any:`functools.partial` to accommodate your reader to this format. :any:`functools.partial` to accommodate your reader to this format.
The features returned by ``reader`` are expected to have the same The features returned by ``reader`` are expected to have the same
:py:class:`numpy.dtype` and the same shape except for their first :py:class:`numpy.dtype` and the same shape except for their first
dimension. First dimension is should correspond to the number of samples. dimension. First dimension is should correspond to the number of samples.
paths : Iterable paths : ``collections.Iterable``
An iterable of paths to iterate on. Whatever is inside path is given to An iterable of paths to iterate on. Whatever is inside path is given to
``reader``. If ``same_size`` is ``True``, ``len(paths)`` must be valid. ``reader``. If ``same_size`` is ``True``, ``len(paths)`` must be valid.
same_size : :obj:`bool`, optional same_size : :obj:`bool`, optional
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment