Skip to content
Snippets Groups Projects
Commit 4156bbf4 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[data] Added missing doc and fixed doc related warnings

Also fixed import warnings
parent 3f24f857
No related branches found
No related tags found
2 merge requests!17Merge development branch 1.5.x,!13Improve documentation
...@@ -26,33 +26,38 @@ ...@@ -26,33 +26,38 @@
############################################################################### ###############################################################################
"""Data I/O classes and functions""" """
====
data
====
Data I/O classes and functions
"""
import os import os
import re import re
import glob import glob
import simplejson as json import simplejson as json
import select
import time import time
import tempfile
import abc import abc
import zmq import zmq
import logging
import six
from functools import reduce from functools import reduce
from collections import namedtuple from collections import namedtuple
import logging
logger = logging.getLogger(__name__)
import six
from .hash import hashFileContents from .hash import hashFileContents
from .dataformat import DataFormat from .dataformat import DataFormat
from .algorithm import Algorithm from .algorithm import Algorithm
logger = logging.getLogger(__name__)
# ---------------------------------------------------------- # ----------------------------------------------------------
class RemoteException(Exception): class RemoteException(Exception):
"""Exception happening on a remote location"""
def __init__(self, kind, message): def __init__(self, kind, message):
super(RemoteException, self).__init__() super(RemoteException, self).__init__()
...@@ -150,8 +155,8 @@ def getAllFilenames(filename, start_index=None, end_index=None): ...@@ -150,8 +155,8 @@ def getAllFilenames(filename, start_index=None, end_index=None):
Returns: Returns:
(data_filenames, indices_filenames, data_checksum_filenames, indices_checksum_filenames) (data_filenames, indices_filenames,
data_checksum_filenames, indices_checksum_filenames)
""" """
index_re = re.compile(r'^.*\.(\d+)\.(\d+)\.(data|index)(.checksum)?$') index_re = re.compile(r'^.*\.(\d+)\.(\d+)\.(data|index)(.checksum)?$')
...@@ -360,8 +365,8 @@ class CachedDataSource(DataSource): ...@@ -360,8 +365,8 @@ class CachedDataSource(DataSource):
3. Contiguous indices if they are present 3. Contiguous indices if they are present
""" """
# Make sure that we have a perfect match between data files and checksum # Make sure that we have a perfect match between data files and
# files # checksum files
checksum_filenames_noext = [os.path.splitext(f)[0] for f in checksum_filenames] checksum_filenames_noext = [os.path.splitext(f)[0] for f in checksum_filenames]
if data_filenames != checksum_filenames_noext: if data_filenames != checksum_filenames_noext:
...@@ -777,10 +782,13 @@ class DataSink(object): ...@@ -777,10 +782,13 @@ class DataSink(object):
@abc.abstractmethod @abc.abstractmethod
def isConnected(self): def isConnected(self):
pass """Returns whether the data sink is connected"""
pass
def close(self): def close(self):
"""Closes the data sink"""
pass pass
...@@ -867,12 +875,12 @@ class CachedDataSink(DataSink): ...@@ -867,12 +875,12 @@ class CachedDataSink(DataSink):
filename (str): Name of the file to generate filename (str): Name of the file to generate
dataformat (dataformat.DataFormat): The dataformat to be used dataformat (dataformat.DataFormat): The dataformat to be used
inside this file. All objects stored inside this file will respect that inside this file. All objects stored inside this file will respect
format. that format.
encoding (str): String defining the encoding to be used for encoding the encoding (str): String defining the encoding to be used for encoding
data. Only a few options are supported: ``binary`` (the default) or the data. Only a few options are supported: ``binary``
``json`` (debugging purposes). (the default) or ``json`` (debugging purposes).
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment