bump changelog, version

This commit is contained in:
sneakers-the-rat 2024-09-02 22:23:41 -07:00
parent 0e6ea07d5e
commit 067ffa0342
Signed by untrusted user who does not match committer: jonny
GPG key ID: 6DCB96EF1E4D232D
2 changed files with 34 additions and 1 deletions

View file

@ -2,6 +2,39 @@
## 1.* ## 1.*
### 1.5.0 - 24-09-02 - `str` support for HDF5
Strings in hdf5 are tricky! HDF5 doesn't have native support for unicode,
but it can be persuaded to store data in ASCII or virtualized utf-8 under somewhat obscure conditions.
This PR uses h5py's string methods to expose string datasets (compound or not)
via the h5proxy with the `asstr()` view method.
This also allows us to set strings with normal python strings.
Since numpydantic isn't necessarily a tool for *creating* hdf5 files
(nobody should be doing that), but rather an interface to them,
tests are included for reading and validating (unskip the existing string tests)
as well as setting/getting.
```python
import h5py
import numpy as np
from pydantic import BaseModel
from numpydantic import NDArray
from typing import Any
class MyModel(BaseModel):
array: NDArray[Any, str]
h5f = h5py.File('my_data.h5', 'w')
data = np.random.random((10,10)).astype(str)
_ = h5f.create_dataset('/dataset', data=data)
instance = MyModel(array=('my_data.h5', '/dataset'))
instance[0,0] = 'hey'
assert instance[0,0] == 'hey'
```
### 1.4.1 - 24-09-02 - `len()` support and dunder method testing ### 1.4.1 - 24-09-02 - `len()` support and dunder method testing
It's pretty natural to want to do `len(array)` as a shorthand for `array.shape[0]`, It's pretty natural to want to do `len(array)` as a shorthand for `array.shape[0]`,

View file

@ -1,6 +1,6 @@
[project] [project]
name = "numpydantic" name = "numpydantic"
version = "1.4.1" version = "1.5.0"
description = "Type and shape validation and serialization for numpy arrays in pydantic models" description = "Type and shape validation and serialization for numpy arrays in pydantic models"
authors = [ authors = [
{name = "sneakers-the-rat", email = "sneakers-the-rat@protonmail.com"}, {name = "sneakers-the-rat", email = "sneakers-the-rat@protonmail.com"},