Skip to content

Commit 474bf86

Browse files
author
Bryan Lawrence
committed
Starting to add authors, and fix some of the lazy wording of the first draft.
1 parent d20190e commit 474bf86

1 file changed

Lines changed: 24 additions & 12 deletions

File tree

paper.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'Pyfive: the mother of all HDF5 battles.'
2+
title: 'Pyfive: A pure-python HDF5 reader'
33
tags:
44
- Python
55
- Atmospheric Science
@@ -8,39 +8,51 @@ tags:
88
- Engineering
99
authors:
1010
- name: Bryan Lawrence
11-
orcid: 0000-0000-0000-0000
12-
equal-contrib: true
13-
affiliation: "1, 2" # (Multiple affiliations must be quoted)
11+
orcid: 0000-0001-9262-7860
12+
affiliation: 1 # (Multiple affiliations must be quoted)
13+
- name: Ezequiel Cimadevilla
14+
affiliation: 2
1415
- name: David Hassell
15-
equal-contrib: true # (This is how you can denote equal contributions between multiple authors)
16+
orcid: 0000-0002-5312-4950
1617
affiliation: 1
18+
- name: Jonathan Helmus
19+
affiliation: 3
20+
- name: Brian Maranville
21+
orcid: 0000-0002-6105-8789
22+
affiliation: 4
23+
- name: Kai Mühlbauer
24+
affiliation: 5
1725
- name: Valeriu Predoi
18-
equal-contrib: true # (This is how you can denote equal contributions between multiple authors)
26+
orcid: 0000-0002-9729-657
1927
affiliation: 1
20-
- name: Ezequiel Cimadevilla
21-
equal-contrib: true # (This is how you can denote equal contributions between multiple authors)
22-
affiliation: 2
2328
affiliations:
2429
- name: NCAS-CMS, Meteorology Department, University of Reading, Reading, UK
2530
index: 1
2631
ror: 00hx57361
2732
- name: Institution Name, Spain
2833
index: 2
29-
date: 17 September 2025
34+
- name: TBD
35+
index: 3
36+
- name: NIST Center for Neutron Research
37+
index: 4
38+
- name: Institute for Geophysics, University of Bonn
39+
index: 5
40+
date: 21 September 2025
3041
bibliography: paper.bib
3142

3243
---
3344

3445
# Summary
3546

36-
Pyfive (<https://pyfive.readthedocs.io/en/latest/>) is an open-source thread-safe pure Python package for reading data stored in HDF5. While it is not a complete implementation of all the capabilities of HDF5, it includes all the core functionality necessary to read gridded datasets, whether stored contiguously or with chunks, and to carry out the necessary decompression for the standard options (INCLUDE OPTIONS). All data access is fully lazy, the data is only read from storage when the numpy data arrays are manipulated. Originally developed as a prototype some years ago, the package has recently been upgraded to make it more maintainable and fully featured for handling all the environmental data known to the authors, and hence a realistic option for production data access in environmental science and more widely. The API is based on that of h5py (which is a python shimmy over the HDF5 c-library, and hence is not thread-safe), with some API extensions to help optimise remote access.
47+
Pyfive (<https://pyfive.readthedocs.io/en/latest/>) is an open-source thread-safe pure Python package for reading data stored in HDF5. While it is not a complete implementation of all the capabilities of HDF5, it includes all the core functionality necessary to read gridded datasets, whether stored contiguously or with chunks, and to carry out the necessary decompression for the standard options (INCLUDE OPTIONS). All data access is fully lazy, the data is only read from storage when the numpy data arrays are manipulated. Originally developed some years ago, the package has recently been upgraded to support
48+
lazy access, and to add missing features necessary for handling all the environmental data known to the authors. It is now a realistic option for production data access in environmental science and more widely. The API is based on that of h5py (which is a python shimmy over the HDF5 c-library, and hence is not thread-safe), with some API extensions to help optimise remote access.
3749

3850
# Statement of need
3951

4052
HDF5 is probably the most important data format in environmental science, particularly given the fact that NetCDF4 is HDF5 under the hood. From satellite missions, to climate models and radar systems, the default binary format has been HDF5 for decades. While newer formats are starting to get mindshare, there are petabytes, if not exabytes of existing HDF5, and there are still many good use-cases for creating new data in HDF5. However, despite the history, there are few libraries for reading HDF5 file data that do not depend on the official HDF5 library maintained by the HDFGroup, and in particular, there are none that can be used with Python.
4153
While the HDF5 c-library is reliable and performant, and battle-tested over decades, there are some caveats to depending upon it: Firstly, it is not thread-safe, and secondly, the code is large and complex, and should anything happen to the financial stability of The HDF5group, it is not obvious the C-code could be maintained. From a long-term curation perspective this last constraint is a concern.
4254

43-
pyfive was developed with the use-case of performant remote access to curated data as the primary motivation, but with additional motivations of having a lightweight HDF5 reader capable of deploying in resource or operating-system constrained environments (such as mobile), and one that could be maintained long-term as a reference reader for curation purposes. The lightweight deployment consequences of a pure-python HDF5 reader need no further introduction, but as additional motivation we now expand on the issues around remote access and curation.
55+
The original implementation of pyfive (by JH and BM), which included all the low-level functionality to deal with the internals of an HDF5 file was developed with POSIX access in mind. The recent upgrades were developed with the use-case of performant remote access to curated data as the primary motivation, but with additional motivations of having a lightweight HDF5 reader capable of deploying in resource or operating-system constrained environments (such as mobile), and one that could be maintained long-term as a reference reader for curation purposes. The lightweight deployment consequences of a pure-python HDF5 reader need no further introduction, but as additional motivation we now expand on the issues around remote access and curation.
4456

4557
Taking remote access first, one of the reasons for the rapid adoption of pure-python tools like xarray with zarr has been the ability for thread-safe parallelism using dask. Any python solution based on the HDF5 c-library could not meet this requirement, which led to the development of kerchunk mediated direct access to chunked HDF5 data (https://fsspec.github.io/kerchunk/). However, in practice using kerchunk requires the data provider to generate kerchunk indices to support remote users, and it leads to issues of synchronicity between indices and changing datasets. pyfive was developed in such a way to have all the benefits of using kerchunk, but without the need for provider support. Because pyfive can access and cache (in the client) the b-tree (index) on a variable-by-variable basis, most of the benefits of kerchunk are gained without any of the constraints. The one advantage left to kerchunk is that the kerchunk index is always a contiguous object accessible with one get transaction, this is not necessarily the case with the b-tree, unless the source data has been repacked to ensure contiguous metadata using a tool like h5repack. However, in practice, for many use cases, b-tree extraction with pyfive will be comparable in performance to obtaining a kerchunk index, and completely opaque to the user.
4658

0 commit comments

Comments
 (0)