Skip to content

Commit

Permalink
Merge pull request #1560 from silx-kit/opaque-array
Browse files Browse the repository at this point in the history
Add byte string array and float128 max value to sample HDF5 file
  • Loading branch information
axelboc committed Feb 6, 2024
2 parents ad84ba3 + 3bfc2ce commit 5cc6049
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 32 deletions.
2 changes: 1 addition & 1 deletion apps/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"react-dropzone": "14.2.3",
"react-icons": "4.12.0",
"react-icons": "5.0.1",
"wouter": "3.0.0-rc.2"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"normalize.css": "8.0.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-icons": "4.12.0",
"react-icons": "5.0.1",
"react-suspense-fetch": "0.4.1",
"three": "0.159.0"
},
Expand Down
11 changes: 10 additions & 1 deletion create_h5_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ def print_h5t_class(dataset):
)

add_scalar(h5, "float128", np.float128(np.finfo(np.float128).smallest_normal))
add_array(h5, "float128", np.array([[0, 1, 2], [3, 4, 5]], np.float128))
add_array(
h5,
"float128",
np.array([[0, 1, 2], [3, 4, np.finfo(np.float128).max]], np.float128),
)

# === H5T_TIME ===

Expand All @@ -113,6 +117,11 @@ def print_h5t_class(dataset):
# === H5T_OPAQUE ===

add_scalar(h5, "byte_string", np.void(b"\x00\x11\x22"))
add_array(
h5,
"byte_string",
np.array([np.void(b"\x00"), np.void(b"\x11"), np.void(b"\x22")]),
)
add_scalar(h5, "datetime64", np.void(np.datetime64("2019-09-22T17:38:30")))
add_scalar(h5, "datetime64_not-a-time", np.void(np.datetime64("NaT")))

Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"ndarray": "1.0.19",
"ndarray-ops": "1.2.2",
"react-error-boundary": "4.0.11",
"react-icons": "4.12.0",
"react-icons": "5.0.1",
"react-reflex": "4.1.0",
"react-slider": "2.0.4",
"react-suspense-fetch": "0.4.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ exports[`test file matches snapshot 1`] = `
2,
3,
4,
5,
null,
],
},
{
Expand Down Expand Up @@ -798,6 +798,27 @@ exports[`test file matches snapshot 1`] = `
},
"value": """,
},
{
"name": "byte_string_1D",
"rawType": {
"class": 5,
"dtype": "|V1",
"size": 1,
"tag": "",
},
"shape": [
3,
],
"type": {
"class": "Opaque",
"tag": "",
},
"value": [
"",
"",
""",
],
},
{
"name": "datetime64_scalar",
"rawType": {
Expand Down
56 changes: 40 additions & 16 deletions packages/h5wasm/src/__snapshots__/h5wasm-api.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,30 @@ exports[`test file matches snapshot 1`] = `
34,
],
},
{
"name": "byte_string_1D",
"rawType": {
"cset": -1,
"littleEndian": false,
"signed": false,
"size": 1,
"total_size": 3,
"type": 5,
"vlen": false,
},
"shape": [
3,
],
"type": {
"class": "Opaque",
"tag": "",
},
"value": Uint8Array [
0,
17,
34,
],
},
{
"name": "datetime64_scalar",
"rawType": {
Expand Down Expand Up @@ -1745,8 +1769,8 @@ exports[`test file matches snapshot 1`] = `
0,
0,
0,
80,
191,
48,
207,
18,
0,
],
Expand All @@ -1761,8 +1785,8 @@ exports[`test file matches snapshot 1`] = `
0,
0,
0,
160,
213,
48,
229,
18,
0,
],
Expand All @@ -1777,8 +1801,8 @@ exports[`test file matches snapshot 1`] = `
0,
0,
0,
184,
213,
72,
229,
18,
0,
],
Expand All @@ -1801,8 +1825,8 @@ exports[`test file matches snapshot 1`] = `
"class": "Reference",
},
"value": Uint8Array [
214,
91,
226,
92,
0,
0,
0,
Expand Down Expand Up @@ -2044,8 +2068,8 @@ exports[`test file matches snapshot 1`] = `
0,
0,
0,
72,
160,
152,
201,
18,
0,
],
Expand Down Expand Up @@ -2075,24 +2099,24 @@ exports[`test file matches snapshot 1`] = `
0,
0,
0,
128,
184,
185,
18,
34,
0,
2,
0,
0,
0,
176,
207,
14,
168,
163,
13,
0,
3,
0,
0,
0,
208,
224,
25,
18,
0,
],
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"ndarray": "1.0.19",
"ndarray-ops": "1.2.2",
"react-aria-menubutton": "7.0.3",
"react-icons": "4.12.0",
"react-icons": "5.0.1",
"react-keyed-flatten-children": "3.0.0",
"react-measure": "2.5.2",
"react-slider": "2.0.4",
Expand Down
20 changes: 10 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5cc6049

Please sign in to comment.