diff -Nru pytables-3.2.1/debian/changelog pytables-3.2.2/debian/changelog --- pytables-3.2.1/debian/changelog 2015-08-14 19:42:34.000000000 +0000 +++ pytables-3.2.2/debian/changelog 2015-10-03 16:34:01.000000000 +0000 @@ -1,3 +1,11 @@ +pytables (3.2.2-1) unstable; urgency=medium + + * New upstream release (Closes: #800466) + * debian/patches: + - drop 0005-Fix-setitem-return-value.patch (applied upstream) + + -- Antonio Valentino Sat, 03 Oct 2015 16:33:36 +0000 + pytables (3.2.1-1) unstable; urgency=medium * New upstream version diff -Nru pytables-3.2.1/debian/patches/0005-Fix-setitem-return-value.patch pytables-3.2.2/debian/patches/0005-Fix-setitem-return-value.patch --- pytables-3.2.1/debian/patches/0005-Fix-setitem-return-value.patch 2015-08-14 19:42:34.000000000 +0000 +++ pytables-3.2.2/debian/patches/0005-Fix-setitem-return-value.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -Description: Clear the exception set by PyArray_SETITEM() before raising a - TypeError. Without this, the test suite will raise a SystemError. -Author: Barry Warsaw -Bug: https://github.com/PyTables/PyTables/issues/486 - ---- a/tables/tableextension.pyx -+++ b/tables/tableextension.pyx -@@ -40,7 +40,7 @@ - - # numpy functions & objects - from hdf5extension cimport Leaf --from cpython cimport PY_MAJOR_VERSION -+from cpython cimport PY_MAJOR_VERSION, PyErr_Clear - from libc.stdio cimport snprintf - from libc.stdlib cimport malloc, free - from libc.string cimport memcpy, strdup, strcmp, strlen -@@ -1596,6 +1596,7 @@ - if field.ndim == 1: - ret = PyArray_SETITEM(field, field.data + offset * self._stride, value) - if ret < 0: -+ PyErr_Clear() - raise TypeError - ##### End of optimization for scalar values - else: diff -Nru pytables-3.2.1/debian/patches/series pytables-3.2.2/debian/patches/series --- pytables-3.2.1/debian/patches/series 2015-08-14 19:42:34.000000000 +0000 +++ pytables-3.2.2/debian/patches/series 2015-10-03 16:34:01.000000000 +0000 @@ -2,4 +2,3 @@ 0002-Use-system-compression-libs.patch 0003-Never-use-the-msse2-flag-explicitly.patch 0004-Do-not-fetch-icons-for-external-web-sites.patch -0005-Fix-setitem-return-value.patch diff -Nru pytables-3.2.1/doc/source/release_notes.rst pytables-3.2.2/doc/source/release_notes.rst --- pytables-3.2.1/doc/source/release_notes.rst 2015-08-04 00:20:33.000000000 +0000 +++ pytables-3.2.2/doc/source/release_notes.rst 2015-09-22 03:54:51.000000000 +0000 @@ -59,6 +59,8 @@ ---------------- =============== =========== ========== +PyTables 3.2.2 2015-09-22 +PyTables 3.2.1.1 2015-08-31 PyTables 3.2.1 2015-08-04 PyTables 3.2.0 2015-05-06 PyTables 3.2.0rc2 2015-05-01 diff -Nru pytables-3.2.1/README.rst pytables-3.2.2/README.rst --- pytables-3.2.1/README.rst 2015-08-04 00:20:33.000000000 +0000 +++ pytables-3.2.2/README.rst 2015-09-22 03:54:51.000000000 +0000 @@ -4,7 +4,7 @@ .. image:: https://badges.gitter.im/Join%20Chat.svg :alt: Join the chat at https://gitter.im/PyTables/PyTables - :target: https://gitter.im/PyTables/PyTables?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge + :target: https://gitter.im/PyTables/PyTables :URL: http://www.pytables.org/ @@ -88,59 +88,46 @@ versions of them. LZO and bzip2 compression libraries are, however, optional. -We've tested this PyTables version with HDF5 1.8.4/1.8.12, NumPy -1.7.1/1.8.0 and Numexpr 2.4, and you *need* to use these versions, or -higher, to make use of PyTables. - Installation ------------ -The Python Distutils are used to build and install PyTables, so it is -fairly simple to get things ready to go. Following are very simple -instructions on how to proceed. However, more detailed instructions, -including a section on binary installation for Windows users, is -available in Chapter 2 of the User's Manual (``doc/usersguide.pdf`` or -http://pytables.github.io/usersguide/introduction.html). - -1. First, make sure that you have HDF5, NumPy and Numexpr installed - (you will need at least HDF5 >= 1.8.4, NumPy 1.7.1 and Numexpr - 2.3). If don't, get them from http://www.hdfgroup.org/HDF5/, - http://www.numpy.org and https://github.com/pydata/numexpr and - install them. - - Optionally, consider to install the LZO compression library from - http://www.oberhumer.com/opensource/. You can also install the - bzip2 compression library, available at http://www.bzip.org/. - -2. From the main PyTables distribution directory run this command, - (plus any extra flags needed as discussed above):: - - $ python setup.py build_ext --inplace - -3. To run the test suite, set the PYTHONPATH environment variable to - include the ``.`` directory, enter the Python interpreter and issue - the commands:: +1. Make sure you have HDF5 version 1.8.4 or above. - >>> import tables - >>> tables.test() + On OSX you can install HDF5 using `Homebrew `_:: - If there is some test that does not pass, please send the - complete output for tests back to us. + $ brew tap homebrew/science + $ brew install hdf5 + + On ubuntu:: + + $ sudo apt-get install libhdf5-serial-dev -4. To install the entire PyTables Python package, run this command as - the root user (remember to add any extra flags needed):: + If you have the HDF5 library in some non-standard location (that is: where + the compiler and the linker can't find it) you can use the environment + variable `HDF5_DIR` to specify its location. See `the manual + `_ for more details. - $ python setup.py install +2. Make sure your python installation is in good health, that is you have the + package installer pip and it works ok. Check the `Python Packaging User + Guide `_ for + further instructions. +3. Optionally, consider to install the LZO compression library and/or the + bzip2 compression library. -That's it! Good luck, and let us know of any bugs, suggestions, -gripes, kudos, etc. you may have. +4. Install!:: ----- + $ pip install tables + +5. To run the test suite run:: + + $ python -m tables.tests.test_all + + If there is some test that does not pass, please send the + complete output for tests back to us. - **Enjoy data!** - -- The PyTables Team +**Enjoy data!** -- The PyTables Team .. Local Variables: .. mode: text diff -Nru pytables-3.2.1/RELEASE_NOTES.txt pytables-3.2.2/RELEASE_NOTES.txt --- pytables-3.2.1/RELEASE_NOTES.txt 2015-08-04 00:20:33.000000000 +0000 +++ pytables-3.2.2/RELEASE_NOTES.txt 2015-09-22 03:54:51.000000000 +0000 @@ -8,6 +8,28 @@ .. py:currentmodule:: tables +Changes from 3.2.1.1 to 3.2.2 +============================= + +Bug fixed +--------- + +- Fix AssertionError in Row.__init_loop. See :issue:`477`. +- Fix issues with Cython 0.23. See :issue:`481`. +- Only run `tables.tests.test_basics.UnicodeFilename` if the filesystem + encoding is utf-8. Closes :issue:`485`. +- Fix missing missing PyErr_Clear. See :issue:`#486`. +- Fix the C type of some numpy attributes. See :issue:`494`. +- Cast selection indices to integer. See :issue:`496`. +- Fix indexesextension._keysort_string. Closes :issue:`497` and :issue:`498`. + + +Changes from 3.2.1 to 3.2.1.1 +============================= + +- Fix permission on distributed source distribution + + Changes from 3.2.0 to 3.2.1 =========================== diff -Nru pytables-3.2.1/tables/array.py pytables-3.2.2/tables/array.py --- pytables-3.2.1/tables/array.py 2015-08-04 00:20:33.000000000 +0000 +++ pytables-3.2.2/tables/array.py 2015-09-22 03:54:51.000000000 +0000 @@ -12,6 +12,7 @@ """Here is defined the Array class.""" +import operator import sys import numpy @@ -394,6 +395,8 @@ raise IndexError("Too many indices for object '%s'" % self._v_pathname) elif is_idx(key): + key = operator.index(key) + # Protection for index out of range if key >= self.shape[dim]: raise IndexError("Index out of range") diff -Nru pytables-3.2.1/tables/indexesextension.pyx pytables-3.2.2/tables/indexesextension.pyx --- pytables-3.2.1/tables/indexesextension.pyx 2015-08-04 00:20:33.000000000 +0000 +++ pytables-3.2.2/tables/indexesextension.pyx 2015-09-22 03:54:51.000000000 +0000 @@ -443,7 +443,7 @@ swap_bytes(ipi, ipr-ts, ts) # push largest partition on stack and proceed with the other - if (pi - pl) > (pr - pi): + if (pi - pl) < (pr - pi): sptr[0] = pi + ss sptr[1] = pr sptr += 2 diff -Nru pytables-3.2.1/tables/index.py pytables-3.2.2/tables/index.py --- pytables-3.2.1/tables/index.py 2015-08-04 00:20:33.000000000 +0000 +++ pytables-3.2.2/tables/index.py 2015-09-22 03:54:51.000000000 +0000 @@ -13,14 +13,16 @@ """Here is defined the Index class.""" from __future__ import print_function -import sys -from time import time, clock +import math +import operator import os import os.path +import sys import tempfile -import math import warnings +from time import time, clock + import numpy from tables.idxutils import (calc_chunksize, calcoptlevels, @@ -1787,6 +1789,8 @@ """ if is_idx(key): + key = operator.index(key) + if key < 0: # To support negative values key += self.nelements diff -Nru pytables-3.2.1/tables/leaf.py pytables-3.2.2/tables/leaf.py --- pytables-3.2.1/tables/leaf.py 2015-08-04 00:20:33.000000000 +0000 +++ pytables-3.2.2/tables/leaf.py 2015-09-22 03:54:51.000000000 +0000 @@ -366,22 +366,9 @@ buffersize = params['IO_BUFFER_SIZE'] if rowsize != 0: nrowsinbuf = buffersize // rowsize - if self.__class__.__name__ == "Table": - # The number of rows in buffer needs to be an exact multiple of - # chunkshape[0] for queries using indexed columns. - # Fixes #319 and probably #409 too. - nrowsinbuf -= nrowsinbuf % self.chunkshape[0] else: nrowsinbuf = 1 - # tableextension.pyx performs an assertion - # to make sure nrowsinbuf is greater than or - # equal to the chunksize. - # See gh-206 and gh-238 - if self.chunkshape is not None and self.__class__.__name__ == "Table": - if nrowsinbuf < self.chunkshape[0]: - nrowsinbuf = self.chunkshape[0] - # Safeguard against row sizes being extremely large if nrowsinbuf == 0: nrowsinbuf = 1 diff -Nru pytables-3.2.1/tables/tableextension.pyx pytables-3.2.2/tables/tableextension.pyx --- pytables-3.2.1/tables/tableextension.pyx 2015-08-04 00:20:33.000000000 +0000 +++ pytables-3.2.2/tables/tableextension.pyx 2015-09-22 03:54:51.000000000 +0000 @@ -40,7 +40,7 @@ # numpy functions & objects from hdf5extension cimport Leaf -from cpython cimport PY_MAJOR_VERSION +from cpython cimport PY_MAJOR_VERSION, PyErr_Clear from libc.stdio cimport snprintf from libc.stdlib cimport malloc, free from libc.string cimport memcpy, strdup, strcmp, strlen @@ -426,7 +426,8 @@ """ cdef void *t64buf - cdef long byteoffset, bytestride, nelements + cdef long byteoffset + cdef npy_intp bytestride, nelements byteoffset = 0 # NumPy objects doesn't have an offset bytestride = nparr.strides[0] # supports multi-dimensional recarray @@ -699,6 +700,7 @@ """ + cdef npy_intp _stride cdef long _row, _unsaved_nrows, _mod_nrows cdef hsize_t start, absstep cdef long long stop, step, nextelement, _nrow, stopb # has to be long long, not hsize_t, for negative step sizes @@ -708,7 +710,7 @@ cdef long long indexchunk cdef int bufcounter, counter cdef int exist_enum_cols - cdef int _riterator, _stride, _rowsize, _write_to_seqcache + cdef int _riterator, _rowsize, _write_to_seqcache cdef int wherecond, indexed cdef int ro_filemode, chunked cdef int _bufferinfo_done, sss_on @@ -1241,7 +1243,7 @@ istartb = (j+istep) % inrowsinbuf inextelement = inextelement + istep i = i + inrowsinbuf - elif 0 > istep: + elif istep < 0: inrowsinbuf = self.nrowsinbuf #istartb = self.startb istartb = self.nrowsinbuf - 1 @@ -1258,7 +1260,8 @@ i = i - inrowsinbuf continue # Compute the end for this iteration - stopr = startr + ((istopb - istartb - 1) / istep) + # (we know we are going backward so try to keep indices positive) + stopr = startr + (1 - istopb + istartb) / (-istep) # Read a chunk inrowsread = inrowsread + self.table._read_records(i - inrowsinbuf + 1, inrowsinbuf, self.iobuf) @@ -1596,6 +1599,7 @@ if field.ndim == 1: ret = PyArray_SETITEM(field, field.data + offset * self._stride, value) if ret < 0: + PyErr_Clear() raise TypeError ##### End of optimization for scalar values else: diff -Nru pytables-3.2.1/tables/table.py pytables-3.2.2/tables/table.py --- pytables-3.2.1/tables/table.py 2015-08-04 00:20:33.000000000 +0000 +++ pytables-3.2.2/tables/table.py 2015-09-22 03:54:51.000000000 +0000 @@ -12,12 +12,14 @@ """Here is defined the Table class.""" -import sys import math -import warnings +import operator import os.path -from time import time +import sys +import warnings + from functools import reduce as _reduce +from time import time import numpy import numexpr @@ -945,6 +947,47 @@ _g_postInitHook = previous_api(_g_post_init_hook) + def _calc_nrowsinbuf(self): + """Calculate the number of rows that fits on a PyTables buffer.""" + + params = self._v_file.params + # Compute the nrowsinbuf + rowsize = self.rowsize + buffersize = params['IO_BUFFER_SIZE'] + if rowsize != 0: + nrowsinbuf = buffersize // rowsize + # The number of rows in buffer needs to be an exact multiple of + # chunkshape[0] for queries using indexed columns. + # Fixes #319 and probably #409 too. + nrowsinbuf -= nrowsinbuf % self.chunkshape[0] + else: + nrowsinbuf = 1 + + # tableextension.pyx performs an assertion + # to make sure nrowsinbuf is greater than or + # equal to the chunksize. + # See gh-206 and gh-238 + if self.chunkshape is not None: + if nrowsinbuf < self.chunkshape[0]: + nrowsinbuf = self.chunkshape[0] + + # Safeguard against row sizes being extremely large + if nrowsinbuf == 0: + nrowsinbuf = 1 + # If rowsize is too large, issue a Performance warning + maxrowsize = params['BUFFER_TIMES'] * buffersize + if rowsize > maxrowsize: + warnings.warn("""\ +The Table ``%s`` is exceeding the maximum recommended rowsize (%d bytes); +be ready to see PyTables asking for *lots* of memory and possibly slow +I/O. You may want to reduce the rowsize by trimming the value of +dimensions that are orthogonal (and preferably close) to the *main* +dimension of this leave. Alternatively, in case you have specified a +very small/large chunksize, you may want to increase/decrease it.""" + % (self._v_pathname, maxrowsize), + PerformanceWarning) + return nrowsinbuf + def _getemptyarray(self, dtype): # Acts as a cache for empty arrays key = dtype @@ -2104,6 +2147,8 @@ self._g_check_open() if is_idx(key): + key = operator.index(key) + # Index out of range protection if key >= self.nrows: raise IndexError("Index out of range") @@ -2173,6 +2218,8 @@ self._v_file._check_writable() if is_idx(key): + key = operator.index(key) + # Index out of range protection if key >= self.nrows: raise IndexError("Index out of range") @@ -3211,6 +3258,8 @@ table = self._v_table nrows = table.nrows if is_idx(key): + key = operator.index(key) + # Index out of range protection if key >= nrows: raise IndexError("Index out of range") @@ -3268,6 +3317,8 @@ table = self._v_table nrows = table.nrows if is_idx(key): + key = operator.index(key) + # Index out of range protection if key >= nrows: raise IndexError("Index out of range") @@ -3515,6 +3566,8 @@ key = key[0] if is_idx(key): + key = operator.index(key) + # Index out of range protection if key >= table.nrows: raise IndexError("Index out of range") @@ -3587,6 +3640,8 @@ key = key[0] if is_idx(key): + key = operator.index(key) + # Index out of range protection if key >= table.nrows: raise IndexError("Index out of range") diff -Nru pytables-3.2.1/tables/tests/test_basics.py pytables-3.2.2/tables/tests/test_basics.py --- pytables-3.2.1/tables/tests/test_basics.py 2015-08-04 00:20:33.000000000 +0000 +++ pytables-3.2.2/tables/tests/test_basics.py 2015-09-22 03:54:51.000000000 +0000 @@ -1920,6 +1920,8 @@ @unittest.skipIf('win' in platform.system().lower(), 'known bug: gh-389') +@unittest.skipIf(sys.getfilesystemencoding() != 'utf-8', + 'need utf-8 file-system encoding') class UnicodeFilename(common.TempFileMixin, TestCase): unicode_prefix = u'para\u0140lel' diff -Nru pytables-3.2.1/tables/tests/test_tables.py pytables-3.2.2/tables/tests/test_tables.py --- pytables-3.2.1/tables/tests/test_tables.py 2015-08-04 00:20:33.000000000 +0000 +++ pytables-3.2.2/tables/tests/test_tables.py 2015-09-22 03:54:51.000000000 +0000 @@ -2577,6 +2577,19 @@ result = table[np.array(self.expectedrows-1)] self.assertEqual(result["var2"], self.expectedrows - 1) + def test01f_singleItem(self): + """Checking __getitem__ method with single parameter (np.uint64)""" + + if common.verbose: + print('\n', '-=' * 30) + print("Running %s.test01f_singleItem..." % self.__class__.__name__) + + self.h5file = tables.open_file(self.h5fname, "r") + table = self.h5file.root.table0 + + result = table[np.uint64(2)] + self.assertEqual(result["var2"], 2) + def test02_twoItems(self): """Checking __getitem__ method with start, stop parameters.""" diff -Nru pytables-3.2.1/tables/vlarray.py pytables-3.2.2/tables/vlarray.py --- pytables-3.2.1/tables/vlarray.py 2015-08-04 00:20:33.000000000 +0000 +++ pytables-3.2.2/tables/vlarray.py 2015-09-22 03:54:51.000000000 +0000 @@ -12,6 +12,7 @@ """Here is defined the VLArray class.""" +import operator import sys import numpy @@ -660,6 +661,8 @@ self._g_check_open() if is_idx(key): + key = operator.index(key) + # Index out of range protection if key >= self.nrows: raise IndexError("Index out of range") diff -Nru pytables-3.2.1/.travis.yml pytables-3.2.2/.travis.yml --- pytables-3.2.1/.travis.yml 2015-08-04 00:20:33.000000000 +0000 +++ pytables-3.2.2/.travis.yml 2015-09-22 03:54:51.000000000 +0000 @@ -6,6 +6,7 @@ - 3.2 - 3.3 - 3.4 + - 3.5 sudo: false diff -Nru pytables-3.2.1/VERSION pytables-3.2.2/VERSION --- pytables-3.2.1/VERSION 2015-08-04 00:20:33.000000000 +0000 +++ pytables-3.2.2/VERSION 2015-09-22 03:54:51.000000000 +0000 @@ -1 +1 @@ -3.2.1 +3.2.2