Skip to content
Novus Examples
h58.1 KB

HDF5 Strings — Fixed, Variable-Length and UTF-8 (.h5)

Fixed-width byte strings, variable-length UTF-8 strings and UTF-8 attribute text in one file, including Greek, CJK and combining diacritics. HDF5 hands fixed-width strings back as padded bytes and variable-length ones as decoded text, and conflating the two is where string handling usually breaks.

Preview — schema + first 4 rowsh5
DatasetKindFirst value
/fixed_asciifixed 8-byte, NUL-paddedalpha
/variable_utf8variable-length UTF-8ångström
/unit_symbolsvariable-length UTF-8K
root attr 'note'UTF-8 attribute stringAttribute strings are UTF-8 too: 5 µm ± 0.2 µm
Fixed-width strings come back as bytes; variable-length ones as text. Mixing them up is the bug.

Specifications

Fixed Width Dataset
S8 (3 items)
Variable Length Datasets
2
Encoding
UTF-8
Non Ascii Items
5
Scripts
Latin with diacritics, Greek, CJK, arrows

Testing contract

Expected to pass
Scenario
Read all three string datasets and the root note attribute, decoding each according to its declared HDF5 string type.
Expected result
fixed_ascii yields NUL-padded bytes of width 8, variable_utf8 yields five decoded strings starting with 'ångström', and no value arrives mojibaked or truncated at a multi-byte boundary.

What is a .h5 file?

HDF5 (.h5) is a binary container format for large, heterogeneous scientific data. It stores multidimensional arrays (datasets) in a hierarchical group structure with attributes and chunked, compressed storage, and is standard in ML, physics, and geoscience.

How to use this file

Use an example .h5 file to test HDF5 readers (h5py, PyTables), group and dataset traversal, and attribute extraction.

How to use this file for testing

“HDF5 Strings — Fixed, Variable-Length and UTF-8 (.h5)” is a deterministic Novus Examples fixture for Scientific data, Serialization testing, Encoding detection. Citation catalogs (BibTeX, RIS), chemistry structures (MDL Molfile, PDB), and gridded binary data (NetCDF, FITS) — for testing reference managers, molecule viewers, and scientific-data loaders.

Documented properties for this file: UTF-8. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Scientific fixtures are small, valid, and fully synthetic — no real organism, patient, sample, or observation. Point your parser or loader at the file and check it reads the documented records, variables, or headers; binary formats ship a readable twin or metadata listing for comparison.

Generated by generation/scientific.py. Free for any use, no attribution required — license.