Upload h5py/H5PY_USER_GUIDE.txt with huggingface_hub
Browse files- h5py/H5PY_USER_GUIDE.txt +73 -0
h5py/H5PY_USER_GUIDE.txt
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
================================================================================
|
| 2 |
+
H5PY - USER GUIDE (Android Python STB) - Generated by RIMI
|
| 3 |
+
================================================================================
|
| 4 |
+
|
| 5 |
+
h5py 3.16.0 for Android (CPython 3.12) — read and write HDF5 files from Python.
|
| 6 |
+
Built from the official PyPI sdist against HDF5 1.14.6 compiled from source
|
| 7 |
+
for Android API 24. Both the low-level API (h5py.h5f, h5py.h5d, ...) and the
|
| 8 |
+
high-level API (File, Group, Dataset, attrs) are included, plus the bundled
|
| 9 |
+
test suite (h5py.tests).
|
| 10 |
+
|
| 11 |
+
WHEELS (install exactly one, matching your device ABI)
|
| 12 |
+
h5py-3.16.0-cp312-cp312-android_24_x86_64.whl (emulators)
|
| 13 |
+
h5py-3.16.0-cp312-cp312-android_24_arm64_v8a.whl (real phones)
|
| 14 |
+
Requires: numpy>=1.21.2 (use the matching NATIVE numpy 2.5.2 wheel).
|
| 15 |
+
|
| 16 |
+
WHAT IS VENDORED
|
| 17 |
+
h5py/libhdf5.so + h5py/libhdf5_hl.so — the HDF5 1.14.6 runtime built from
|
| 18 |
+
source with the NDK (16 KB pages, no RELRO, stripped). h5py/__init__.py
|
| 19 |
+
preloads both by absolute path on Android before any extension module
|
| 20 |
+
loads (same pattern as the pyarrow package), so `import h5py` just works.
|
| 21 |
+
No other native dependency: zlib comes from the Android system (libz.so).
|
| 22 |
+
|
| 23 |
+
QUICK START
|
| 24 |
+
import h5py
|
| 25 |
+
import numpy as np
|
| 26 |
+
print(h5py.version.version, h5py.version.hdf5_version) # 3.16.0 1.14.6
|
| 27 |
+
|
| 28 |
+
with h5py.File("demo.h5", "w") as f:
|
| 29 |
+
g = f.create_group("sensors")
|
| 30 |
+
d = g.create_dataset("temp", data=np.arange(100, dtype="f4"))
|
| 31 |
+
g.attrs["unit"] = "celsius"
|
| 32 |
+
|
| 33 |
+
with h5py.File("demo.h5", "r") as f:
|
| 34 |
+
print(f["sensors/temp"][...].sum(), f["sensors"].attrs["unit"])
|
| 35 |
+
|
| 36 |
+
# no storage permission? use a pure in-memory file:
|
| 37 |
+
with h5py.File("m.h5", "w", driver="core", backing_store=False) as f:
|
| 38 |
+
f.create_dataset("d", data=np.arange(10))
|
| 39 |
+
|
| 40 |
+
COMPRESSION / FILTERS
|
| 41 |
+
gzip (deflate) is fully supported (system zlib):
|
| 42 |
+
f.create_dataset("z", data=data, compression="gzip", compression_opts=6)
|
| 43 |
+
shuffle + fletcher32 also work. SZIP and ROS3 (S3) drivers are NOT built
|
| 44 |
+
into this package (kept dependency-free); requesting them raises a clean
|
| 45 |
+
error, everything else is unaffected.
|
| 46 |
+
|
| 47 |
+
ANDROID NOTES
|
| 48 |
+
- First import preloads ~4 MB of native HDF5; on low-RAM devices allow a
|
| 49 |
+
moment on first `import h5py`.
|
| 50 |
+
- Store files under the app's own directories (e.g. the Scripts folder or
|
| 51 |
+
getFilesDir()); shared storage may need extra permissions.
|
| 52 |
+
- Threading: the high-level API serialises HDF5 calls with its own lock
|
| 53 |
+
(OBJECTS_USE_LOCKING); the C library itself is built without the
|
| 54 |
+
experimental HDF5 threadsafe mode, same as recommended upstream.
|
| 55 |
+
- h5py 3.16 needs numpy>=1.21.2 at runtime; _npystrings needs numpy>=2
|
| 56 |
+
(numpy 2.5.2 is what these wheels were built and tested against).
|
| 57 |
+
|
| 58 |
+
TESTED FEATURES (host-validated 16/16 against HDF5 1.14.6; device script
|
| 59 |
+
Test_H5py.py repeats the same flow on device)
|
| 60 |
+
import + version wiring, groups, int/float/compound/vlen-string datasets,
|
| 61 |
+
file + group attributes, gzip write + read-back, chunked resizable
|
| 62 |
+
datasets, core-driver in-memory files, temp-file roundtrip.
|
| 63 |
+
|
| 64 |
+
TROUBLESHOOTING
|
| 65 |
+
"numpy import" failure -> install the NATIVE numpy wheel first.
|
| 66 |
+
"ImportError: libhdf5.so" -> reinstall this wheel (the two vendored .so
|
| 67 |
+
must sit next to __init__.py inside h5py/); do not rename them.
|
| 68 |
+
Version-mismatch warning -> should never appear (runtime == built-against
|
| 69 |
+
1.14.6); if it does, a foreign libhdf5 is shadowing the vendored one.
|
| 70 |
+
|
| 71 |
+
================================================================================
|
| 72 |
+
Generated by RIMI
|
| 73 |
+
================================================================================
|