diff --git a/.buildinfo b/.buildinfo index 54ce768..aae71e2 100644 --- a/.buildinfo +++ b/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 2d43c1f82fcb0b5b080ccbe82c1a6df5 +config: a5b20a9794c7e6a5f2c6c6d8fe8a932e tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/FAQ.html b/FAQ.html index a38abdd..2e846d9 100644 --- a/FAQ.html +++ b/FAQ.html @@ -1,24 +1,35 @@ - - +
- - + + - + -- © Copyright 2011–2022, PyTables maintainers + © Copyright 2011–2022, PyTables maintainers.
- © Copyright 2011–2022, PyTables maintainers + © Copyright 2011–2022, PyTables maintainers.
pt2to3
help:
usage: pt2to3 [-h] [-r] [-p] [-o OUTPUT] [-i] filename
+usage: pt2to3 [-h] [-r] [-p] [-o OUTPUT] [-i] filename
-PyTables 2.x -> 3.x API transition tool This tool displays to standard out, so
-it is common to pipe this to another file: $ pt2to3 oldfile.py > newfile.py
+PyTables 2.x -> 3.x API transition tool This tool displays to standard out, so
+it is common to pipe this to another file: $ pt2to3 oldfile.py > newfile.py
-positional arguments:
- filename path to input file.
+positional arguments:
+ filename path to input file.
-optional arguments:
- -h, --help show this help message and exit
- -r, --reverse reverts changes, going from 3.x -> 2.x.
- -p, --no-ignore-previous
- ignores previous_api() calls.
- -o OUTPUT output file to write to.
- -i, --inplace overwrites the file in-place.
+optional arguments:
+ -h, --help show this help message and exit
+ -r, --reverse reverts changes, going from 3.x -> 2.x.
+ -p, --no-ignore-previous
+ ignores previous_api() calls.
+ -o OUTPUT output file to write to.
+ -i, --inplace overwrites the file in-place.
Note that pt2to3
only works on a single file, not a directory. However,
a simple BASH script may be written to run pt2to3
over an entire directory
and all sub-directories:
#!/bin/bash
-for f in $(find .)
+for f in $(find .)
do
- echo $f
- pt2to3 $f > temp.txt
- mv temp.txt $f
+ echo $f
+ pt2to3 $f > temp.txt
+ mv temp.txt $f
done
@@ -1559,29 +1568,29 @@ PEP 8 Compliance
-
- Next
-
-
- Previous
-
+ Next
+ Previous
- © Copyright 2011–2022, PyTables maintainers + © Copyright 2011–2022, PyTables maintainers.
[docs]class Array(hdf5extension.Array, Leaf):
- """This class represents homogeneous datasets in an HDF5 file.
+ """This class represents homogeneous datasets in an HDF5 file.
This class provides methods to write or read data to or from array objects
in the file. This class does not allow you neither to enlarge nor compress
@@ -261,12 +270,12 @@ Source code for tables.array
@lazyattr
def dtype(self):
- """The NumPy ``dtype`` that most closely matches this array."""
+ """The NumPy ``dtype`` that most closely matches this array."""
return self.atom.dtype
@property
def nrows(self):
- """The number of rows in the array."""
+ """The number of rows in the array."""
if self.shape == ():
return SizeType(1) # scalar case
else:
@@ -274,7 +283,7 @@ Source code for tables.array
@property
def rowsize(self):
- """The size of the rows in bytes in dimensions orthogonal to
+ """The size of the rows in bytes in dimensions orthogonal to
*maindim*."""
maindim = self.maindim
rowsize = self.atom.size
@@ -285,7 +294,7 @@ Source code for tables.array
@property
def size_in_memory(self):
- """The size of this array's data in bytes when it is fully loaded into
+ """The size of this array's data in bytes when it is fully loaded into
memory."""
return self.nrows * self.rowsize
@@ -295,13 +304,13 @@ Source code for tables.array
track_times=True):
self._v_version = None
- """The object version of this array."""
+ """The object version of this array."""
self._v_new = new = obj is not None
- """Is this the first time the node has been created?"""
+ """Is this the first time the node has been created?"""
self._v_new_title = title
- """New title for this node."""
+ """New title for this node."""
self._obj = obj
- """The object to be stored in the array. It can be any of numpy,
+ """The object to be stored in the array. It can be any of numpy,
list, tuple, string, integer of floating point types, provided
that they are regular (i.e. they are not like ``[[1, 2], 2]``).
@@ -311,46 +320,46 @@ Source code for tables.array
"""
self._v_convert = True
- """Whether the ``Array`` object must be converted or not."""
+ """Whether the ``Array`` object must be converted or not."""
# Miscellaneous iteration rubbish.
self._start = None
- """Starting row for the current iteration."""
+ """Starting row for the current iteration."""
self._stop = None
- """Stopping row for the current iteration."""
+ """Stopping row for the current iteration."""
self._step = None
- """Step size for the current iteration."""
+ """Step size for the current iteration."""
self._nrowsread = None
- """Number of rows read up to the current state of iteration."""
+ """Number of rows read up to the current state of iteration."""
self._startb = None
- """Starting row for current buffer."""
+ """Starting row for current buffer."""
self._stopb = None
- """Stopping row for current buffer. """
+ """Stopping row for current buffer. """
self._row = None
- """Current row in iterators (sentinel)."""
+ """Current row in iterators (sentinel)."""
self._init = False
- """Whether we are in the middle of an iteration or not (sentinel)."""
+ """Whether we are in the middle of an iteration or not (sentinel)."""
self.listarr = None
- """Current buffer in iterators."""
+ """Current buffer in iterators."""
# Documented (*public*) attributes.
self.atom = _atom
- """An Atom (see :ref:`AtomClassDescr`) instance representing the *type*
+ """An Atom (see :ref:`AtomClassDescr`) instance representing the *type*
and *shape* of the atomic objects to be saved.
"""
self.shape = None
- """The shape of the stored array."""
+ """The shape of the stored array."""
self.nrow = None
- """On iterators, this is the index of the current row."""
+ """On iterators, this is the index of the current row."""
self.extdim = -1 # ordinary arrays are not enlargeable
- """The index of the enlargeable dimension."""
+ """The index of the enlargeable dimension."""
# Ordinary arrays have no filters: leaf is created with default ones.
super().__init__(parentnode, name, new, Filters(), byteorder, _log,
track_times)
def _g_create(self):
- """Save a new array in file."""
+ """Save a new array in file."""
self._v_version = obversion
try:
@@ -393,7 +402,7 @@ Source code for tables.array
return self._v_objectid
def _g_open(self):
- """Get the metadata info for an array in file."""
+ """Get the metadata info for an array in file."""
(oid, self.atom, self.shape, self._v_chunkshape) = self._open_array()
@@ -402,7 +411,7 @@ Source code for tables.array
return oid
[docs] def get_enum(self):
- """Get the enumerated type associated with this array.
+ """Get the enumerated type associated with this array.
If this array is of an enumerated type, the corresponding Enum instance
(see :ref:`EnumClassDescr`) is returned. If it is not of an enumerated
@@ -417,7 +426,7 @@ Source code for tables.array
return self.atom.enum
[docs] def iterrows(self, start=None, stop=None, step=None):
- """Iterate over the rows of the array.
+ """Iterate over the rows of the array.
This method returns an iterator yielding an object of the current
flavor for each selected row in the array. The returned rows are taken
@@ -452,7 +461,7 @@ Source code for tables.array
return self
[docs] def __iter__(self):
- """Iterate over the rows of the array.
+ """Iterate over the rows of the array.
This is equivalent to calling :meth:`Array.iterrows` with default
arguments, i.e. it iterates over *all the rows* in the array.
@@ -480,7 +489,7 @@ Source code for tables.array
return self
def _init_loop(self):
- """Initialization for the __iter__ iterator."""
+ """Initialization for the __iter__ iterator."""
self._nrowsread = self._start
self._startb = self._start
@@ -489,7 +498,7 @@ Source code for tables.array
self.nrow = SizeType(self._start - self._step) # row number
[docs] def __next__(self):
- """Get the next element of the array during an iteration.
+ """Get the next element of the array during an iteration.
The element is returned as an object of the current flavor.
@@ -526,7 +535,7 @@ Source code for tables.array
return self.listarr # Scalar case
def _interpret_indexing(self, keys):
- """Internal routine used by __getitem__ and __setitem__"""
+ """Internal routine used by __getitem__ and __setitem__"""
maxlen = len(self.shape)
shape = (maxlen,)
@@ -593,7 +602,7 @@ Source code for tables.array
return startl, stopl, stepl, shape
def _fancy_selection(self, args):
- """Performs a NumPy-style fancy selection in `self`.
+ """Performs a NumPy-style fancy selection in `self`.
Implements advanced NumPy-style selection operations in
addition to the standard slice-and-int behavior.
@@ -607,7 +616,7 @@ Source code for tables.array
# Internal functions
def validate_number(num, length):
- """Validate a list member for the given axis length."""
+ """Validate a list member for the given axis length."""
try:
num = int(num)
@@ -617,7 +626,7 @@ Source code for tables.array
raise IndexError("Index out of bounds: %d" % num)
def expand_ellipsis(args, rank):
- """Expand ellipsis objects and fill in missing axes."""
+ """Expand ellipsis objects and fill in missing axes."""
n_el = sum(1 for arg in args if arg is Ellipsis)
if n_el > 1:
@@ -639,7 +648,7 @@ Source code for tables.array
return final_args
def translate_slice(exp, length):
- """Given a slice object, return a 3-tuple (start, count, step)
+ """Given a slice object, return a 3-tuple (start, count, step)
This is for for use with the hyperslab selection routines.
@@ -768,7 +777,7 @@ Source code for tables.array
return selection, reorder, mshape
[docs] def __getitem__(self, key):
- """Get a row, a range of rows or a slice from the array.
+ """Get a row, a range of rows or a slice from the array.
The set of tokens allowed for the key is the same as that for extended
slicing in Python (including the Ellipsis or ... token). The result is
@@ -816,7 +825,7 @@ Source code for tables.array
return internal_to_flavor(arr, self.flavor)
[docs] def __setitem__(self, key, value):
- """Set a row, a range of rows or a slice in the array.
+ """Set a row, a range of rows or a slice in the array.
It takes different actions depending on the type of the key parameter:
if it is an integer, the corresponding array row is set to value (the
@@ -878,7 +887,7 @@ Source code for tables.array
self._write_selection(selection, reorder, shape, nparr)
def _check_shape(self, nparr, slice_shape):
- """Test that nparr shape is consistent with underlying object.
+ """Test that nparr shape is consistent with underlying object.
If not, try creating a new nparr object, using broadcasting if
necessary.
@@ -897,7 +906,7 @@ Source code for tables.array
return nparr
def _read_slice(self, startl, stopl, stepl, shape):
- """Read a slice based on `startl`, `stopl` and `stepl`."""
+ """Read a slice based on `startl`, `stopl` and `stepl`."""
nparr = np.empty(dtype=self.atom.dtype, shape=shape)
# Protection against reading empty arrays
@@ -910,7 +919,7 @@ Source code for tables.array
return nparr
def _read_coords(self, coords):
- """Read a set of points defined by `coords`."""
+ """Read a set of points defined by `coords`."""
nparr = np.empty(dtype=self.atom.dtype, shape=len(coords))
if len(coords) > 0:
@@ -921,7 +930,7 @@ Source code for tables.array
return nparr
def _read_selection(self, selection, reorder, shape):
- """Read a `selection`.
+ """Read a `selection`.
Reorder if necessary.
@@ -945,21 +954,21 @@ Source code for tables.array
return nparr
def _write_slice(self, startl, stopl, stepl, shape, nparr):
- """Write `nparr` in a slice based on `startl`, `stopl` and `stepl`."""
+ """Write `nparr` in a slice based on `startl`, `stopl` and `stepl`."""
nparr = self._check_shape(nparr, tuple(shape))
countl = ((stopl - startl - 1) // stepl) + 1
self._g_write_slice(startl, stepl, countl, nparr)
def _write_coords(self, coords, nparr):
- """Write `nparr` values in points defined by `coords` coordinates."""
+ """Write `nparr` values in points defined by `coords` coordinates."""
if len(coords) > 0:
nparr = self._check_shape(nparr, (len(coords),))
self._g_write_coords(coords, nparr)
def _write_selection(self, selection, reorder, shape, nparr):
- """Write `nparr` in `selection`.
+ """Write `nparr` in `selection`.
Reorder if necessary.
@@ -977,7 +986,7 @@ Source code for tables.array
self._g_write_selection(selection, nparr)
def _read(self, start, stop, step, out=None):
- """Read the array from disk without slice or flavor processing."""
+ """Read the array from disk without slice or flavor processing."""
nrowstoread = len(range(start, stop, step))
shape = list(self.shape)
@@ -1006,7 +1015,7 @@ Source code for tables.array
return arr
[docs] def read(self, start=None, stop=None, step=None, out=None):
- """Get data in the array as an object of the current flavor.
+ """Get data in the array as an object of the current flavor.
The start, stop and step parameters can be used to select only a
*range of rows* in the array. Their meanings are the same as in
@@ -1045,7 +1054,7 @@ Source code for tables.array
def _g_copy_with_stats(self, group, name, start, stop, step,
title, filters, chunkshape, _log, **kwargs):
- """Private part of Leaf.copy() for each kind of leaf."""
+ """Private part of Leaf.copy() for each kind of leaf."""
# Compute the correct indices.
(start, stop, step) = self._process_range_read(start, stop, step)
@@ -1066,18 +1075,18 @@ Source code for tables.array
return (object_, nbytes)
def __repr__(self):
- """This provides more metainfo in addition to standard __str__"""
+ """This provides more metainfo in addition to standard __str__"""
- return f"""{self}
- atom := {self.atom!r}
- maindim := {self.maindim!r}
- flavor := {self.flavor!r}
- byteorder := {self.byteorder!r}
+ return f"""{self}
+ atom := {self.atom!r}
+ maindim := {self.maindim!r}
+ flavor := {self.flavor!r}
+ byteorder := {self.byteorder!r}
chunkshape := {self.chunkshape!r}"""
class ImageArray(Array):
- """Array containing an image.
+ """Array containing an image.
This class has no additional behaviour or functionality compared to
that of an ordinary array. It simply enables the user to open an
@@ -1093,20 +1102,25 @@ Source code for tables.array
-
@@ -1115,7 +1129,6 @@ Source code for tables.array
-
+
+
+
@@ -26,17 +37,11 @@
+
-
-
-
-
-
-
-
@@ -77,7 +82,7 @@
- 3.8.0
+ 3.8.1.dev0
@@ -94,6 +99,7 @@
+
@@ -117,6 +123,7 @@
+
@@ -151,11 +158,13 @@
+
+
- - Docs »
+ - »
- Module code »
@@ -212,7 +221,7 @@ Source code for tables.atom
[docs]def split_type(type):
- """Split a PyTables type into a PyTables kind and an item size.
+ """Split a PyTables type into a PyTables kind and an item size.
Returns a tuple of (kind, itemsize). If no item size is present in the type
(in the form of a precision), the returned item size is None::
@@ -254,7 +263,7 @@ Source code for tables.atom
def _abstract_atom_init(deftype, defvalue):
- """Return a constructor for an abstract `Atom` class."""
+ """Return a constructor for an abstract `Atom` class."""
defitemsize = split_type(deftype)[1]
@@ -271,7 +280,7 @@ Source code for tables.atom
def _normalize_shape(shape):
- """Check that the `shape` is safe to be used and return it as a tuple."""
+ """Check that the `shape` is safe to be used and return it as a tuple."""
if isinstance(shape, (np.integer, int)):
if shape < 1:
@@ -294,7 +303,7 @@ Source code for tables.atom
def _normalize_default(value, dtype):
- """Return `value` as a valid default of NumPy type `dtype`."""
+ """Return `value` as a valid default of NumPy type `dtype`."""
# Create NumPy objects as defaults
# This is better in order to serialize them as attributes
@@ -317,7 +326,7 @@ Source code for tables.atom
def _cmp_dispatcher(other_method_name):
- """Dispatch comparisons to a method of the *other* object.
+ """Dispatch comparisons to a method of the *other* object.
Returns a new *rich comparison* method which dispatches calls to
the method `other_method_name` of the *other* object. If there is
@@ -336,7 +345,7 @@ Source code for tables.atom
class MetaAtom(type):
- """Atom metaclass.
+ """Atom metaclass.
This metaclass ensures that data about atom classes gets inserted
into the suitable registries.
@@ -372,7 +381,7 @@ Source code for tables.atom
[docs]class Atom(metaclass=MetaAtom):
- """Defines the type of atomic cells stored in a dataset.
+ """Defines the type of atomic cells stored in a dataset.
The meaning of *atomic* is that individual elements of a cell can
not be extracted directly by indexing (i.e. __getitem__()) the
@@ -468,13 +477,13 @@ Source code for tables.atom
@classmethod
def prefix(cls):
- """Return the atom class prefix."""
+ """Return the atom class prefix."""
cname = cls.__name__
return cname[:cname.rfind('Atom')]
[docs] @classmethod
def from_sctype(cls, sctype, shape=(), dflt=None):
- """Create an Atom from a NumPy scalar type sctype.
+ """Create an Atom from a NumPy scalar type sctype.
Optional shape and default value may be specified as the
shape and dflt
@@ -501,7 +510,7 @@ Source code for tables.atom
[docs] @classmethod
def from_dtype(cls, dtype, dflt=None):
- """Create an Atom from a NumPy dtype.
+ """Create an Atom from a NumPy dtype.
An optional default value may be specified as the dflt
argument. Information in the dtype not represented in an Atom is
@@ -548,7 +557,7 @@ Source code for tables.atom
[docs] @classmethod
def from_type(cls, type, shape=(), dflt=None):
- """Create an Atom from a PyTables type.
+ """Create an Atom from a PyTables type.
Optional shape and default value may be specified as the
shape and dflt arguments, respectively::
@@ -575,7 +584,7 @@ Source code for tables.atom
[docs] @classmethod
def from_kind(cls, kind, itemsize=None, shape=(), dflt=None):
- """Create an Atom from a PyTables kind.
+ """Create an Atom from a PyTables kind.
Optional item size, shape and default value may be
specified as the itemsize, shape and dflt
@@ -643,17 +652,17 @@ Source code for tables.atom
@property
def size(self):
- """Total size in bytes of the atom."""
+ """Total size in bytes of the atom."""
return self.dtype.itemsize
@property
def recarrtype(self):
- """String type to be used in numpy.rec.array()."""
+ """String type to be used in numpy.rec.array()."""
return str(self.dtype.shape) + self.dtype.base.str[1:]
@property
def ndim(self):
- """The number of dimensions of the atom.
+ """The number of dimensions of the atom.
.. versionadded:: 2.4"""
return len(self.shape)
@@ -664,14 +673,14 @@ Source code for tables.atom
"please use one of its subclasses"
% self.__class__.__name__)
self.shape = shape = _normalize_shape(shape)
- """The shape of the atom (a tuple for scalar atoms)."""
+ """The shape of the atom (a tuple for scalar atoms)."""
# Curiously enough, NumPy isn't generally able to accept NumPy
# integers in a shape. ;(
npshape = tuple(int(s) for s in shape)
self.dtype = dtype = np.dtype((nptype, npshape))
- """The NumPy dtype that most closely matches this atom."""
+ """The NumPy dtype that most closely matches this atom."""
self.dflt = _normalize_default(dflt, dtype)
- """The default value of the atom.
+ """The default value of the atom.
If the user does not supply a value for an element while
filling a dataset, this default value will be written to
@@ -700,7 +709,7 @@ Source code for tables.atom
# self.dflt))
[docs] def copy(self, **override):
- """Get a copy of the atom, possibly overriding some arguments.
+ """Get a copy of the atom, possibly overriding some arguments.
Constructor arguments to be overridden must be passed as
keyword arguments::
@@ -727,7 +736,7 @@ Source code for tables.atom
return self.__class__(**newargs)
def _get_init_args(self):
- """Get a dictionary of instance constructor arguments.
+ """Get a dictionary of instance constructor arguments.
This implementation works on classes which use the same names
for both constructor arguments and instance attributes.
@@ -741,7 +750,7 @@ Source code for tables.atom
return {arg: getattr(self, arg) for arg in args if arg != 'self'}
def _is_equal_to_atom(self, atom):
- """Is this object equal to the given `atom`?"""
+ """Is this object equal to the given `atom`?"""
return (self.type == atom.type and self.shape == atom.shape
and self.itemsize == atom.itemsize
@@ -749,7 +758,7 @@ Source code for tables.atom
[docs]class StringAtom(Atom):
- """Defines an atom of type string.
+ """Defines an atom of type string.
The item size is the *maximum* length in characters of strings.
@@ -761,7 +770,7 @@ Source code for tables.atom
@property
def itemsize(self):
- """Size in bytes of a sigle item in the atom."""
+ """Size in bytes of a sigle item in the atom."""
return self.dtype.base.itemsize
def __init__(self, itemsize, shape=(), dflt=_defvalue):
@@ -773,7 +782,7 @@ Source code for tables.atom
[docs]class BoolAtom(Atom):
- """Defines an atom of type bool."""
+ """Defines an atom of type bool."""
kind = 'bool'
itemsize = 1
@@ -786,7 +795,7 @@ Source code for tables.atom
[docs]class IntAtom(Atom):
- """Defines an atom of a signed integral type (int kind)."""
+ """Defines an atom of a signed integral type (int kind)."""
kind = 'int'
signed = True
@@ -796,7 +805,7 @@ Source code for tables.atom
[docs]class UIntAtom(Atom):
- """Defines an atom of an unsigned integral type (uint kind)."""
+ """Defines an atom of an unsigned integral type (uint kind)."""
kind = 'uint'
signed = False
@@ -806,7 +815,7 @@ Source code for tables.atom
[docs]class FloatAtom(Atom):
- """Defines an atom of a floating point type (float kind)."""
+ """Defines an atom of a floating point type (float kind)."""
kind = 'float'
_deftype = 'float64'
@@ -815,7 +824,7 @@ Source code for tables.atom
def _create_numeric_class(baseclass, itemsize):
- """Create a numeric atom class with the given `baseclass` and an
+ """Create a numeric atom class with the given `baseclass` and an
`itemsize`."""
prefix = '%s%d' % (baseclass.prefix(), itemsize * 8)
@@ -849,7 +858,7 @@ Source code for tables.atom
[docs]class ComplexAtom(Atom):
- """Defines an atom of kind complex.
+ """Defines an atom of kind complex.
Allowed item sizes are 8 (single precision) and 16 (double precision). This
class must be used instead of more concrete ones to avoid confusions with
@@ -870,7 +879,7 @@ Source code for tables.atom
@property
def itemsize(self):
- """Size in bytes of a sigle item in the atom."""
+ """Size in bytes of a sigle item in the atom."""
return self.dtype.base.itemsize
# Only instances have a `type` attribute, so complex types must be
@@ -892,7 +901,7 @@ Source code for tables.atom
class _ComplexErrorAtom(ComplexAtom, metaclass=type):
- """Reminds the user to stop using the old complex atom names."""
+ """Reminds the user to stop using the old complex atom names."""
def __init__(self, shape=(), dflt=ComplexAtom._defvalue):
raise TypeError(
@@ -910,7 +919,7 @@ Source code for tables.atom
class TimeAtom(Atom):
- """Defines an atom of time type (time kind).
+ """Defines an atom of time type (time kind).
There are two distinct supported types of time: a 32 bit integer value and
a 64 bit floating point value. Both of them reflect the number of seconds
@@ -926,7 +935,7 @@ Source code for tables.atom
[docs]class Time32Atom(TimeAtom):
- """Defines an atom of type time32."""
+ """Defines an atom of type time32."""
itemsize = 4
type = 'time32'
@@ -937,7 +946,7 @@ Source code for tables.atom
[docs]class Time64Atom(TimeAtom):
- """Defines an atom of type time64."""
+ """Defines an atom of type time64."""
itemsize = 8
type = 'time64'
@@ -948,7 +957,7 @@ Source code for tables.atom
[docs]class EnumAtom(Atom):
- """Description of an atom of an enumerated type.
+ """Description of an atom of an enumerated type.
Instances of this class describe the atom type used to store enumerated
values. Those values belong to an enumerated type, defined by the first
@@ -1044,11 +1053,11 @@ Source code for tables.atom
@property
def itemsize(self):
- """Size in bytes of a single item in the atom."""
+ """Size in bytes of a single item in the atom."""
return self.dtype.base.itemsize
def _checkbase(self, base):
- """Check the `base` storage atom."""
+ """Check the `base` storage atom."""
if base.kind == 'enum':
raise TypeError("can not use an enumerated atom "
@@ -1083,18 +1092,18 @@ Source code for tables.atom
"are supported for the moment, sorry")
def _get_init_args(self):
- """Get a dictionary of instance constructor arguments."""
+ """Get a dictionary of instance constructor arguments."""
return dict(enum=self.enum, dflt=self._defname,
base=self.base, shape=self.shape)
def _is_equal_to_atom(self, atom):
- """Is this object equal to the given `atom`?"""
+ """Is this object equal to the given `atom`?"""
return False
def _is_equal_to_enumatom(self, enumatom):
- """Is this object equal to the given `enumatom`?"""
+ """Is this object equal to the given `enumatom`?"""
return (self.enum == enumatom.enum and self.shape == enumatom.shape
and np.all(self.dflt == enumatom.dflt)
@@ -1140,7 +1149,7 @@ Source code for tables.atom
class ReferenceAtom(Atom):
- """Defines an atom of type object to read references.
+ """Defines an atom of type object to read references.
This atom is read-only.
"""
@@ -1151,7 +1160,7 @@ Source code for tables.atom
@property
def itemsize(self):
- """Size in bytes of a single item in the atom."""
+ """Size in bytes of a single item in the atom."""
return self.dtype.base.itemsize
def __init__(self, shape=()):
@@ -1180,7 +1189,7 @@ Source code for tables.atom
class PseudoAtom:
- """Pseudo-atoms can only be used in ``VLArray`` nodes.
+ """Pseudo-atoms can only be used in ``VLArray`` nodes.
They can be recognised because they also have `kind`, `type` and
`shape` attributes, but no `size`, `itemsize` or `dflt` ones.
@@ -1192,18 +1201,18 @@ Source code for tables.atom
return '%s()' % self.__class__.__name__
def toarray(self, object_):
- """Convert an `object_` into an array of base atoms."""
+ """Convert an `object_` into an array of base atoms."""
raise NotImplementedError
def fromarray(self, array):
- """Convert an `array` of base atoms into an object."""
+ """Convert an `array` of base atoms into an object."""
raise NotImplementedError
class _BufferedAtom(PseudoAtom):
- """Pseudo-atom which stores data as a buffer (flat array of uints)."""
+ """Pseudo-atom which stores data as a buffer (flat array of uints)."""
shape = ()
@@ -1214,13 +1223,13 @@ Source code for tables.atom
return array
def _tobuffer(self, object_):
- """Convert an `object_` into a buffer."""
+ """Convert an `object_` into a buffer."""
raise NotImplementedError
[docs]class VLStringAtom(_BufferedAtom):
- """Defines an atom of type ``vlstring``.
+ """Defines an atom of type ``vlstring``.
This class describes a *row* of the VLArray class, rather than an atom. It
differs from the StringAtom class in that you can only add *one instance of
@@ -1262,7 +1271,7 @@ Source code for tables.atom
[docs]class VLUnicodeAtom(_BufferedAtom):
- """Defines an atom of type vlunicode.
+ """Defines an atom of type vlunicode.
This class describes a *row* of the VLArray class, rather than an atom. It
is very similar to VLStringAtom (see :ref:`VLStringAtom`), but it stores
@@ -1321,7 +1330,7 @@ Source code for tables.atom
[docs]class ObjectAtom(_BufferedAtom):
- """Defines an atom of type object.
+ """Defines an atom of type object.
This class is meant to fit *any* kind of Python object in a row of a
VLArray dataset by using pickle behind the scenes. Due to the fact that
@@ -1356,20 +1365,25 @@ Source code for tables.atom
-
@@ -1378,7 +1392,6 @@ Source code for tables.atom
-
+
+
+
@@ -26,17 +37,11 @@
+
-
-
-
-
-
-
-
@@ -77,7 +82,7 @@
- 3.8.0
+ 3.8.1.dev0
@@ -94,6 +99,7 @@
+
@@ -117,6 +123,7 @@
+
@@ -151,11 +158,13 @@
+
+
- - Docs »
+ - »
- Module code »
@@ -178,7 +187,6 @@ Source code for tables.attributeset
"""Here is defined the AttributeSet class."""
import re
-import sys
import warnings
import pickle
import numpy as np
@@ -186,7 +194,7 @@ Source code for tables.attributeset
from . import hdf5extension
from .utils import SizeType
from .registry import class_name_dict
-from .exceptions import ClosedNodeError, PerformanceWarning
+from .exceptions import ClosedNodeError, FiltersWarning, PerformanceWarning
from .path import check_attribute_name
from .undoredo import attr_to_shadow
from .filters import Filters
@@ -223,14 +231,14 @@ Source code for tables.attributeset
def issysattrname(name):
- """Check if a name is a system attribute or not"""
+ """Check if a name is a system attribute or not"""
return bool(name in SYS_ATTRS or np.prod(
[name.startswith(prefix) for prefix in SYS_ATTRS_PREFIXES]))
[docs]class AttributeSet(hdf5extension.AttributeSet):
- """Container for the HDF5 attributes of a Node.
+ """Container for the HDF5 attributes of a Node.
This class provides methods to create new HDF5 node attributes,
and to get, rename or delete existing ones.
@@ -360,11 +368,11 @@ Source code for tables.attributeset
@property
def _v_node(self):
- """The :class:`Node` instance this attribute set is associated with."""
+ """The :class:`Node` instance this attribute set is associated with."""
return self._g_getnode()
def __init__(self, node):
- """Create the basic structures to keep the attribute information.
+ """Create the basic structures to keep the attribute information.
Reads all the HDF5 attributes (if any) on disk for the node "node".
@@ -418,7 +426,7 @@ Source code for tables.attributeset
self._v_attrnamesuser.sort()
def _g_update_node_location(self, node):
- """Updates the location information about the associated `node`."""
+ """Updates the location information about the associated `node`."""
dict_ = self.__dict__
dict_['_v__nodefile'] = node._v_file
@@ -427,7 +435,7 @@ Source code for tables.attributeset
self._g_new(node)
[docs] def _f_list(self, attrset='user'):
- """Get a list of attribute names.
+ """Get a list of attribute names.
The attrset string selects the attribute set to be used. A
'user' value returns only user attributes (this is the default).
@@ -444,7 +452,7 @@ Source code for tables.attributeset
return self._v_attrnames[:]
def __dir__(self):
- """Autocomplete only children named as valid python identifiers.
+ """Autocomplete only children named as valid python identifiers.
Only PY3 supports this special method.
"""
@@ -453,7 +461,7 @@ Source code for tables.attributeset
if c.isidentifier()})
def __getattr__(self, name):
- """Get the attribute named "name"."""
+ """Get the attribute named "name"."""
# If attribute does not exist, raise AttributeError
if name not in self._v_attrnames:
@@ -538,8 +546,7 @@ Source code for tables.attributeset
try:
retval = Filters._unpack(value)
except ValueError:
- sys.stderr.write('Failed parsing FILTERS key\n')
- sys.stderr.flush()
+ warnings.warn(FiltersWarning('Failed parsing FILTERS key'))
retval = None
elif name == 'TITLE' and not isinstance(value, str):
retval = value.decode('utf-8')
@@ -556,7 +563,7 @@ Source code for tables.attributeset
return retval
def _g__setattr(self, name, value):
- """Set a PyTables attribute.
+ """Set a PyTables attribute.
Sets a (maybe new) PyTables attribute with the specified `name`
and `value`. If the attribute already exists, it is simply
@@ -615,7 +622,7 @@ Source code for tables.attributeset
attrnamesuser.sort()
def __setattr__(self, name, value):
- """Set a PyTables attribute.
+ """Set a PyTables attribute.
Sets a (maybe new) PyTables attribute with the specified `name`
and `value`. If the attribute already exists, it is simply
@@ -669,7 +676,7 @@ Source code for tables.attributeset
attr_to_shadow(nodefile, node_pathname, name)
def _g__delattr(self, name):
- """Delete a PyTables attribute.
+ """Delete a PyTables attribute.
Deletes the specified existing PyTables attribute.
@@ -692,7 +699,7 @@ Source code for tables.attributeset
del self.__dict__[name]
def __delattr__(self, name):
- """Delete a PyTables attribute.
+ """Delete a PyTables attribute.
Deletes the specified existing PyTables attribute from the
attribute set. If a nonexistent or system attribute is
@@ -717,7 +724,7 @@ Source code for tables.attributeset
self._g__delattr(name)
def __getitem__(self, name):
- """The dictionary like interface for __getattr__()."""
+ """The dictionary like interface for __getattr__()."""
try:
return self.__getattr__(name)
@@ -728,12 +735,12 @@ Source code for tables.attributeset
% (name, self._v__nodepath))
def __setitem__(self, name, value):
- """The dictionary like interface for __setattr__()."""
+ """The dictionary like interface for __setattr__()."""
self.__setattr__(name, value)
def __delitem__(self, name):
- """The dictionary like interface for __delattr__()."""
+ """The dictionary like interface for __delattr__()."""
try:
self.__delattr__(name)
@@ -744,7 +751,7 @@ Source code for tables.attributeset
% (name, self._v__nodepath))
[docs] def __contains__(self, name):
- """Is there an attribute with that name?
+ """Is there an attribute with that name?
A true value is returned if the attribute set has an attribute
with the given name, false otherwise.
@@ -754,7 +761,7 @@ Source code for tables.attributeset
return name in self._v_attrnames
[docs] def _f_rename(self, oldattrname, newattrname):
- """Rename an attribute from oldattrname to newattrname."""
+ """Rename an attribute from oldattrname to newattrname."""
if oldattrname == newattrname:
# Do nothing
@@ -770,7 +777,7 @@ Source code for tables.attributeset
delattr(self, oldattrname)
def _g_copy(self, newset, set_attr=None, copyclass=False):
- """Copy set attributes.
+ """Copy set attributes.
Copies all user and allowed system PyTables attributes to the
given attribute set, replacing the existing ones.
@@ -814,7 +821,7 @@ Source code for tables.attributeset
set_attr(attrname, getattr(self, attrname))
[docs] def _f_copy(self, where):
- """Copy attributes to the where node.
+ """Copy attributes to the where node.
Copies all user and certain system attributes to the given where
node (a Node instance - see :ref:`NodeClassDescr`), replacing
@@ -835,7 +842,7 @@ Source code for tables.attributeset
pass
def __str__(self):
- """The string representation for this object."""
+ """The string representation for this object."""
# The pathname
pathname = self._v__nodepath
@@ -846,12 +853,12 @@ Source code for tables.attributeset
return f"{pathname}._v_attrs ({classname}), {attrnumber} attributes"
def __repr__(self):
- """A detailed string representation for this object."""
+ """A detailed string representation for this object."""
# print additional info only if there are attributes to show
attrnames = list(self._v_attrnames)
if attrnames:
- rep = [f'{attr} := {getattr(self, attr)!r}' for attr in attrnames]
+ rep = [f'{attr} := {getattr(self, attr)!r}' for attr in attrnames]
return f"{self!s}:\n [" + ',\n '.join(rep) + "]"
else:
return str(self)
@@ -869,20 +876,25 @@ Source code for tables.attributeset
-
@@ -891,7 +903,6 @@ Source code for tables.attributeset
-
+
+
+
@@ -26,17 +37,11 @@
+
-
-
-
-
-
-
-
@@ -77,7 +82,7 @@
- 3.8.0
+ 3.8.1.dev0
@@ -94,6 +99,7 @@
+
@@ -117,6 +123,7 @@
+
@@ -151,11 +158,13 @@
+
+
- - Docs »
+ - »
- Module code »
@@ -192,7 +201,7 @@ Source code for tables.carray
[docs]class CArray(Array):
- """This class represents homogeneous datasets in an HDF5 file.
+ """This class represents homogeneous datasets in an HDF5 file.
The difference between a CArray and a normal Array (see
:ref:`ArrayClassDescr`), from which it inherits, is that a CArray
@@ -304,45 +313,45 @@ Source code for tables.carray
_log=True, track_times=True):
self.atom = atom
- """An `Atom` instance representing the shape, type of the atomic
+ """An `Atom` instance representing the shape, type of the atomic
objects to be saved.
"""
self.shape = None
- """The shape of the stored array."""
+ """The shape of the stored array."""
self.extdim = -1 # `CArray` objects are not enlargeable by default
- """The index of the enlargeable dimension."""
+ """The index of the enlargeable dimension."""
# Other private attributes
self._v_version = None
- """The object version of this array."""
+ """The object version of this array."""
self._v_new = new = atom is not None
- """Is this the first time the node has been created?"""
+ """Is this the first time the node has been created?"""
self._v_new_title = title
- """New title for this node."""
+ """New title for this node."""
self._v_convert = True
- """Whether the ``Array`` object must be converted or not."""
+ """Whether the ``Array`` object must be converted or not."""
self._v_chunkshape = chunkshape
- """Private storage for the `chunkshape` property of the leaf."""
+ """Private storage for the `chunkshape` property of the leaf."""
# Miscellaneous iteration rubbish.
self._start = None
- """Starting row for the current iteration."""
+ """Starting row for the current iteration."""
self._stop = None
- """Stopping row for the current iteration."""
+ """Stopping row for the current iteration."""
self._step = None
- """Step size for the current iteration."""
+ """Step size for the current iteration."""
self._nrowsread = None
- """Number of rows read up to the current state of iteration."""
+ """Number of rows read up to the current state of iteration."""
self._startb = None
- """Starting row for current buffer."""
+ """Starting row for current buffer."""
self._stopb = None
- """Stopping row for current buffer. """
+ """Stopping row for current buffer. """
self._row = None
- """Current row in iterators (sentinel)."""
+ """Current row in iterators (sentinel)."""
self._init = False
- """Whether we are in the middle of an iteration or not (sentinel)."""
+ """Whether we are in the middle of an iteration or not (sentinel)."""
self.listarr = None
- """Current buffer in iterators."""
+ """Current buffer in iterators."""
if new:
if not isinstance(atom, Atom):
@@ -378,7 +387,7 @@ Source code for tables.carray
byteorder, _log, track_times)
def _g_create(self):
- """Create a new array in file (specific part)."""
+ """Create a new array in file (specific part)."""
if min(self.shape) < 1:
raise ValueError(
@@ -387,7 +396,7 @@ Source code for tables.carray
return self._g_create_common(self.nrows)
def _g_create_common(self, expectedrows):
- """Create a new array in file (common part)."""
+ """Create a new array in file (common part)."""
self._v_version = obversion
@@ -415,7 +424,7 @@ Source code for tables.carray
def _g_copy_with_stats(self, group, name, start, stop, step,
title, filters, chunkshape, _log, **kwargs):
- """Private part of Leaf.copy() for each kind of leaf."""
+ """Private part of Leaf.copy() for each kind of leaf."""
(start, stop, step) = self._process_range_read(start, stop, step)
maindim = self.maindim
@@ -459,20 +468,25 @@ Source code for tables.carray
-
@@ -481,7 +495,6 @@ Source code for tables.carray
-
+
+
+
@@ -26,17 +37,11 @@
+
-
-
-
-
-
-
-
@@ -77,7 +82,7 @@
- 3.8.0
+ 3.8.1.dev0
@@ -94,6 +99,7 @@
+
@@ -117,6 +123,7 @@
+
@@ -151,11 +158,13 @@
+
+
- - Docs »
+ - »
- Module code »
@@ -191,7 +200,7 @@ Source code for tables.description
def same_position(oldmethod):
- """Decorate `oldmethod` to also compare the `_v_pos` attribute."""
+ """Decorate `oldmethod` to also compare the `_v_pos` attribute."""
def newmethod(self, other):
try:
other._v_pos
@@ -204,7 +213,7 @@ Source code for tables.description
[docs]class Col(atom.Atom, metaclass=type):
- """Defines a non-nested column.
+ """Defines a non-nested column.
Col instances are used as a means to declare the different properties of a
non-nested column in a table or nested column. Col classes are descendants
@@ -245,18 +254,18 @@ Source code for tables.description
"""
_class_from_prefix = {} # filled as column classes are created
- """Maps column prefixes to column classes."""
+ """Maps column prefixes to column classes."""
@classmethod
def prefix(cls):
- """Return the column class prefix."""
+ """Return the column class prefix."""
cname = cls.__name__
return cname[:cname.rfind('Col')]
[docs] @classmethod
def from_atom(cls, atom, pos=None, _offset=None):
- """Create a Col definition from a PyTables atom.
+ """Create a Col definition from a PyTables atom.
An optional position may be specified as the pos argument.
@@ -269,7 +278,7 @@ Source code for tables.description
@classmethod
def from_sctype(cls, sctype, shape=(), dflt=None, pos=None):
- """Create a `Col` definition from a NumPy scalar type `sctype`.
+ """Create a `Col` definition from a NumPy scalar type `sctype`.
Optional shape, default value and position may be specified as
the `shape`, `dflt` and `pos` arguments, respectively.
@@ -283,7 +292,7 @@ Source code for tables.description
@classmethod
def from_dtype(cls, dtype, dflt=None, pos=None, _offset=None):
- """Create a `Col` definition from a NumPy `dtype`.
+ """Create a `Col` definition from a NumPy `dtype`.
Optional default value and position may be specified as the
`dflt` and `pos` arguments, respectively. The `dtype` must have
@@ -298,7 +307,7 @@ Source code for tables.description
@classmethod
def from_type(cls, type, shape=(), dflt=None, pos=None):
- """Create a `Col` definition from a PyTables `type`.
+ """Create a `Col` definition from a PyTables `type`.
Optional shape, default value and position may be specified as
the `shape`, `dflt` and `pos` arguments, respectively.
@@ -310,7 +319,7 @@ Source code for tables.description
@classmethod
def from_kind(cls, kind, itemsize=None, shape=(), dflt=None, pos=None):
- """Create a `Col` definition from a PyTables `kind`.
+ """Create a `Col` definition from a PyTables `kind`.
Optional item size, shape, default value and position may be
specified as the `itemsize`, `shape`, `dflt` and `pos`
@@ -324,7 +333,7 @@ Source code for tables.description
@classmethod
def _subclass_from_prefix(cls, prefix):
- """Get a column subclass for the given `prefix`."""
+ """Get a column subclass for the given `prefix`."""
cname = '%sCol' % prefix
class_from_prefix = cls._class_from_prefix
@@ -333,7 +342,7 @@ Source code for tables.description
atombase = getattr(atom, '%sAtom' % prefix)
class NewCol(cls, atombase):
- """Defines a non-nested column of a particular type.
+ """Defines a non-nested column of a particular type.
The constructor accepts the same arguments as the equivalent
`Atom` class, plus an additional ``pos`` argument for
@@ -383,7 +392,7 @@ Source code for tables.description
return f'{classname}({atomargs}, pos={self._v_pos})'
def _get_init_args(self):
- """Get a dictionary of instance constructor arguments."""
+ """Get a dictionary of instance constructor arguments."""
kwargs = {arg: getattr(self, arg) for arg in ('shape', 'dflt')}
kwargs['pos'] = getattr(self, '_v_pos', None)
@@ -391,7 +400,7 @@ Source code for tables.description
def _generate_col_classes():
- """Generate all column classes."""
+ """Generate all column classes."""
# Abstract classes are not in the class map.
cprefixes = ['Int', 'UInt', 'Float', 'Time']
@@ -462,7 +471,7 @@ Source code for tables.description
# Table description classes
# =========================
[docs]class Description:
- """This class represents descriptions of the structure of tables.
+ """This class represents descriptions of the structure of tables.
An instance of this class is automatically bound to Table (see
:ref:`TableClassDescr`) objects when they are created. It provides a
@@ -782,7 +791,7 @@ Source code for tables.description
newdict['_v_offsets'] = [dtype.fields[name][1] for name in dtype.names]
def _g_set_nested_names_descr(self):
- """Computes the nested names and descriptions for nested datatypes."""
+ """Computes the nested names and descriptions for nested datatypes."""
names = self._v_names
fmts = self._v_nested_formats
@@ -799,7 +808,7 @@ Source code for tables.description
self._v_is_nested = True
def _g_set_path_names(self):
- """Compute the pathnames for arbitrary nested descriptions.
+ """Compute the pathnames for arbitrary nested descriptions.
This method sets the ``_v_pathname`` and ``_v_pathnames``
attributes of all the elements (both descriptions and columns)
@@ -875,7 +884,7 @@ Source code for tables.description
# (Nothing is pushed, we are done with this description.)
[docs] def _f_walk(self, type='All'):
- """Iterate over nested columns.
+ """Iterate over nested columns.
If type is 'All' (the default), all column description objects (Col and
Description instances) are yielded in top-to-bottom order (preorder).
@@ -903,7 +912,7 @@ Source code for tables.description
yield new_object # yield column
def __repr__(self):
- """Gives a detailed Description column representation."""
+ """Gives a detailed Description column representation."""
rep = ['%s\"%s\": %r' %
(" " * self._v_nestedlvl, k, self._v_colobjects[k])
@@ -911,16 +920,16 @@ Source code for tables.description
return '{\n %s}' % (',\n '.join(rep))
def __str__(self):
- """Gives a brief Description representation."""
+ """Gives a brief Description representation."""
return f'Description({self._v_nested_descr})'
class MetaIsDescription(type):
- """Helper metaclass to return the class variables as a dictionary."""
+ """Helper metaclass to return the class variables as a dictionary."""
def __new__(mcs, classname, bases, classdict):
- """Return a new class with a "columns" attribute filled."""
+ """Return a new class with a "columns" attribute filled."""
newdict = {"columns": {}, }
if '__doc__' in classdict:
@@ -939,7 +948,7 @@ Source code for tables.description
[docs]class IsDescription(metaclass=MetaIsDescription):
- """Description of the structure of a table or nested column.
+ """Description of the structure of a table or nested column.
This class is designed to be used as an easy, yet meaningful way to
describe the structure of new Table (see :ref:`TableClassDescr`) datasets
@@ -984,7 +993,7 @@ Source code for tables.description
[docs]def descr_from_dtype(dtype_, ptparams=None):
- """Get a description instance and byteorder from a (nested) NumPy dtype."""
+ """Get a description instance and byteorder from a (nested) NumPy dtype."""
fields = {}
fbyteorder = '|'
@@ -1019,7 +1028,7 @@ Source code for tables.description
[docs]def dtype_from_descr(descr, byteorder=None, ptparams=None):
- """Get a (nested) NumPy dtype from a description instance and byteorder.
+ """Get a (nested) NumPy dtype from a description instance and byteorder.
The descr parameter can be a Description or IsDescription
instance, sub-class of IsDescription or a dictionary.
@@ -1045,7 +1054,7 @@ Source code for tables.description
if __name__ == "__main__":
- """Test code."""
+ """Test code."""
class Info(IsDescription):
_v_pos = 2
@@ -1053,7 +1062,7 @@ Source code for tables.description
Value = Float64Col()
class Test(IsDescription):
- """A description that has several columns."""
+ """A description that has several columns."""
x = Col.from_type("int32", 2, 0, pos=0)
y = Col.from_kind('float', dflt=1, shape=(2, 3))
@@ -1153,20 +1162,25 @@ Source code for tables.description
-
@@ -1175,7 +1189,6 @@ Source code for tables.description
-
+
+
+
@@ -26,17 +37,11 @@
+
-
-
-
-
-
-
-
@@ -77,7 +82,7 @@
- 3.8.0
+ 3.8.1.dev0
@@ -94,6 +99,7 @@
+
@@ -117,6 +123,7 @@
+
@@ -151,11 +158,13 @@
+
+
- - Docs »
+ - »
- Module code »
@@ -192,7 +201,7 @@ Source code for tables.earray
[docs]class EArray(CArray):
- """This class represents extendable, homogeneous datasets in an HDF5 file.
+ """This class represents extendable, homogeneous datasets in an HDF5 file.
The main difference between an EArray and a CArray (see
:ref:`CArrayClassDescr`), from which it inherits, is that the former
@@ -314,14 +323,14 @@ Source code for tables.earray
if expectedrows is None:
expectedrows = parentnode._v_file.params['EXPECTED_ROWS_EARRAY']
self._v_expectedrows = expectedrows
- """The expected number of rows to be stored in the array."""
+ """The expected number of rows to be stored in the array."""
# Call the parent (CArray) init code
super().__init__(parentnode, name, atom, shape, title, filters,
chunkshape, byteorder, _log, track_times)
def _g_create(self):
- """Create a new array in file (specific part)."""
+ """Create a new array in file (specific part)."""
# Pre-conditions and extdim computation
zerodims = np.sum(np.array(self.shape) == 0)
@@ -341,7 +350,7 @@ Source code for tables.earray
return self._g_create_common(self._v_expectedrows)
def _check_shape_append(self, nparr):
- """Test that nparr shape is consistent with underlying EArray."""
+ """Test that nparr shape is consistent with underlying EArray."""
# The arrays conforms self expandibility?
myrank = len(self.shape)
@@ -357,7 +366,7 @@ Source code for tables.earray
"dimension %d") % (self._v_pathname, i))
[docs] def append(self, sequence):
- """Add a sequence of data to the end of the dataset.
+ """Add a sequence of data to the end of the dataset.
The sequence must have the same type as the array; otherwise a
TypeError is raised. In the same way, the dimensions of the
@@ -381,7 +390,7 @@ Source code for tables.earray
def _g_copy_with_stats(self, group, name, start, stop, step,
title, filters, chunkshape, _log, **kwargs):
- """Private part of Leaf.copy() for each kind of leaf."""
+ """Private part of Leaf.copy() for each kind of leaf."""
(start, stop, step) = self._process_range_read(start, stop, step)
# Build the new EArray object
@@ -422,20 +431,25 @@ Source code for tables.earray
-
@@ -444,7 +458,6 @@ Source code for tables.earray
-
+
@@ -26,17 +37,11 @@
+
-
-
-
-
-
-
-
@@ -77,7 +82,7 @@
- 3.8.0
+ 3.8.1.dev0
@@ -94,6 +99,7 @@
+
@@ -117,6 +123,7 @@
+
@@ -151,11 +158,13 @@
+
+
- - Docs »
+ - »
- Module code »
@@ -182,12 +191,33 @@ Source code for tables.exceptions
import traceback
+__all__ = [
+ "ClosedFileError",
+ "ClosedNodeError",
+ "DataTypeWarning",
+ "ExperimentalFeatureWarning",
+ "FileModeError",
+ "FiltersWarning",
+ "FlavorError",
+ "FlavorWarning",
+ "HDF5ExtError",
+ "NaturalNameWarning",
+ "NoSuchNodeError",
+ "NodeError",
+ "OldIndexWarning",
+ "PerformanceWarning",
+ "UnclosedFileWarning",
+ "UndoRedoError",
+ "UndoRedoWarning",
+]
+
+
__docformat__ = 'reStructuredText'
"""The format of documentation strings in this module."""
[docs]class HDF5ExtError(RuntimeError):
- """A low level HDF5 operation failed.
+ """A low level HDF5 operation failed.
This exception is raised the low level PyTables components used for
accessing HDF5 files. It usually signals that something is not
@@ -227,7 +257,7 @@ Source code for tables.exceptions
_dump_h5_backtrace = None
DEFAULT_H5_BACKTRACE_POLICY = "VERBOSE"
- """Default policy for HDF5 backtrace handling
+ """Default policy for HDF5 backtrace handling
* if set to False the HDF5 back trace is ignored and the
:attr:`HDF5ExtError.h5backtrace` attribute is set to None
@@ -281,7 +311,7 @@ Source code for tables.exceptions
if self._h5bt_policy and self._dump_h5_backtrace is not None:
self.h5backtrace = self._dump_h5_backtrace()
- """HDF5 back trace.
+ """HDF5 back trace.
Contains the HDF5 back trace as a (possibly empty) list of
tuples. Each tuple has the following format::
@@ -308,7 +338,7 @@ Source code for tables.exceptions
self.h5backtrace = None
def __str__(self):
- """Returns a sting representation of the exception.
+ """Returns a sting representation of the exception.
The actual result depends on policy set in the initializer
:meth:`HDF5ExtError.__init__`.
@@ -339,7 +369,7 @@ Source code for tables.exceptions
return msg
[docs] def format_h5_backtrace(self, backtrace=None):
- """Convert the HDF5 trace back represented as a list of tuples.
+ """Convert the HDF5 trace back represented as a list of tuples.
(see :attr:`HDF5ExtError.h5backtrace`) into a string.
.. versionadded:: 2.4
@@ -362,7 +392,7 @@ Source code for tables.exceptions
# raised by ``file`` objects on certain operations.
[docs]class ClosedNodeError(ValueError):
- """The operation can not be completed because the node is closed.
+ """The operation can not be completed because the node is closed.
For instance, listing the children of a closed group is not allowed.
@@ -372,7 +402,7 @@ Source code for tables.exceptions
[docs]class ClosedFileError(ValueError):
- """The operation can not be completed because the hosting file is closed.
+ """The operation can not be completed because the hosting file is closed.
For instance, getting an existing node from a closed file is not
allowed.
@@ -383,7 +413,7 @@ Source code for tables.exceptions
[docs]class FileModeError(ValueError):
- """The operation can not be carried out because the mode in which the
+ """The operation can not be carried out because the mode in which the
hosting file is opened is not adequate.
For instance, removing an existing leaf from a read-only file is not
@@ -395,7 +425,7 @@ Source code for tables.exceptions