Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add strpad to string dtype metadata #93

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading