From 290a72f8ca38c918517bbfad7a85facfc5117743 Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Mon, 2 Sep 2024 16:55:27 -0700 Subject: [PATCH] changelog and bump version --- docs/changelog.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/docs/changelog.md b/docs/changelog.md index 683372e..07276c3 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,61 @@ ## 1.* +### 1.4.0 - 24-09-02 - HDF5 Compound Dtype Support + +HDF5 can have compound dtypes like: + +```python +import numpy as np +import h5py + +dtype = np.dtype([("data", "i8"), ("extra", "f8")]) +data = np.zeros((10, 20), dtype=dtype) +with h5py.File('mydata.h5', "w") as h5f: + dset = h5f.create_dataset("/dataset", data=data) + +``` + +```python +>>> dset[0:1] +array([[(0, 0.), (0, 0.), (0, 0.), (0, 0.), (0, 0.), (0, 0.), (0, 0.), + (0, 0.), (0, 0.), (0, 0.), (0, 0.), (0, 0.), (0, 0.), (0, 0.), + (0, 0.), (0, 0.), (0, 0.), (0, 0.), (0, 0.), (0, 0.)]], + dtype=[('data', '>> my_model.data[0,0] +0 +>>> my_model.data.dtype +np.dtype('int64') +``` + ### 1.3.3 - 24-08-13 - Callable type annotations Problem, when you use a numpydantic `"wrap"` validator, it gives the annotation as a `handler` function. diff --git a/pyproject.toml b/pyproject.toml index 8cdc372..f5c8542 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "numpydantic" -version = "1.3.3" +version = "1.4.0" description = "Type and shape validation and serialization for numpy arrays in pydantic models" authors = [ {name = "sneakers-the-rat", email = "sneakers-the-rat@protonmail.com"},