Skip to content

Commit

Permalink
Merge pull request #93 from silx-kit/strpad
Browse files Browse the repository at this point in the history
Add `strpad` to string dtype metadata
  • Loading branch information
axelboc authored Apr 23, 2024
2 parents fc42525 + a38a873 commit a28ab57
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/_static/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ components:
type: integer
cset:
type: integer
strpad:
type: integer
vlen:
type: boolean
tag:
Expand Down
1 change: 1 addition & 0 deletions h5grove/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class LinkResolution(str, Enum):
"order": int, # int, float, bitfield
"sign": int, # int
"cset": int, # string
"strpad": int, # string
"vlen": bool, # string
"tag": str, # opaque
"dims": Tuple[int, ...], # array
Expand Down
1 change: 1 addition & 0 deletions h5grove/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ def get_type_metadata(type_id: h5py.h5t.TypeID) -> TypeMetadata:
return {
**base_metadata,
"cset": type_id.get_cset(),
"strpad": type_id.get_strpad(),
"vlen": type_id.is_variable_str(),
}

Expand Down
2 changes: 2 additions & 0 deletions test/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def test_meta_on_compound_dataset(self, server):
"dtype": "|S10",
"size": 10,
"cset": 0,
"strpad": 1,
"vlen": False,
},
"weight": {"class": 1, "dtype": "<f4", "size": 4, "order": 0},
Expand Down Expand Up @@ -290,6 +291,7 @@ def test_meta_on_compound_dataset_with_advanced_types(self, server):
"dtype": "|O",
"size": 8,
"cset": 1,
"strpad": 0,
"vlen": True,
},
},
Expand Down

0 comments on commit a28ab57

Please sign in to comment.