From 5397716f5d32b1aa6f2e97954d682b912a824841 Mon Sep 17 00:00:00 2001 From: James Tocknell Date: Wed, 30 May 2018 11:43:39 +1000 Subject: [PATCH] ENH: Add enforcement for whitespace cleanup --- .gitignore | 2 +- .pre-commit-config.yaml | 6 + .travis.yml | 1 + ANN.rst | 4 +- MANIFEST.in | 1 + ci/appveyor/vs2008_patch/setup_x64.bat | 2 +- ci/appveyor/vs2008_patch/setup_x86.bat | 2 +- docs/faq.rst | 17 +- docs/high/attr.rst | 3 - docs/high/file.rst | 2 +- docs/high/group.rst | 4 +- docs/index.rst | 2 +- docs/licenses.rst | 7 +- docs/mpi.rst | 1 - docs/quick.rst | 2 - docs/refs.rst | 4 +- docs/special.rst | 4 +- docs/swmr.rst | 26 +- docs/whatsnew/2.0.rst | 9 - docs/whatsnew/2.2.rst | 3 +- docs/whatsnew/2.4.rst | 6 +- docs/whatsnew/2.5.rst | 1 - docs/whatsnew/2.7.rst | 1 - docs_api/h5.rst | 3 - docs_api/h5a.rst | 2 - docs_api/h5d.rst | 5 +- docs_api/h5f.rst | 2 - docs_api/h5fd.rst | 4 +- docs_api/h5g.rst | 11 - docs_api/h5i.rst | 1 - docs_api/h5o.rst | 1 - docs_api/h5p.rst | 1 - docs_api/h5r.rst | 2 - docs_api/h5s.rst | 6 +- docs_api/h5t.rst | 19 +- docs_api/h5z.rst | 2 - docs_api/index.rst | 2 +- h5py/_conv.pxd | 4 - h5py/_errors.pxd | 365 ++++++++++++------------- h5py/_locks.pxi | 1 - h5py/_objects.pxd | 1 - h5py/_proxy.pxd | 1 - h5py/h5.pxd | 2 - h5py/h5a.pxd | 1 - h5py/h5d.pxd | 1 - h5py/h5f.pxd | 2 - h5py/h5fd.pxd | 1 - h5py/h5g.pxd | 3 - h5py/h5l.pxd | 2 - h5py/h5o.pxd | 1 - h5py/h5p.pyx | 4 +- h5py/h5r.pxd | 1 - h5py/h5s.pxd | 2 - h5py/h5t.pxd | 10 - h5py/h5z.pxd | 1 - h5py/numpy.pxd | 5 - h5py/utils.pxd | 13 - licenses/license.txt | 4 +- licenses/python.txt | 1 - licenses/stdint.txt | 4 +- lzf/LICENSE.txt | 5 +- lzf/README.txt | 6 - lzf/example.c | 5 +- lzf/lzf/lzf.h | 13 +- lzf/lzf/lzfP.h | 9 +- lzf/lzf/lzf_c.c | 9 +- lzf/lzf/lzf_d.c | 11 +- lzf/lzf_filter.c | 27 +- lzf/lzf_filter.h | 11 +- tox.ini | 8 + windows/README.txt | 6 +- windows/stdint.h | 20 +- 72 files changed, 298 insertions(+), 433 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.gitignore b/.gitignore index b1d453624..f6ded92e9 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,4 @@ MANIFEST /*.egg .eggs/ *.so -*~ \ No newline at end of file +*~ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..572f4bfc0 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v1.2.3 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace diff --git a/.travis.yml b/.travis.yml index f8dd6a360..2b51d3ba1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,7 @@ env: - TOXENV=docs - TOXENV=check-manifest - TOXENV=checkreadme + - TOXENV=pre-commit matrix: include: diff --git a/ANN.rst b/ANN.rst index 7ce8c3068..9c5dd4a2c 100644 --- a/ANN.rst +++ b/ANN.rst @@ -6,7 +6,7 @@ The h5py team is happy to announce the availability of h5py 2.5.0. This release introduces experimental support for the highly-anticipated "Single Writer Multiple Reader" (SWMR) feature in the upcoming HDF5 1.10 release. SWMR allows sharing of a single HDF5 file between multiple processes -without the complexity of MPI or multiprocessing-based solutions. +without the complexity of MPI or multiprocessing-based solutions. This is an experimental feature that should NOT be used in production code. We are interested in getting feedback from the broader community with respect @@ -42,7 +42,7 @@ Changes * Fixed an issue with 64-bit float VLENS * Cython warning cleanups related to "const" * Entire code base ported to "six"; 2to3 removed from setup.py - + Acknowledgements ---------------- diff --git a/MANIFEST.in b/MANIFEST.in index 7e17ba50f..0d4e95711 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -30,3 +30,4 @@ recursive-exclude other * recursive-exclude .github * exclude pavement.py exclude *.yml +exclude *.yaml diff --git a/ci/appveyor/vs2008_patch/setup_x64.bat b/ci/appveyor/vs2008_patch/setup_x64.bat index 4786b3c20..41b7a54cb 100644 --- a/ci/appveyor/vs2008_patch/setup_x64.bat +++ b/ci/appveyor/vs2008_patch/setup_x64.bat @@ -10,4 +10,4 @@ regedit /s x64\656d8763-2429-11d7-8bf6-00b0d03daa06.reg regedit /s x64\656d8766-2429-11d7-8bf6-00b0d03daa06.reg copy "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages\AMD64.VCPlatform.config" "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages\AMD64.VCPlatform.Express.config" -copy "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages\Itanium.VCPlatform.config" "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages\Itanium.VCPlatform.Express.config" \ No newline at end of file +copy "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages\Itanium.VCPlatform.config" "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages\Itanium.VCPlatform.Express.config" diff --git a/ci/appveyor/vs2008_patch/setup_x86.bat b/ci/appveyor/vs2008_patch/setup_x86.bat index 746dfe55f..1ec6cf6ed 100644 --- a/ci/appveyor/vs2008_patch/setup_x86.bat +++ b/ci/appveyor/vs2008_patch/setup_x86.bat @@ -10,4 +10,4 @@ regedit /s x86\656d8763-2429-11d7-8bf6-00b0d03daa06.reg regedit /s x86\656d8766-2429-11d7-8bf6-00b0d03daa06.reg copy "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcpackages\AMD64.VCPlatform.config" "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcpackages\AMD64.VCPlatform.Express.config" -copy "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcpackages\Itanium.VCPlatform.config" "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcpackages\Itanium.VCPlatform.Express.config" \ No newline at end of file +copy "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcpackages\Itanium.VCPlatform.config" "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcpackages\Itanium.VCPlatform.Express.config" diff --git a/docs/faq.rst b/docs/faq.rst index 9f1438ef6..ff460c31e 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -32,7 +32,7 @@ Variable length array Any supported type Unsupported types: ========================= ============================================ -Type Status +Type Status ========================= ============================================ HDF5 "time" type NumPy "U" strings No HDF5 equivalent @@ -61,7 +61,7 @@ What file drivers are available? -------------------------------- A number of different HDF5 "drivers", which provide different modes of access -to the filesystem, are accessible in h5py via the high-level interface. The +to the filesystem, are accessible in h5py via the high-level interface. The currently supported drivers are: =================================== =========================================== ============================ @@ -95,10 +95,10 @@ This layer is object-oriented with respect to HDF5 identifiers, supports reference counting, automatic translation between NumPy and HDF5 type objects, translation between the HDF5 error stack and Python exceptions, and more. -This greatly simplifies the design of the complicated high-level interface, by +This greatly simplifies the design of the complicated high-level interface, by relying on the "Pythonicity" of the C API wrapping. -There's also a PyTables perspective on this question at the +There's also a PyTables perspective on this question at the `PyTables FAQ `_. @@ -138,14 +138,14 @@ Appending data to a dataset The short response is that h5py is NumPy-like, not database-like. Unlike the HDF5 packet-table interface (and PyTables), there is no concept of appending rows. Rather, you can expand the shape of the dataset to fit your needs. For -example, if I have a series of time traces 1024 points long, I can create an +example, if I have a series of time traces 1024 points long, I can create an extendable dataset to store them: >>> dset = myfile.create_dataset("MyDataset", (10, 1024), maxshape=(None, 1024)) >>> dset.shape (10,1024) -The keyword argument "maxshape" tells HDF5 that the first dimension of the +The keyword argument "maxshape" tells HDF5 that the first dimension of the dataset can be expanded to any size, while the second dimension is limited to a maximum size of 1024. We create the dataset with room for an initial ensemble of 10 time traces. If we later want to store 10 more time traces, the dataset @@ -163,7 +163,7 @@ Each axis can be resized up to the maximum values in "maxshape". Things to note: Unicode ------- -As of h5py 2.0.0, Unicode is supported for file names as well as for objects +As of h5py 2.0.0, Unicode is supported for file names as well as for objects in the file. When object names are read, they are returned as Unicode by default. However, HDF5 has no predefined datatype to represent fixed-width UTF-16 or @@ -205,6 +205,3 @@ containing a compiled, shared-library build of HDF5 (containing things like "inc $ python setup.py test Report any failing tests to the mailing list (h5py at googlegroups), or by filing a bug report at GitHub. - - - diff --git a/docs/high/attr.rst b/docs/high/attr.rst index b67cbc2bc..5e6890f74 100644 --- a/docs/high/attr.rst +++ b/docs/high/attr.rst @@ -117,6 +117,3 @@ Reference :type name: String :param value: New value. Will be put through ``numpy.array(value)``. - - - diff --git a/docs/high/file.rst b/docs/high/file.rst index 40631aeb8..196e03394 100644 --- a/docs/high/file.rst +++ b/docs/high/file.rst @@ -53,7 +53,7 @@ of supported drivers and their options: 'sec2' Unbuffered, optimized I/O using standard POSIX functions. - 'stdio' + 'stdio' Buffered I/O using functions from stdio.h. 'core' diff --git a/docs/high/group.rst b/docs/high/group.rst index 2e9cf4ae4..474fea87b 100644 --- a/docs/high/group.rst +++ b/docs/high/group.rst @@ -86,7 +86,7 @@ is to create an :ref:`HDF5 datasets `:: >>> out = grp["name"] >>> out - + When the object being stored is an existing Group or Dataset, a new link is made to the object:: @@ -430,7 +430,7 @@ Link classes :param filename: Name of the file to which the link points :type filename: String - + :param path: Path to the object in the external file. :type path: String diff --git a/docs/index.rst b/docs/index.rst index be61a0505..aba093d26 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -52,7 +52,7 @@ Advanced topics .. toctree:: :maxdepth: 1 - + config special strings diff --git a/docs/licenses.rst b/docs/licenses.rst index 597607605..20c4f441c 100644 --- a/docs/licenses.rst +++ b/docs/licenses.rst @@ -22,8 +22,8 @@ Copyright Notice and Statement for the h5py Project documentation and/or other materials provided with the distribution. - c. Neither the name of the author nor the names of contributors may - be used to endorse or promote products derived from this software + c. Neither the name of the author nor the names of contributors may + be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS @@ -179,7 +179,7 @@ stdint.h (Windows version) License EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @@ -229,4 +229,3 @@ Python license #. By copying, installing or otherwise using Python Python 2.7.5, Licensee agrees to be bound by the terms and conditions of this License Agreement. - diff --git a/docs/mpi.rst b/docs/mpi.rst index 4336d821d..80168c0d5 100644 --- a/docs/mpi.rst +++ b/docs/mpi.rst @@ -147,4 +147,3 @@ More information Parallel HDF5 is a new feature in h5py. If you have any questions, feel free to ask on the mailing list (h5py at google groups). We welcome bug reports, enhancements and general inquiries. - diff --git a/docs/quick.rst b/docs/quick.rst index e9ab7c034..f6f96ea68 100644 --- a/docs/quick.rst +++ b/docs/quick.rst @@ -185,5 +185,3 @@ implements the dictionary interface:: True For more, see :ref:`attributes`. - - diff --git a/docs/refs.rst b/docs/refs.rst index bb5cf6f5e..a97a70f45 100644 --- a/docs/refs.rst +++ b/docs/refs.rst @@ -45,7 +45,7 @@ opening any other object: Using region references ----------------------- -Region references always contain a selection. You create them using the +Region references always contain a selection. You create them using the dataset property "regionref" and standard NumPy slicing syntax: >>> myds = myfile.create_dataset('dset', (200,200)) @@ -119,5 +119,3 @@ indicate whether or not it is null: >>> nullref = ref_dataset[50] >>> print bool(nullref) False - - diff --git a/docs/special.rst b/docs/special.rst index d0c2c9e0f..7ea0319f9 100644 --- a/docs/special.rst +++ b/docs/special.rst @@ -62,7 +62,7 @@ dtype. In h5py, variable-length strings are mapped to object arrays. A small amount of metadata attached to an "O" dtype tells h5py that its contents should be converted to VL strings when stored in the file. -Existing VL strings can be read and written to with no additional effort; +Existing VL strings can be read and written to with no additional effort; Python strings and fixed-length NumPy strings can be auto-converted to VL data and stored. @@ -100,7 +100,7 @@ arrays:: >>> dset[0:2] array([array([1, 2, 3], dtype=int32), array([1, 2, 3, 4, 5], dtype=int32)], dtype=object) - + Enumerated types ---------------- diff --git a/docs/swmr.rst b/docs/swmr.rst index 1740d50c9..2d3fd2d74 100644 --- a/docs/swmr.rst +++ b/docs/swmr.rst @@ -8,25 +8,25 @@ Starting with version 2.5.0, h5py includes support for the HDF5 SWMR features. What is SWMR? ------------- -The SWMR features allow simple concurrent reading of a HDF5 file while it is +The SWMR features allow simple concurrent reading of a HDF5 file while it is being written from another process. Prior to this feature addition it was not possible to do this as the file data and meta-data would not be synchronised and attempts to read a file which was open for writing would fail or result in garbage data. A file which is being written to in SWMR mode is guaranteed to always be in a -valid (non-corrupt) state for reading. This has the added benefit of leaving a -file in a valid state even if the writing application crashes before closing +valid (non-corrupt) state for reading. This has the added benefit of leaving a +file in a valid state even if the writing application crashes before closing the file properly. This feature has been implemented to work with independent writer and reader processes. No synchronisation is required between processes and it is up to the -user to implement either a file polling mechanism, inotify or any other IPC +user to implement either a file polling mechanism, inotify or any other IPC mechanism to notify when data has been written. The SWMR functionality requires use of the latest HDF5 file format: v110. In -practice this implies using at least HDF5 1.10 (this can be checked via -`h5py.info`) and setting the libver bounding to "latest" when opening or +practice this implies using at least HDF5 1.10 (this can be checked via +`h5py.info`) and setting the libver bounding to "latest" when opening or creating the file. @@ -87,7 +87,7 @@ Examples -------- In addition to the above example snippets, a few more complete examples can be -found in the examples folder. These examples are described in the following +found in the examples folder. These examples are described in the following sections Dataset monitor with inotify @@ -95,8 +95,8 @@ Dataset monitor with inotify The inotify example demonstrate how to use SWMR in a reading application which monitors live progress as a dataset is being written by another process. This -example uses the the linux inotify -(`pyinotify `_ python bindings) to +example uses the the linux inotify +(`pyinotify `_ python bindings) to receive a signal each time the target file has been updated. .. literalinclude:: ../examples/swmr_inotify_example.py @@ -104,13 +104,13 @@ receive a signal each time the target file has been updated. Multiprocess concurrent write and read ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The SWMR multiprocess example starts two concurrent child processes: +The SWMR multiprocess example starts two concurrent child processes: a writer and a reader. The writer process first creates the target file and dataset. Then it switches the file into SWMR mode and the reader process is notified (with a multiprocessing.Event) that it is safe to open the file for reading. -The writer process then continue to append chunks to the dataset. After each +The writer process then continue to append chunks to the dataset. After each write it notifies the reader that new data has been written. Whether the new data is visible in the file at this point is subject to OS and file system latencies. @@ -126,7 +126,7 @@ it will drop out of the loop and exit. The example output below (from a virtual Ubuntu machine) illustrate some latency between the writer and reader:: - python examples/swmr_multiprocess.py + python examples/swmr_multiprocess.py INFO 2015-02-26 18:05:03,195 root Starting reader INFO 2015-02-26 18:05:03,196 root Starting reader INFO 2015-02-26 18:05:03,197 reader Waiting for initial event @@ -150,5 +150,3 @@ latency between the writer and reader:: INFO 2015-02-26 18:05:03,217 reader Read dset shape: (20,) INFO 2015-02-26 18:05:03,218 reader Read dset shape: (20,) INFO 2015-02-26 18:05:03,219 root Waiting for reader to finish - - diff --git a/docs/whatsnew/2.0.rst b/docs/whatsnew/2.0.rst index fc7698ee6..d8084a760 100644 --- a/docs/whatsnew/2.0.rst +++ b/docs/whatsnew/2.0.rst @@ -166,12 +166,3 @@ Known issues * There are reports of crashes related to storing object and region references. If this happens to you, please post on the mailing list or contact the h5py author directly. - - - - - - - - - diff --git a/docs/whatsnew/2.2.rst b/docs/whatsnew/2.2.rst index 69835e6a9..ec309863b 100644 --- a/docs/whatsnew/2.2.rst +++ b/docs/whatsnew/2.2.rst @@ -6,7 +6,7 @@ Support for Parallel HDF5 ------------------------- On UNIX platforms, you can now take advantage of MPI and Parallel HDF5. -Cython, ``mpi4py`` and an MPI-enabled build of HDF5 are required.. +Cython, ``mpi4py`` and an MPI-enabled build of HDF5 are required.. See :ref:`parallel` in the documentation for details. @@ -98,4 +98,3 @@ The method ``Group.move`` allows this to be performed in one step:: >>> f.move('a', 'b') Both the source and destination must be in the same file. - diff --git a/docs/whatsnew/2.4.rst b/docs/whatsnew/2.4.rst index e63169933..7525fb384 100644 --- a/docs/whatsnew/2.4.rst +++ b/docs/whatsnew/2.4.rst @@ -6,17 +6,17 @@ Build system changes The setup.py-based build system has been reworked to be more maintainable, and to fix certain long-standing bugs. As a consequence, the options to setup.py -have changed; a new top-level "configure" command handles options like +have changed; a new top-level "configure" command handles options like ``--hdf5=/path/to/hdf5`` and ``--mpi``. Setup.py now works correctly under Python 3 when these options are used. Cython (0.17+) is now required when building from source on all platforms; -the .c files are no longer shipped in the UNIX release. The minimum NumPy +the .c files are no longer shipped in the UNIX release. The minimum NumPy version is now 1.6.1. Files will now auto-close ------------------------- - + Files are now automatically closed when all objects within them are unreachable. Previously, if File.close() was not explicitly called, files would remain open and "leaks" were possible if the File object diff --git a/docs/whatsnew/2.5.rst b/docs/whatsnew/2.5.rst index 5a710ff6b..eabce2a5b 100644 --- a/docs/whatsnew/2.5.rst +++ b/docs/whatsnew/2.5.rst @@ -64,4 +64,3 @@ Other changes Acknowledgements ---------------- - diff --git a/docs/whatsnew/2.7.rst b/docs/whatsnew/2.7.rst index 536fa8cf1..5f76a26a4 100644 --- a/docs/whatsnew/2.7.rst +++ b/docs/whatsnew/2.7.rst @@ -92,4 +92,3 @@ Other changes Acknowledgements ---------------- - diff --git a/docs_api/h5.rst b/docs_api/h5.rst index 793a9cfda..80233e311 100644 --- a/docs_api/h5.rst +++ b/docs_api/h5.rst @@ -39,6 +39,3 @@ Module constants .. data:: ITER_DEC Traverse index in decreasing order - - - diff --git a/docs_api/h5a.rst b/docs_api/h5a.rst index 9c6ac4afe..b99854c6b 100644 --- a/docs_api/h5a.rst +++ b/docs_api/h5a.rst @@ -26,5 +26,3 @@ Attribute objects .. autoclass:: AttrID :members: - - diff --git a/docs_api/h5d.rst b/docs_api/h5d.rst index 7b59be380..e7aeacaf4 100644 --- a/docs_api/h5d.rst +++ b/docs_api/h5d.rst @@ -20,9 +20,9 @@ Allocation times ~~~~~~~~~~~~~~~~ .. data:: ALLOC_TIME_DEFAULT -.. data:: ALLOC_TIME_LATE +.. data:: ALLOC_TIME_LATE .. data:: ALLOC_TIME_EARLY -.. data:: ALLOC_TIME_INCR +.. data:: ALLOC_TIME_INCR Allocation status ~~~~~~~~~~~~~~~~~ @@ -44,4 +44,3 @@ Fill values .. data:: FILL_VALUE_UNDEFINED .. data:: FILL_VALUE_DEFAULT .. data:: FILL_VALUE_USER_DEFINED - diff --git a/docs_api/h5f.rst b/docs_api/h5f.rst index a8c3436f5..c386f5479 100644 --- a/docs_api/h5f.rst +++ b/docs_api/h5f.rst @@ -83,5 +83,3 @@ Library version bounding .. data:: LIBVER_EARLIEST .. data:: LIBVER_LATEST - - diff --git a/docs_api/h5fd.rst b/docs_api/h5fd.rst index a04254f0e..fcc3efea7 100644 --- a/docs_api/h5fd.rst +++ b/docs_api/h5fd.rst @@ -37,7 +37,7 @@ Logging driver settings .. data:: LOG_LOC_SEEK .. data:: LOG_LOC_IO -.. data:: LOG_FILE_READ +.. data:: LOG_FILE_READ .. data:: LOG_FILE_WRITE .. data:: LOG_FILE_IO @@ -57,5 +57,3 @@ Logging driver settings .. data:: LOG_ALLOC .. data:: LOG_ALL - - diff --git a/docs_api/h5g.rst b/docs_api/h5g.rst index f4419e93b..abf94ee7e 100644 --- a/docs_api/h5g.rst +++ b/docs_api/h5g.rst @@ -50,14 +50,3 @@ Link type codes .. data:: LINK_HARD .. data:: LINK_SOFT - - - - - - - - - - - diff --git a/docs_api/h5i.rst b/docs_api/h5i.rst index 3b4de13b5..364a56b81 100644 --- a/docs_api/h5i.rst +++ b/docs_api/h5i.rst @@ -23,4 +23,3 @@ Identifier classes .. data:: GENPROP_CLS .. data:: GENPROP_LST .. data:: DATATYPE - diff --git a/docs_api/h5o.rst b/docs_api/h5o.rst index 0f0c41e13..224499dce 100644 --- a/docs_api/h5o.rst +++ b/docs_api/h5o.rst @@ -54,4 +54,3 @@ Copy flags .. data:: COPY_WITHOUT_ATTR_FLAG Copy object without copying attributes. - diff --git a/docs_api/h5p.rst b/docs_api/h5p.rst index 2a1d4eb2e..6caaec386 100644 --- a/docs_api/h5p.rst +++ b/docs_api/h5p.rst @@ -92,4 +92,3 @@ Predefined classes .. data:: LINK_CREATE .. data:: LINK_ACCESS .. data:: GROUP_CREATE - diff --git a/docs_api/h5r.rst b/docs_api/h5r.rst index cc0290c77..3d854df91 100644 --- a/docs_api/h5r.rst +++ b/docs_api/h5r.rst @@ -32,5 +32,3 @@ API constants .. data:: DATASET_REGION Typecode for dataset region references - - diff --git a/docs_api/h5s.rst b/docs_api/h5s.rst index 2a08248e4..32f12195e 100644 --- a/docs_api/h5s.rst +++ b/docs_api/h5s.rst @@ -25,7 +25,7 @@ Module constants Accepted in place of an actual dataspace; means "every point" .. data:: UNLIMITED - + Indicates an unlimited maximum dimension Dataspace class codes @@ -56,7 +56,3 @@ Existing selection type .. data:: SEL_POINTS .. data:: SEL_HYPERSLABS .. data:: SEL_ALL - - - - diff --git a/docs_api/h5t.rst b/docs_api/h5t.rst index d04fb8b06..24b046acb 100644 --- a/docs_api/h5t.rst +++ b/docs_api/h5t.rst @@ -36,7 +36,7 @@ inherited from the base class :class:`TypeAtomicID`. .. autoclass:: TypeAtomicID :show-inheritance: :members: - + .. autoclass:: TypeIntegerID :show-inheritance: :members: @@ -138,7 +138,7 @@ Integer types .. data:: NATIVE_INT64 .. data:: NATIVE_UINT64 .. data:: NATIVE_FLOAT -.. data:: NATIVE_DOUBLE +.. data:: NATIVE_DOUBLE Reference types ~~~~~~~~~~~~~~~ @@ -156,7 +156,7 @@ String types .. data:: FORTRAN_S1 Zero-padded fixed-length string - + .. data:: VARIABLE Variable-length string @@ -219,16 +219,3 @@ API Constants .. data:: BKG_NO .. data:: BKG_TEMP .. data:: BKG_YES - - - - - - - - - - - - - diff --git a/docs_api/h5z.rst b/docs_api/h5z.rst index 22d85b695..abf449ea5 100644 --- a/docs_api/h5z.rst +++ b/docs_api/h5z.rst @@ -61,5 +61,3 @@ Other flags .. data:: DISABLE_EDC .. data:: ENABLE_EDC .. data:: NO_EDC - - diff --git a/docs_api/index.rst b/docs_api/index.rst index d5b635664..7bff1ae74 100644 --- a/docs_api/index.rst +++ b/docs_api/index.rst @@ -38,4 +38,4 @@ Contents h5r h5s h5t - h5z \ No newline at end of file + h5z diff --git a/h5py/_conv.pxd b/h5py/_conv.pxd index 63611ba9a..86a3436d4 100644 --- a/h5py/_conv.pxd +++ b/h5py/_conv.pxd @@ -8,7 +8,3 @@ # and contributor agreement. from defs cimport * - - - - diff --git a/h5py/_errors.pxd b/h5py/_errors.pxd index e4d8732b3..8b1be2864 100644 --- a/h5py/_errors.pxd +++ b/h5py/_errors.pxd @@ -12,205 +12,205 @@ from api_types_hdf5 cimport * # Auto-set exception. Returns 1 if exception set, 0 if no HDF5 error found. cdef int set_exception() except -1 -cdef extern from "hdf5.h": +cdef extern from "hdf5.h": ctypedef enum H5E_major_t: - H5E_NONE_MAJOR = 0, # special zero, no error - H5E_ARGS, # invalid arguments to routine - H5E_RESOURCE, # resource unavailable + H5E_NONE_MAJOR = 0, # special zero, no error + H5E_ARGS, # invalid arguments to routine + H5E_RESOURCE, # resource unavailable H5E_INTERNAL, # Internal error (too specific to document) - H5E_FILE, # file Accessability - H5E_IO, # Low-level I/O - H5E_FUNC, # function Entry/Exit - H5E_ATOM, # object Atom - H5E_CACHE, # object Cache - H5E_BTREE, # B-Tree Node - H5E_SYM, # symbol Table - H5E_HEAP, # Heap - H5E_OHDR, # object Header - H5E_DATATYPE, # Datatype - H5E_DATASPACE, # Dataspace - H5E_DATASET, # Dataset - H5E_STORAGE, # data storage - H5E_PLIST, # Property lists - H5E_ATTR, # Attribute - H5E_PLINE, # Data filters - H5E_EFL, # External file list - H5E_REFERENCE, # References - H5E_VFL, # Virtual File Layer + H5E_FILE, # file Accessability + H5E_IO, # Low-level I/O + H5E_FUNC, # function Entry/Exit + H5E_ATOM, # object Atom + H5E_CACHE, # object Cache + H5E_BTREE, # B-Tree Node + H5E_SYM, # symbol Table + H5E_HEAP, # Heap + H5E_OHDR, # object Header + H5E_DATATYPE, # Datatype + H5E_DATASPACE, # Dataspace + H5E_DATASET, # Dataset + H5E_STORAGE, # data storage + H5E_PLIST, # Property lists + H5E_ATTR, # Attribute + H5E_PLINE, # Data filters + H5E_EFL, # External file list + H5E_REFERENCE, # References + H5E_VFL, # Virtual File Layer # H5E_TBBT, # Threaded, Balanced, Binary Trees (not in 1.8) - H5E_TST, # Ternary Search Trees - H5E_RS, # Reference Counted Strings - H5E_ERROR, # Error API - H5E_SLIST # Skip Lists + H5E_TST, # Ternary Search Trees + H5E_RS, # Reference Counted Strings + H5E_ERROR, # Error API + H5E_SLIST # Skip Lists ctypedef enum H5E_minor_t: - # Generic low-level file I/O errors - H5E_SEEKERROR # Seek failed - H5E_READERROR # Read failed - H5E_WRITEERROR # Write failed - H5E_CLOSEERROR # Close failed - H5E_OVERFLOW # Address overflowed + # Generic low-level file I/O errors + H5E_SEEKERROR # Seek failed + H5E_READERROR # Read failed + H5E_WRITEERROR # Write failed + H5E_CLOSEERROR # Close failed + H5E_OVERFLOW # Address overflowed H5E_FCNTL # File control (fcntl) failed - # Resource errors - H5E_NOSPACE # No space available for allocation - H5E_CANTALLOC # Can't allocate space - H5E_CANTCOPY # Unable to copy object - H5E_CANTFREE # Unable to free object - H5E_ALREADYEXISTS # Object already exists - H5E_CANTLOCK # Unable to lock object - H5E_CANTUNLOCK # Unable to unlock object - H5E_CANTGC # Unable to garbage collect - H5E_CANTGETSIZE # Unable to compute size - H5E_OBJOPEN # Object is already open - - # Heap errors - H5E_CANTRESTORE # Can't restore condition - H5E_CANTCOMPUTE # Can't compute value - H5E_CANTEXTEND # Can't extend heap's space - H5E_CANTATTACH # Can't attach object - H5E_CANTUPDATE # Can't update object - H5E_CANTOPERATE # Can't operate on object - - # Function entry/exit interface errors - H5E_CANTINIT # Unable to initialize object - H5E_ALREADYINIT # Object already initialized - H5E_CANTRELEASE # Unable to release object - - # Property list errors - H5E_CANTGET # Can't get value - H5E_CANTSET # Can't set value - H5E_DUPCLASS # Duplicate class name in parent class - - # Free space errors - H5E_CANTMERGE # Can't merge objects - H5E_CANTREVIVE # Can't revive object - H5E_CANTSHRINK # Can't shrink container - - # Object header related errors - H5E_LINKCOUNT # Bad object header link - H5E_VERSION # Wrong version number - H5E_ALIGNMENT # Alignment error - H5E_BADMESG # Unrecognized message - H5E_CANTDELETE # Can't delete message - H5E_BADITER # Iteration failed - H5E_CANTPACK # Can't pack messages - H5E_CANTRESET # Can't reset object count - - # System level errors - H5E_SYSERRSTR # System error message - - # I/O pipeline errors - H5E_NOFILTER # Requested filter is not available - H5E_CALLBACK # Callback failed - H5E_CANAPPLY # Error from filter 'can apply' callback - H5E_SETLOCAL # Error from filter 'set local' callback - H5E_NOENCODER # Filter present but encoding disabled - H5E_CANTFILTER # Filter operation failed - - # Group related errors - H5E_CANTOPENOBJ # Can't open object - H5E_CANTCLOSEOBJ # Can't close object - H5E_COMPLEN # Name component is too long - H5E_PATH # Problem with path to object - - # No error - H5E_NONE_MINOR # No error - - # File accessability errors - H5E_FILEEXISTS # File already exists - H5E_FILEOPEN # File already open + # Resource errors + H5E_NOSPACE # No space available for allocation + H5E_CANTALLOC # Can't allocate space + H5E_CANTCOPY # Unable to copy object + H5E_CANTFREE # Unable to free object + H5E_ALREADYEXISTS # Object already exists + H5E_CANTLOCK # Unable to lock object + H5E_CANTUNLOCK # Unable to unlock object + H5E_CANTGC # Unable to garbage collect + H5E_CANTGETSIZE # Unable to compute size + H5E_OBJOPEN # Object is already open + + # Heap errors + H5E_CANTRESTORE # Can't restore condition + H5E_CANTCOMPUTE # Can't compute value + H5E_CANTEXTEND # Can't extend heap's space + H5E_CANTATTACH # Can't attach object + H5E_CANTUPDATE # Can't update object + H5E_CANTOPERATE # Can't operate on object + + # Function entry/exit interface errors + H5E_CANTINIT # Unable to initialize object + H5E_ALREADYINIT # Object already initialized + H5E_CANTRELEASE # Unable to release object + + # Property list errors + H5E_CANTGET # Can't get value + H5E_CANTSET # Can't set value + H5E_DUPCLASS # Duplicate class name in parent class + + # Free space errors + H5E_CANTMERGE # Can't merge objects + H5E_CANTREVIVE # Can't revive object + H5E_CANTSHRINK # Can't shrink container + + # Object header related errors + H5E_LINKCOUNT # Bad object header link + H5E_VERSION # Wrong version number + H5E_ALIGNMENT # Alignment error + H5E_BADMESG # Unrecognized message + H5E_CANTDELETE # Can't delete message + H5E_BADITER # Iteration failed + H5E_CANTPACK # Can't pack messages + H5E_CANTRESET # Can't reset object count + + # System level errors + H5E_SYSERRSTR # System error message + + # I/O pipeline errors + H5E_NOFILTER # Requested filter is not available + H5E_CALLBACK # Callback failed + H5E_CANAPPLY # Error from filter 'can apply' callback + H5E_SETLOCAL # Error from filter 'set local' callback + H5E_NOENCODER # Filter present but encoding disabled + H5E_CANTFILTER # Filter operation failed + + # Group related errors + H5E_CANTOPENOBJ # Can't open object + H5E_CANTCLOSEOBJ # Can't close object + H5E_COMPLEN # Name component is too long + H5E_PATH # Problem with path to object + + # No error + H5E_NONE_MINOR # No error + + # File accessability errors + H5E_FILEEXISTS # File already exists + H5E_FILEOPEN # File already open H5E_CANTCREATE # Unable to create file - H5E_CANTOPENFILE # Unable to open file - H5E_CANTCLOSEFILE # Unable to close file - H5E_NOTHDF5 # Not an HDF5 file - H5E_BADFILE # Bad file ID accessed + H5E_CANTOPENFILE # Unable to open file + H5E_CANTCLOSEFILE # Unable to close file + H5E_NOTHDF5 # Not an HDF5 file + H5E_BADFILE # Bad file ID accessed H5E_TRUNCATED # File has been truncated - H5E_MOUNT # File mount error - - # Object atom related errors - H5E_BADATOM # Unable to find atom information (already closed?) - H5E_BADGROUP # Unable to find ID group information - H5E_CANTREGISTER # Unable to register new atom - H5E_CANTINC # Unable to increment reference count - H5E_CANTDEC # Unable to decrement reference count - H5E_NOIDS # Out of IDs for group - - # Cache related errors - H5E_CANTFLUSH # Unable to flush data from cache - H5E_CANTSERIALIZE # Unable to serialize data from cache - H5E_CANTLOAD # Unable to load metadata into cache - H5E_PROTECT # Protected metadata error - H5E_NOTCACHED # Metadata not currently cached - H5E_SYSTEM # Internal error detected - H5E_CANTINS # Unable to insert metadata into cache - H5E_CANTRENAME # Unable to rename metadata - H5E_CANTPROTECT # Unable to protect metadata - H5E_CANTUNPROTECT # Unable to unprotect metadata - H5E_CANTPIN # Unable to pin cache entry - H5E_CANTUNPIN # Unable to un-pin cache entry - H5E_CANTMARKDIRTY # Unable to mark a pinned entry as dirty - H5E_CANTDIRTY # Unable to mark metadata as dirty - H5E_CANTEXPUNGE # Unable to expunge a metadata cache entry - H5E_CANTRESIZE # Unable to resize a metadata cache entry - - # Link related errors - H5E_TRAVERSE # Link traversal failure + H5E_MOUNT # File mount error + + # Object atom related errors + H5E_BADATOM # Unable to find atom information (already closed?) + H5E_BADGROUP # Unable to find ID group information + H5E_CANTREGISTER # Unable to register new atom + H5E_CANTINC # Unable to increment reference count + H5E_CANTDEC # Unable to decrement reference count + H5E_NOIDS # Out of IDs for group + + # Cache related errors + H5E_CANTFLUSH # Unable to flush data from cache + H5E_CANTSERIALIZE # Unable to serialize data from cache + H5E_CANTLOAD # Unable to load metadata into cache + H5E_PROTECT # Protected metadata error + H5E_NOTCACHED # Metadata not currently cached + H5E_SYSTEM # Internal error detected + H5E_CANTINS # Unable to insert metadata into cache + H5E_CANTRENAME # Unable to rename metadata + H5E_CANTPROTECT # Unable to protect metadata + H5E_CANTUNPROTECT # Unable to unprotect metadata + H5E_CANTPIN # Unable to pin cache entry + H5E_CANTUNPIN # Unable to un-pin cache entry + H5E_CANTMARKDIRTY # Unable to mark a pinned entry as dirty + H5E_CANTDIRTY # Unable to mark metadata as dirty + H5E_CANTEXPUNGE # Unable to expunge a metadata cache entry + H5E_CANTRESIZE # Unable to resize a metadata cache entry + + # Link related errors + H5E_TRAVERSE # Link traversal failure H5E_NLINKS # Too many soft links in path - H5E_NOTREGISTERED # Link class not registered + H5E_NOTREGISTERED # Link class not registered H5E_CANTMOVE # Move callback returned error - H5E_CANTSORT # Can't sort objects + H5E_CANTSORT # Can't sort objects - # Parallel MPI errors + # Parallel MPI errors H5E_MPI # Some MPI function failed - H5E_MPIERRSTR # MPI Error String - H5E_CANTRECV # Can't receive data - - # Dataspace errors - H5E_CANTCLIP # Can't clip hyperslab region - H5E_CANTCOUNT # Can't count elements - H5E_CANTSELECT # Can't select hyperslab - H5E_CANTNEXT # Can't move to next iterator location - H5E_BADSELECT # Invalid selection - H5E_CANTCOMPARE # Can't compare objects - - # Argument errors - H5E_UNINITIALIZED # Information is uinitialized - H5E_UNSUPPORTED # Feature is unsupported - H5E_BADTYPE # Inappropriate type - H5E_BADRANGE # Out of range - H5E_BADVALUE # Bad value - - # B-tree related errors - H5E_NOTFOUND # Object not found - H5E_EXISTS # Object already exists - H5E_CANTENCODE # Unable to encode value - H5E_CANTDECODE # Unable to decode value - H5E_CANTSPLIT # Unable to split node - H5E_CANTREDISTRIBUTE # Unable to redistribute records - H5E_CANTSWAP # Unable to swap records - H5E_CANTINSERT # Unable to insert object - H5E_CANTLIST # Unable to list node - H5E_CANTMODIFY # Unable to modify record - H5E_CANTREMOVE # Unable to remove object - - # Datatype conversion errors - H5E_CANTCONVERT # Can't convert datatypes - H5E_BADSIZE # Bad size for object - + H5E_MPIERRSTR # MPI Error String + H5E_CANTRECV # Can't receive data + + # Dataspace errors + H5E_CANTCLIP # Can't clip hyperslab region + H5E_CANTCOUNT # Can't count elements + H5E_CANTSELECT # Can't select hyperslab + H5E_CANTNEXT # Can't move to next iterator location + H5E_BADSELECT # Invalid selection + H5E_CANTCOMPARE # Can't compare objects + + # Argument errors + H5E_UNINITIALIZED # Information is uinitialized + H5E_UNSUPPORTED # Feature is unsupported + H5E_BADTYPE # Inappropriate type + H5E_BADRANGE # Out of range + H5E_BADVALUE # Bad value + + # B-tree related errors + H5E_NOTFOUND # Object not found + H5E_EXISTS # Object already exists + H5E_CANTENCODE # Unable to encode value + H5E_CANTDECODE # Unable to decode value + H5E_CANTSPLIT # Unable to split node + H5E_CANTREDISTRIBUTE # Unable to redistribute records + H5E_CANTSWAP # Unable to swap records + H5E_CANTINSERT # Unable to insert object + H5E_CANTLIST # Unable to list node + H5E_CANTMODIFY # Unable to modify record + H5E_CANTREMOVE # Unable to remove object + + # Datatype conversion errors + H5E_CANTCONVERT # Can't convert datatypes + H5E_BADSIZE # Bad size for object + cdef enum H5E_direction_t: - H5E_WALK_UPWARD = 0 # begin deep, end at API function - H5E_WALK_DOWNWARD = 1 # begin at API function, end deep + H5E_WALK_UPWARD = 0 # begin deep, end at API function + H5E_WALK_DOWNWARD = 1 # begin at API function, end deep ctypedef struct H5E_error_t: - H5E_major_t maj_num # major error number - H5E_minor_t min_num # minor error number - char *func_name # function in which error occurred - char *file_name # file in which error occurred - unsigned line # line in file where error occurs - char *desc # optional supplied description + H5E_major_t maj_num # major error number + H5E_minor_t min_num # minor error number + char *func_name # function in which error occurred + char *file_name # file in which error occurred + unsigned line # line in file where error occurs + char *desc # optional supplied description char *H5Eget_major(H5E_major_t n) char *H5Eget_minor(H5E_minor_t n) @@ -222,7 +222,7 @@ cdef extern from "hdf5.h": herr_t H5Eprint(void *stream) - ctypedef herr_t (*H5E_walk_t)(int n, H5E_error_t *err_desc, void* client_data) + ctypedef herr_t (*H5E_walk_t)(int n, H5E_error_t *err_desc, void* client_data) herr_t H5Ewalk(H5E_direction_t direction, H5E_walk_t func, void* client_data) # --- Functions for managing the HDF5 error callback mechanism --- @@ -235,4 +235,3 @@ ctypedef struct err_cookie: # Set (via H5Eset_auto) the HDF5 error handler for this thread. Returns # the old (presently installed) handler. cdef err_cookie set_error_handler(err_cookie handler) - diff --git a/h5py/_locks.pxi b/h5py/_locks.pxi index 6672b5829..bc8b2dd92 100644 --- a/h5py/_locks.pxi +++ b/h5py/_locks.pxi @@ -125,4 +125,3 @@ cdef inline void unlock_lock(FastRLock lock) nogil: pythread.PyThread_release_lock(lock._real_lock) lock._is_locked = False ## end of http://code.activestate.com/recipes/577336/ }}} - diff --git a/h5py/_objects.pxd b/h5py/_objects.pxd index 46ced0d76..a7a2a300f 100644 --- a/h5py/_objects.pxd +++ b/h5py/_objects.pxd @@ -29,4 +29,3 @@ cdef int is_h5py_obj_valid(ObjectID obj) # h5p # h5d, h5a, h5f, h5g # h5l - diff --git a/h5py/_proxy.pxd b/h5py/_proxy.pxd index 84901e5d3..def48c639 100644 --- a/h5py/_proxy.pxd +++ b/h5py/_proxy.pxd @@ -13,4 +13,3 @@ cdef herr_t attr_rw(hid_t attr, hid_t mtype, void *progbuf, int read) except -1 cdef herr_t dset_rw(hid_t dset, hid_t mtype, hid_t mspace, hid_t fspace, hid_t dxpl, void* progbuf, int read) except -1 - diff --git a/h5py/h5.pxd b/h5py/h5.pxd index 38bd15c64..6cbfa5dfd 100644 --- a/h5py/h5.pxd +++ b/h5py/h5.pxd @@ -20,5 +20,3 @@ cdef class H5PYConfig: cdef readonly object _bytestrings cpdef H5PYConfig get_config() - - diff --git a/h5py/h5a.pxd b/h5py/h5a.pxd index 6a0cd7612..6aa45fa9a 100644 --- a/h5py/h5a.pxd +++ b/h5py/h5a.pxd @@ -13,4 +13,3 @@ from _objects cimport ObjectID cdef class AttrID(ObjectID): pass - diff --git a/h5py/h5d.pxd b/h5py/h5d.pxd index 65bfac49f..8f45680c0 100644 --- a/h5py/h5d.pxd +++ b/h5py/h5d.pxd @@ -13,4 +13,3 @@ from _objects cimport ObjectID cdef class DatasetID(ObjectID): cdef object _dtype - diff --git a/h5py/h5f.pxd b/h5py/h5f.pxd index daa5cf7ec..c065e207a 100644 --- a/h5py/h5f.pxd +++ b/h5py/h5f.pxd @@ -14,5 +14,3 @@ from h5g cimport GroupID cdef class FileID(GroupID): pass - - diff --git a/h5py/h5fd.pxd b/h5py/h5fd.pxd index 00a7b8d9c..e589a9e2d 100644 --- a/h5py/h5fd.pxd +++ b/h5py/h5fd.pxd @@ -71,4 +71,3 @@ cdef extern from "hdf5.h": # /* Flag for tracking allocation of space in file */ int H5FD_LOG_ALLOC # 0x4000 int H5FD_LOG_ALL # (H5FD_LOG_ALLOC|H5FD_LOG_TIME_IO|H5FD_LOG_NUM_IO|H5FD_LOG_FLAVOR|H5FD_LOG_FILE_IO|H5FD_LOG_LOC_IO) - diff --git a/h5py/h5g.pxd b/h5py/h5g.pxd index 18a02a53c..113dc9cc7 100644 --- a/h5py/h5g.pxd +++ b/h5py/h5g.pxd @@ -14,6 +14,3 @@ from _objects cimport ObjectID cdef class GroupID(ObjectID): cdef readonly object links - - - diff --git a/h5py/h5l.pxd b/h5py/h5l.pxd index a12ec32fe..96cef337a 100644 --- a/h5py/h5l.pxd +++ b/h5py/h5l.pxd @@ -12,5 +12,3 @@ from defs cimport * cdef class LinkProxy: cdef hid_t id - - diff --git a/h5py/h5o.pxd b/h5py/h5o.pxd index 2e755104e..86a3436d4 100644 --- a/h5py/h5o.pxd +++ b/h5py/h5o.pxd @@ -8,4 +8,3 @@ # and contributor agreement. from defs cimport * - diff --git a/h5py/h5p.pyx b/h5py/h5p.pyx index 125f8529e..3bcf22d97 100644 --- a/h5py/h5p.pyx +++ b/h5py/h5p.pyx @@ -765,9 +765,9 @@ cdef class PropDCID(PropOCID): @with_phil def set_external(self, name, offset, size): '''(STR name, UINT offset, UINT size) - + Adds an external file to the list of external files for the dataset. - + The first call sets the external storage property in the property list, thus designating that the dataset will be stored in one or more non-HDF5 file(s) external to the HDF5 file.''' diff --git a/h5py/h5r.pxd b/h5py/h5r.pxd index a5deed4c0..44d18556b 100644 --- a/h5py/h5r.pxd +++ b/h5py/h5r.pxd @@ -26,4 +26,3 @@ cdef class Reference: cdef class RegionReference(Reference): pass - diff --git a/h5py/h5s.pxd b/h5py/h5s.pxd index d54719198..885ce0c1e 100644 --- a/h5py/h5s.pxd +++ b/h5py/h5s.pxd @@ -13,5 +13,3 @@ from _objects cimport class ObjectID cdef class SpaceID(ObjectID): pass - - diff --git a/h5py/h5t.pxd b/h5py/h5t.pxd index 16ddd9391..8745c08f5 100644 --- a/h5py/h5t.pxd +++ b/h5py/h5t.pxd @@ -68,13 +68,3 @@ cdef class TypeCompoundID(TypeCompositeID): cpdef TypeID typewrap(hid_t id_) cdef hid_t H5PY_OBJ cpdef TypeID py_create(object dtype, bint logical=*, bint aligned=*) - - - - - - - - - - diff --git a/h5py/h5z.pxd b/h5py/h5z.pxd index 2e755104e..86a3436d4 100644 --- a/h5py/h5z.pxd +++ b/h5py/h5z.pxd @@ -8,4 +8,3 @@ # and contributor agreement. from defs cimport * - diff --git a/h5py/numpy.pxd b/h5py/numpy.pxd index f17bb4b19..90ea7e31d 100644 --- a/h5py/numpy.pxd +++ b/h5py/numpy.pxd @@ -105,8 +105,3 @@ cdef extern from "numpy/arrayobject.h": void import_array() void* PyArray_DATA(ndarray arr) - - - - - diff --git a/h5py/utils.pxd b/h5py/utils.pxd index 620e6dae8..aaf6bbd1c 100644 --- a/h5py/utils.pxd +++ b/h5py/utils.pxd @@ -24,16 +24,3 @@ cdef int require_tuple(object tpl, int none_allowed, int size, char* name) excep cdef object create_numpy_hsize(int rank, hsize_t* dims) cdef object create_hsize_array(object arr) - - - - - - - - - - - - - diff --git a/licenses/license.txt b/licenses/license.txt index 26557ef85..ac98432bd 100644 --- a/licenses/license.txt +++ b/licenses/license.txt @@ -17,8 +17,8 @@ Copyright Notice and Statement for the h5py Project documentation and/or other materials provided with the distribution. - c. Neither the name of the author nor the names of contributors may - be used to endorse or promote products derived from this software + c. Neither the name of the author nor the names of contributors may + be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS diff --git a/licenses/python.txt b/licenses/python.txt index d03c1d1d4..1d49873f2 100644 --- a/licenses/python.txt +++ b/licenses/python.txt @@ -42,4 +42,3 @@ Python license #. By copying, installing or otherwise using Python Python 2.7.5, Licensee agrees to be bound by the terms and conditions of this License Agreement. - diff --git a/licenses/stdint.txt b/licenses/stdint.txt index 7e9941ad3..be8a46bc0 100644 --- a/licenses/stdint.txt +++ b/licenses/stdint.txt @@ -19,7 +19,7 @@ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/lzf/LICENSE.txt b/lzf/LICENSE.txt index 3787a0070..7b529d9d8 100644 --- a/lzf/LICENSE.txt +++ b/lzf/LICENSE.txt @@ -16,8 +16,8 @@ b. Redistributions in binary form must reproduce the above copyright documentation and/or other materials provided with the distribution. -c. Neither the name of the author nor the names of contributors may - be used to endorse or promote products derived from this software +c. Neither the name of the author nor the names of contributors may + be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS @@ -31,4 +31,3 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/lzf/README.txt b/lzf/README.txt index c5a1c3be7..2fd5083d0 100644 --- a/lzf/README.txt +++ b/lzf/README.txt @@ -88,9 +88,3 @@ Revision 2 Revision 1 Initial release. - - - - - - diff --git a/lzf/example.c b/lzf/example.c index 23dd776cf..d8a70d936 100644 --- a/lzf/example.c +++ b/lzf/example.c @@ -13,7 +13,7 @@ $ ./example Success! - $ h5ls -v test_lzf.hdf5 + $ h5ls -v test_lzf.hdf5 Opened "test_lzf.hdf5" with sec2 driver. dset Dataset {100/100, 100/100, 100/100} Location: 0:1:0:976 @@ -79,7 +79,7 @@ int main(){ dset = H5Dcreate(fid, "dset", H5T_NATIVE_FLOAT, sid, plist); if(dset<0) goto failed; - + r = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data); if(r<0) goto failed; @@ -103,4 +103,3 @@ int main(){ return return_code; } - diff --git a/lzf/lzf/lzf.h b/lzf/lzf/lzf.h index 919b6e6be..061d4cea9 100644 --- a/lzf/lzf/lzf.h +++ b/lzf/lzf/lzf.h @@ -1,16 +1,16 @@ /* * Copyright (c) 2000-2008 Marc Alexander Lehmann - * + * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -73,7 +73,7 @@ * and lzf_c.c. * */ -unsigned int +unsigned int lzf_compress (const void *const in_data, unsigned int in_len, void *out_data, unsigned int out_len); @@ -92,9 +92,8 @@ lzf_compress (const void *const in_data, unsigned int in_len, * * This function is very fast, about as fast as a copying loop. */ -unsigned int +unsigned int lzf_decompress (const void *const in_data, unsigned int in_len, void *out_data, unsigned int out_len); #endif - diff --git a/lzf/lzf/lzfP.h b/lzf/lzf/lzfP.h index b7af6a44c..ff5310dcb 100644 --- a/lzf/lzf/lzfP.h +++ b/lzf/lzf/lzfP.h @@ -1,16 +1,16 @@ /* * Copyright (c) 2000-2007 Marc Alexander Lehmann - * + * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -163,4 +163,3 @@ typedef const u8 *LZF_STATE[1 << (HLOG)]; #endif #endif - diff --git a/lzf/lzf/lzf_c.c b/lzf/lzf/lzf_c.c index fbfd4cce1..e021a2473 100644 --- a/lzf/lzf/lzf_c.c +++ b/lzf/lzf/lzf_c.c @@ -1,16 +1,16 @@ /* * Copyright (c) 2000-2008 Marc Alexander Lehmann - * + * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -293,4 +293,3 @@ lzf_compress (const void *const in_data, unsigned int in_len, return op - (u8 *)out_data; } - diff --git a/lzf/lzf/lzf_d.c b/lzf/lzf/lzf_d.c index 2e2eedaa1..cc665259e 100644 --- a/lzf/lzf/lzf_d.c +++ b/lzf/lzf/lzf_d.c @@ -1,16 +1,16 @@ /* * Copyright (c) 2000-2007 Marc Alexander Lehmann - * + * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -56,7 +56,7 @@ #endif */ -unsigned int +unsigned int lzf_decompress (const void *const in_data, unsigned int in_len, void *out_data, unsigned int out_len) { @@ -151,4 +151,3 @@ lzf_decompress (const void *const in_data, unsigned int in_len, return op - (u8 *)out_data; } - diff --git a/lzf/lzf_filter.c b/lzf/lzf_filter.c index 0e3a58bd1..1b973be69 100644 --- a/lzf/lzf_filter.c +++ b/lzf/lzf_filter.c @@ -1,13 +1,13 @@ /***** Preamble block ********************************************************* -* +* * This file is part of h5py, a low-level Python interface to the HDF5 library. -* +* * Copyright (C) 2008 Andrew Collette * http://h5py.alfven.org * License: BSD (See LICENSE.txt for full license) -* +* * $Date$ -* +* ****** End preamble block ****************************************************/ /* @@ -54,7 +54,7 @@ #if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8 && (H5_VERS_RELEASE < 3 || !H5_USE_16_API) #define H5PY_H5Z_NEWCLS 1 #else -#define H5PY_H5Z_NEWCLS 0 +#define H5PY_H5Z_NEWCLS 0 #endif size_t lzf_filter(unsigned flags, size_t cd_nelmts, @@ -209,7 +209,7 @@ size_t lzf_filter(unsigned flags, size_t cd_nelmts, #endif while(!status){ - + free(outbuf); outbuf = malloc(outbuf_size); @@ -250,7 +250,7 @@ size_t lzf_filter(unsigned flags, size_t cd_nelmts, *buf_size = outbuf_size; return status; /* Size of compressed/decompressed data */ - } + } failed: @@ -258,16 +258,3 @@ size_t lzf_filter(unsigned flags, size_t cd_nelmts, return 0; } /* End filter function */ - - - - - - - - - - - - - diff --git a/lzf/lzf_filter.h b/lzf/lzf_filter.h index 27dff83a9..4bf6747f5 100644 --- a/lzf/lzf_filter.h +++ b/lzf/lzf_filter.h @@ -1,13 +1,13 @@ /***** Preamble block ********************************************************* -* +* * This file is part of h5py, a low-level Python interface to the HDF5 library. -* +* * Copyright (C) 2008 Andrew Collette * http://h5py.alfven.org * License: BSD (See LICENSE.txt for full license) -* +* * $Date$ -* +* ****** End preamble block ****************************************************/ @@ -25,7 +25,7 @@ extern "C" { requests, contact the filter author directly. */ #define H5PY_FILTER_LZF 32000 -/* Register the filter with the library. Returns a negative value on failure, +/* Register the filter with the library. Returns a negative value on failure, and a non-negative value on success. */ int register_lzf(void); @@ -35,4 +35,3 @@ int register_lzf(void); #endif #endif - diff --git a/tox.ini b/tox.ini index 85a9ecb0a..6cda1057f 100644 --- a/tox.ini +++ b/tox.ini @@ -60,3 +60,11 @@ basepython = {env:TOXPYTHON:python} deps=readme_renderer commands= python setup.py check -s -r + +[testenv:pre-commit] +skip_install=True +basepython = {env:TOXPYTHON:python} +deps=pre-commit +passenv = HOMEPATH SSH_AUTH_SOCK +commands= + pre-commit run --all-files diff --git a/windows/README.txt b/windows/README.txt index 1f9cad4f1..bee4cd473 100644 --- a/windows/README.txt +++ b/windows/README.txt @@ -12,12 +12,12 @@ on the path. To build HDF5 with Visual Studio 2008 (required for Python 2.6, 2.7 and 3.2): paver build_2008 - + To build with Visual Studio 2010 (required for Python 3.3): paver build_2010 - + These commands will each produce a zip file containing the appropriate build of HDF5. Unpack them and supply the appropriate directory to --hdf5. -Check pavement.py for the current HDF5 version to pass to --hdf5-version. \ No newline at end of file +Check pavement.py for the current HDF5 version to pass to --hdf5-version. diff --git a/windows/stdint.h b/windows/stdint.h index e032ff160..17dcad454 100644 --- a/windows/stdint.h +++ b/windows/stdint.h @@ -1,32 +1,32 @@ // ISO C9x compliant stdint.h for Microsoft Visual Studio -// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 -// +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// // Copyright (c) 2006-2008 Alexander Chemeris -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: -// +// // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. -// +// // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // 3. The name of the author may be used to endorse or promote products // derived from this software without specific prior written permission. -// +// // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// +// /////////////////////////////////////////////////////////////////////////////// #ifndef _MSC_VER // [ @@ -47,7 +47,7 @@ // error C2733: second C linkage of overloaded function 'wmemchr' not allowed #if (_MSC_VER < 1300) && defined(__cplusplus) extern "C++" { -#endif +#endif # include #if (_MSC_VER < 1300) && defined(__cplusplus) }