From 8dd7e5b4fb805375bf20af789e7757d7a6b8d743 Mon Sep 17 00:00:00 2001 From: Axel Bocciarelli Date: Wed, 7 Aug 2024 11:40:08 +0200 Subject: [PATCH] Upgrade h5wasm and improve boolean and vlen support --- package.json | 7 + .../__snapshots__/h5grove-api.test.ts.snap | 31 ++++ .../app/src/vis-packs/core/matrix/utils.ts | 15 +- .../app/src/vis-packs/core/scalar/utils.ts | 10 +- packages/h5wasm/package.json | 2 +- .../src/__snapshots__/h5wasm-api.test.ts.snap | 155 +++++++++++++++--- packages/h5wasm/src/h5wasm-api.test.ts | 14 +- packages/h5wasm/src/utils.ts | 6 +- packages/h5wasm/src/worker-utils.ts | 7 +- packages/lib/src/vis/raw/RawVis.tsx | 10 +- packages/lib/src/vis/raw/utils.ts | 11 ++ packages/shared/src/guards.ts | 8 +- packages/shared/src/hdf5-models.ts | 4 +- packages/shared/src/vis-utils.ts | 11 +- pnpm-lock.yaml | 123 +++++++------- support/sample/create_h5_sample.py | 7 + 16 files changed, 309 insertions(+), 112 deletions(-) create mode 100644 packages/lib/src/vis/raw/utils.ts diff --git a/package.json b/package.json index fca4f940c..1992bb857 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,13 @@ "wait-on": "7.2.0" }, "pnpm": { + "packageExtensions": { + "@typescript-eslint/eslint-plugin": { + "dependencies": { + "typescript": "5.0.3" + } + } + }, "peerDependencyRules": { "allowedVersions": { "@phenomnomnominal/tsquery>typescript": "5.x", diff --git a/packages/app/src/providers/h5grove/__snapshots__/h5grove-api.test.ts.snap b/packages/app/src/providers/h5grove/__snapshots__/h5grove-api.test.ts.snap index 2f9b0ccce..89d62d079 100644 --- a/packages/app/src/providers/h5grove/__snapshots__/h5grove-api.test.ts.snap +++ b/packages/app/src/providers/h5grove/__snapshots__/h5grove-api.test.ts.snap @@ -1894,6 +1894,37 @@ exports[`test file matches snapshot 1`] = ` 1, ], }, + { + "name": "vlen_float32_1D", + "rawType": { + "base": { + "class": 1, + "dtype": "; + } + if (isEnumType(type)) { return createEnumFormatter(type.mapping); } - return (val) => (val as string | boolean).toString(); + return (val) => (val as string).toString(); // call `toString()` for safety, in case type cast is wrong } export function getCellWidth( diff --git a/packages/app/src/vis-packs/core/scalar/utils.ts b/packages/app/src/vis-packs/core/scalar/utils.ts index 54c7471b5..a1815c67f 100644 --- a/packages/app/src/vis-packs/core/scalar/utils.ts +++ b/packages/app/src/vis-packs/core/scalar/utils.ts @@ -1,12 +1,14 @@ -import { hasComplexType, hasEnumType } from '@h5web/shared/guards'; +import { hasBoolType, hasComplexType, hasEnumType } from '@h5web/shared/guards'; import type { ArrayShape, + BooleanType, Dataset, PrintableType, } from '@h5web/shared/hdf5-models'; import type { ValueFormatter } from '@h5web/shared/vis-models'; import { createEnumFormatter, + formatBool, formatScalarComplex, } from '@h5web/shared/vis-utils'; @@ -17,9 +19,13 @@ export function getFormatter( return formatScalarComplex; } + if (hasBoolType(dataset)) { + return formatBool as ValueFormatter; + } + if (hasEnumType(dataset)) { return createEnumFormatter(dataset.type.mapping); } - return (val) => (val as number | string | boolean).toString(); + return (val) => (val as number | string).toString(); } diff --git a/packages/h5wasm/package.json b/packages/h5wasm/package.json index b70cc76d7..0bcd9918c 100644 --- a/packages/h5wasm/package.json +++ b/packages/h5wasm/package.json @@ -47,7 +47,7 @@ }, "dependencies": { "comlink": "4.4.1", - "h5wasm": "0.7.5", + "h5wasm": "0.7.6", "nanoid": "5.0.7" }, "devDependencies": { diff --git a/packages/h5wasm/src/__snapshots__/h5wasm-api.test.ts.snap b/packages/h5wasm/src/__snapshots__/h5wasm-api.test.ts.snap index 47eefc904..0d0d23103 100644 --- a/packages/h5wasm/src/__snapshots__/h5wasm-api.test.ts.snap +++ b/packages/h5wasm/src/__snapshots__/h5wasm-api.test.ts.snap @@ -1636,7 +1636,7 @@ exports[`test file matches snapshot 1`] = ` }, "value": [ [ - true, + 1, [ 1, 2, @@ -1680,6 +1680,13 @@ exports[`test file matches snapshot 1`] = ` "size": 8, "type": 9, "vlen": false, + "vlen_type": { + "littleEndian": true, + "signed": false, + "size": 8, + "type": 0, + "vlen": false, + }, }, ], "nmembers": 2, @@ -1710,7 +1717,9 @@ exports[`test file matches snapshot 1`] = ` }, "vlen": { "base": { - "class": "Unknown", + "class": "Integer (unsigned)", + "endianness": "little-endian", + "size": 64, }, "class": "Array (variable length)", }, @@ -1722,21 +1731,30 @@ exports[`test file matches snapshot 1`] = ` 0, 1, ], - "Uint8Array (unstable)", + [ + 0, + ], ], [ [ 2, 3, ], - "Uint8Array (unstable)", + [ + 0, + 1, + ], ], [ [ 4, 5, ], - "Uint8Array (unstable)", + [ + 0, + 1, + 2, + ], ], ], }, @@ -1820,7 +1838,7 @@ exports[`test file matches snapshot 1`] = ` "type": { "class": "Boolean", }, - "value": false, + "value": 0, }, { "name": "bool_true_scalar", @@ -1844,7 +1862,7 @@ exports[`test file matches snapshot 1`] = ` "type": { "class": "Boolean", }, - "value": true, + "value": 1, }, { "name": "bool_2D", @@ -1871,15 +1889,15 @@ exports[`test file matches snapshot 1`] = ` "type": { "class": "Boolean", }, - "value": [ - true, - false, - true, - true, - false, - false, - true, - false, + "value": Int8Array [ + 1, + 0, + 1, + 1, + 0, + 0, + 1, + 0, ], }, { @@ -2064,15 +2082,62 @@ exports[`test file matches snapshot 1`] = ` "total_size": 1, "type": 9, "vlen": false, + "vlen_type": { + "littleEndian": true, + "signed": true, + "size": 1, + "type": 0, + "vlen": false, + }, }, "shape": [], "type": { "base": { - "class": "Unknown", + "class": "Integer", + "endianness": "little-endian", + "size": 8, }, "class": "Array (variable length)", }, - "value": "Uint8Array (unstable)", + "value": Int8Array [ + 0, + 1, + ], + }, + { + "name": "vlen_float32_1D", + "rawType": { + "littleEndian": true, + "signed": false, + "size": 8, + "total_size": 3, + "type": 9, + "vlen": false, + "vlen_type": { + "littleEndian": true, + "signed": false, + "size": 4, + "type": 1, + "vlen": false, + }, + }, + "shape": [ + 2, + ], + "type": { + "base": { + "class": "Float", + "endianness": "little-endian", + "size": 32, + }, + "class": "Array (variable length)", + }, + "value": [ + Float32Array [] + Float32Array [ + 0, + ], + ], }, { "name": "vlen_int64_1D", @@ -2083,17 +2148,39 @@ exports[`test file matches snapshot 1`] = ` "total_size": 3, "type": 9, "vlen": false, + "vlen_type": { + "littleEndian": true, + "signed": true, + "size": 8, + "type": 0, + "vlen": false, + }, }, "shape": [ 3, ], "type": { "base": { - "class": "Unknown", + "class": "Integer", + "endianness": "little-endian", + "size": 64, }, "class": "Array (variable length)", }, - "value": "Uint8Array (unstable)", + "value": [ + [ + 0, + ], + [ + 0, + 1, + ], + [ + 0, + 1, + 2, + ], + ], }, { "name": "vlen_utf8_1D", @@ -2104,17 +2191,41 @@ exports[`test file matches snapshot 1`] = ` "total_size": 3, "type": 9, "vlen": false, + "vlen_type": { + "cset": 1, + "littleEndian": true, + "signed": false, + "size": 4, + "strpad": 0, + "type": 3, + "vlen": true, + }, }, "shape": [ 3, ], "type": { "base": { - "class": "Unknown", + "charSet": "UTF-8", + "class": "String", + "strPad": "null-terminated", }, "class": "Array (variable length)", }, - "value": "Uint8Array (unstable)", + "value": [ + [ + "a", + ], + [ + "a", + "bc", + ], + [ + "a", + "bc", + "def", + ], + ], }, ] `; diff --git a/packages/h5wasm/src/h5wasm-api.test.ts b/packages/h5wasm/src/h5wasm-api.test.ts index 36d02c7b1..5f84b228c 100644 --- a/packages/h5wasm/src/h5wasm-api.test.ts +++ b/packages/h5wasm/src/h5wasm-api.test.ts @@ -61,21 +61,13 @@ test.skipIf(SKIP)('test file matches snapshot', async () => { expect(children).toMatchSnapshot(); }); -// Hide unstable uint8 value arrays for H5T_VLEN and H5T_REFERENCE datasets from snapshot function processValue(value: unknown, child: Dataset): unknown { - const { name, type } = child; + const { type } = child; - if (type.class === DTypeClass.Reference || type.class === DTypeClass.VLen) { + // Hide unstable H5T_REFERENCE values from snapshot + if (type.class === DTypeClass.Reference) { return `Uint8Array (unstable)`; } - // Special case for compound dataset with H5T_VLEN field - if (name === 'compound_array_vlen_1D') { - return (value as [number[], Uint8Array][]).map((item) => [ - item[0], - `Uint8Array (unstable)`, - ]); - } - return value; } diff --git a/packages/h5wasm/src/utils.ts b/packages/h5wasm/src/utils.ts index 43389cbe8..d60138d13 100644 --- a/packages/h5wasm/src/utils.ts +++ b/packages/h5wasm/src/utils.ts @@ -18,7 +18,11 @@ export const PLUGINS_BY_FILTER_ID: Record = { }; export function hasBigInts(type: DType): boolean { - if (type.class === DTypeClass.Array || type.class === DTypeClass.Enum) { + if ( + type.class === DTypeClass.Enum || + type.class === DTypeClass.Array || + type.class === DTypeClass.VLen + ) { return hasBigInts(type.base); } diff --git a/packages/h5wasm/src/worker-utils.ts b/packages/h5wasm/src/worker-utils.ts index 3f2996a70..196954336 100644 --- a/packages/h5wasm/src/worker-utils.ts +++ b/packages/h5wasm/src/worker-utils.ts @@ -273,10 +273,9 @@ function parseDType(metadata: Metadata): DType { } if (h5tClass === H5T_CLASS.VLEN) { - // Not currently provided, so unable to know base type - // const { array_type } = metadata; - // assertDefined(array_type); - return arrayType(unknownType()); + const { vlen_type } = metadata; + assertDefined(vlen_type); + return arrayType(parseDType(vlen_type)); } if (h5tClass === H5T_CLASS.ARRAY) { diff --git a/packages/lib/src/vis/raw/RawVis.tsx b/packages/lib/src/vis/raw/RawVis.tsx index 838636839..ab55de064 100644 --- a/packages/lib/src/vis/raw/RawVis.tsx +++ b/packages/lib/src/vis/raw/RawVis.tsx @@ -1,5 +1,8 @@ +import { isTypedArray } from '@h5web/shared/guards'; + import type { ClassStyleAttrs } from '../models'; import styles from './RawVis.module.css'; +import { getTypedArrayClass } from './utils'; const LARGE_THRESHOLD = 1_000_000; @@ -10,10 +13,9 @@ interface Props extends ClassStyleAttrs { function RawVis(props: Props) { const { value, className = '', style } = props; - const valueAsStr = - value instanceof Uint8Array - ? `Uint8Array [ ${value.toString()} ]` - : JSON.stringify(value, null, 2); + const valueAsStr = isTypedArray(value) + ? `${getTypedArrayClass(value)} [ ${value.toString()} ]` + : JSON.stringify(value, null, 2); return (
diff --git a/packages/lib/src/vis/raw/utils.ts b/packages/lib/src/vis/raw/utils.ts new file mode 100644 index 000000000..12fef533a --- /dev/null +++ b/packages/lib/src/vis/raw/utils.ts @@ -0,0 +1,11 @@ +import { assertDefined, assertNonNull } from '@h5web/shared/guards'; +import type { TypedArray } from 'ndarray'; + +export function getTypedArrayClass(arr: TypedArray): string { + const res = /^\[object (.+)\]$/u.exec(Object.prototype.toString.call(arr)); + assertNonNull(res); + + const [, arrClass] = res; + assertDefined(arrClass); + return arrClass; +} diff --git a/packages/shared/src/guards.ts b/packages/shared/src/guards.ts index d5c7de966..abc5cdc32 100644 --- a/packages/shared/src/guards.ts +++ b/packages/shared/src/guards.ts @@ -85,9 +85,9 @@ function assertNum(val: unknown): asserts val is number { } } -function assertBool(val: unknown): asserts val is boolean { - if (typeof val !== 'boolean') { - throw new TypeError('Expected boolean'); +function assertNumOrBool(val: unknown): asserts val is number | boolean { + if (typeof val !== 'number' && typeof val !== 'boolean') { + throw new TypeError('Expected boolean or number'); } } @@ -430,7 +430,7 @@ function assertPrimitiveValue( } else if (hasStringType(dataset)) { assertStr(value); } else if (hasBoolType(dataset)) { - assertBool(value); + assertNumOrBool(value); } else if (hasComplexType(dataset)) { assertComplex(value); } diff --git a/packages/shared/src/hdf5-models.ts b/packages/shared/src/hdf5-models.ts index 009165462..307f95b47 100644 --- a/packages/shared/src/hdf5-models.ts +++ b/packages/shared/src/hdf5-models.ts @@ -208,7 +208,7 @@ export type Primitive = T extends NumericType | EnumType : T extends StringType ? string : T extends BooleanType - ? boolean + ? number | boolean // let providers choose : T extends ComplexType ? H5WebComplex : T extends PrintableCompoundType @@ -217,7 +217,7 @@ export type Primitive = T extends NumericType | EnumType export type ArrayValue = | Primitive[] - | (T extends NumericType | EnumType ? TypedArray : never); + | (T extends NumericType | BooleanType | EnumType ? TypedArray : never); export type Value = D extends Dataset diff --git a/packages/shared/src/vis-utils.ts b/packages/shared/src/vis-utils.ts index 574be11b4..a5e5d25b4 100644 --- a/packages/shared/src/vis-utils.ts +++ b/packages/shared/src/vis-utils.ts @@ -4,7 +4,12 @@ import ndarray from 'ndarray'; import { assign } from 'ndarray-ops'; import { assertLength, isNdArray } from './guards'; -import type { ComplexType, EnumType } from './hdf5-models'; +import type { + BooleanType, + ComplexType, + EnumType, + Primitive, +} from './hdf5-models'; import type { AnyNumArray, AxisScaleType, @@ -54,6 +59,10 @@ export function formatTick(val: number | { valueOf(): number }): string { return str; } +export function formatBool(value: Primitive): string { + return (typeof value === 'number' ? !!value : value).toString(); +} + export function createComplexFormatter( specifier: string, full = false, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cc801e10f..d5caecc76 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,8 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +packageExtensionsChecksum: 757916d57980a910c06fe422bd21fc26 + importers: .: @@ -107,7 +109,7 @@ importers: version: 5.3.5(@types/node@20.12.11) vite-css-modules: specifier: 1.4.2 - version: 1.4.2(postcss@8.4.40)(rollup@4.20.0)(vite@5.3.5(@types/node@20.12.11)) + version: 1.4.2(postcss@8.4.41)(rollup@4.20.0)(vite@5.3.5(@types/node@20.12.11)) vite-plugin-checker: specifier: 0.7.2 version: 0.7.2(eslint@8.57.0)(optionator@0.9.4)(typescript@5.4.5)(vite@5.3.5(@types/node@20.12.11)) @@ -340,7 +342,7 @@ importers: version: 5.3.5(@types/node@20.12.11) vite-css-modules: specifier: 1.4.2 - version: 1.4.2(postcss@8.4.40)(rollup@4.20.0)(vite@5.3.5(@types/node@20.12.11)) + version: 1.4.2(postcss@8.4.41)(rollup@4.20.0)(vite@5.3.5(@types/node@20.12.11)) vitest: specifier: 2.0.5 version: 2.0.5(@types/node@20.12.11)(jsdom@24.1.1) @@ -351,8 +353,8 @@ importers: specifier: 4.4.1 version: 4.4.1 h5wasm: - specifier: 0.7.5 - version: 0.7.5 + specifier: 0.7.6 + version: 0.7.6 nanoid: specifier: 5.0.7 version: 5.0.7 @@ -567,7 +569,7 @@ importers: version: 5.3.5(@types/node@20.12.11) vite-css-modules: specifier: 1.4.2 - version: 1.4.2(postcss@8.4.40)(rollup@4.20.0)(vite@5.3.5(@types/node@20.12.11)) + version: 1.4.2(postcss@8.4.41)(rollup@4.20.0)(vite@5.3.5(@types/node@20.12.11)) vitest: specifier: 2.0.5 version: 2.0.5(@types/node@20.12.11)(jsdom@24.1.1) @@ -2654,10 +2656,6 @@ packages: peerDependencies: '@typescript-eslint/parser': ^5.0.0 eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true '@typescript-eslint/experimental-utils@5.62.0': resolution: {integrity: sha512-RTXpeB3eMkpoclG3ZHft6vG/Z30azNHuqY6wKPBHlVMZFuEvrtlEDe8gMqDb+SO+9hjC/pLekeSCryf9vMZlCw==} @@ -4344,8 +4342,8 @@ packages: h5wasm@0.6.10: resolution: {integrity: sha512-GxBWGVxBftyq67kAbS4WPmTH3a8hGKigdMm+IVJ7tLY7BHj+nqDTUKO9RmmPBHy6Pvq5uW1YpIJr/oGanw+RyQ==} - h5wasm@0.7.5: - resolution: {integrity: sha512-gkIAs6pyn3c5r2q9Y2gYAUqL6AgtxUSVYe0L7mFTu5NNSFlTPtidOfJxQQLYEm31Zp0+OKbLXhfuI4PSHf4+Rw==} + h5wasm@0.7.6: + resolution: {integrity: sha512-+c9XEb94Vwb1D+rkMbf8eGNJbV2umJ2ubwFyk8kwOhrbaPiewHh9Pl0B465Rj2eEloD7rPKzhyl0X+53B8rZ1Q==} handlebars@4.7.8: resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} @@ -5644,6 +5642,10 @@ packages: resolution: {integrity: sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q==} engines: {node: ^10 || ^12 || >=14} + postcss@8.4.41: + resolution: {integrity: sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==} + engines: {node: ^10 || ^12 || >=14} + potpack@1.0.2: resolution: {integrity: sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ==} @@ -9495,7 +9497,7 @@ snapshots: '@types/node': 20.12.11 optional: true - '@typescript-eslint/eslint-plugin@5.56.0(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.0.3))(eslint@8.57.0)(typescript@5.0.3)': + '@typescript-eslint/eslint-plugin@5.56.0(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.0.3))(eslint@8.57.0)': dependencies: '@eslint-community/regexpp': 4.10.0 '@typescript-eslint/parser': 5.56.0(eslint@8.57.0)(typescript@5.0.3) @@ -9509,7 +9511,6 @@ snapshots: natural-compare-lite: 1.4.0 semver: 7.6.0 tsutils: 3.21.0(typescript@5.0.3) - optionalDependencies: typescript: 5.0.3 transitivePeerDependencies: - supports-color @@ -10855,17 +10856,17 @@ snapshots: '@babel/eslint-parser': 7.21.3(@babel/core@7.21.4)(eslint@8.57.0) '@babel/preset-react': 7.18.6(@babel/core@7.21.4) '@next/eslint-plugin-next': 13.2.4 - '@typescript-eslint/eslint-plugin': 5.56.0(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.0.3))(eslint@8.57.0)(typescript@5.0.3) + '@typescript-eslint/eslint-plugin': 5.56.0(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.0.3))(eslint@8.57.0) '@typescript-eslint/parser': 5.56.0(eslint@8.57.0)(typescript@5.0.3) confusing-browser-globals: 1.0.11 eslint: 8.57.0 eslint-config-prettier: 8.8.0(eslint@8.57.0) eslint-import-resolver-jsconfig: 1.1.0 eslint-import-resolver-node: 0.3.7 - eslint-import-resolver-typescript: 3.5.4(eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0) + eslint-import-resolver-typescript: 3.5.4(eslint-plugin-import@2.27.5)(eslint@8.57.0) eslint-plugin-etc: 2.0.2(eslint@8.57.0)(typescript@5.0.3) - eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.5.4(eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-jest: 27.2.1(@typescript-eslint/eslint-plugin@5.56.0(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.0.3))(eslint@8.57.0)(typescript@5.0.3))(eslint@8.57.0)(typescript@5.0.3) + eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.0.3))(eslint-import-resolver-typescript@3.5.4)(eslint@8.57.0) + eslint-plugin-jest: 27.2.1(@typescript-eslint/eslint-plugin@5.56.0(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.0.3))(eslint@8.57.0))(eslint@8.57.0)(typescript@5.0.3) eslint-plugin-jest-dom: 4.0.3(eslint@8.57.0) eslint-plugin-jest-formatting: 3.1.0(eslint@8.57.0) eslint-plugin-jsx-a11y: 6.7.1(eslint@8.57.0) @@ -10915,12 +10916,12 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.5.4(eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0): + eslint-import-resolver-typescript@3.5.4(eslint-plugin-import@2.27.5)(eslint@8.57.0): dependencies: debug: 4.3.4 enhanced-resolve: 5.16.0 eslint: 8.57.0 - eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.5.4(eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.0.3))(eslint-import-resolver-typescript@3.5.4)(eslint@8.57.0) get-tsconfig: 4.7.3 globby: 13.2.2 is-core-module: 2.13.1 @@ -10929,14 +10930,14 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.4(eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.0.3))(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.4(eslint-plugin-import@2.27.5)(eslint@8.57.0))(eslint@8.57.0): dependencies: debug: 3.2.7(supports-color@8.1.1) optionalDependencies: '@typescript-eslint/parser': 5.56.0(eslint@8.57.0)(typescript@5.0.3) eslint: 8.57.0 eslint-import-resolver-node: 0.3.7 - eslint-import-resolver-typescript: 3.5.4(eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0) + eslint-import-resolver-typescript: 3.5.4(eslint-plugin-import@2.27.5)(eslint@8.57.0) transitivePeerDependencies: - supports-color @@ -10953,7 +10954,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.5.4(eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): + eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.0.3))(eslint-import-resolver-typescript@3.5.4)(eslint@8.57.0): dependencies: array-includes: 3.1.7 array.prototype.flat: 1.3.2 @@ -10962,7 +10963,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.7 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.4(eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.0.3))(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.4(eslint-plugin-import@2.27.5)(eslint@8.57.0))(eslint@8.57.0) has: 1.0.4 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -10989,12 +10990,12 @@ snapshots: dependencies: eslint: 8.57.0 - eslint-plugin-jest@27.2.1(@typescript-eslint/eslint-plugin@5.56.0(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.0.3))(eslint@8.57.0)(typescript@5.0.3))(eslint@8.57.0)(typescript@5.0.3): + eslint-plugin-jest@27.2.1(@typescript-eslint/eslint-plugin@5.56.0(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.0.3))(eslint@8.57.0))(eslint@8.57.0)(typescript@5.0.3): dependencies: '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.0.3) eslint: 8.57.0 optionalDependencies: - '@typescript-eslint/eslint-plugin': 5.56.0(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.0.3))(eslint@8.57.0)(typescript@5.0.3) + '@typescript-eslint/eslint-plugin': 5.56.0(@typescript-eslint/parser@5.56.0(eslint@8.57.0)(typescript@5.0.3))(eslint@8.57.0) transitivePeerDependencies: - supports-color - typescript @@ -11652,7 +11653,7 @@ snapshots: h5wasm@0.6.10: {} - h5wasm@0.7.5: {} + h5wasm@0.7.6: {} handlebars@4.7.8: dependencies: @@ -11751,9 +11752,9 @@ snapshots: dependencies: safer-buffer: 2.1.2 - icss-utils@5.1.0(postcss@8.4.40): + icss-utils@5.1.0(postcss@8.4.41): dependencies: - postcss: 8.4.40 + postcss: 8.4.41 ieee754@1.2.1: {} @@ -12986,49 +12987,49 @@ snapshots: possible-typed-array-names@1.0.0: {} - postcss-import@15.1.0(postcss@8.4.40): + postcss-import@15.1.0(postcss@8.4.41): dependencies: - postcss: 8.4.40 + postcss: 8.4.41 postcss-value-parser: 4.2.0 read-cache: 1.0.0 resolve: 1.22.8 - postcss-js@4.0.1(postcss@8.4.40): + postcss-js@4.0.1(postcss@8.4.41): dependencies: camelcase-css: 2.0.1 - postcss: 8.4.40 + postcss: 8.4.41 - postcss-load-config@4.0.2(postcss@8.4.40): + postcss-load-config@4.0.2(postcss@8.4.41): dependencies: lilconfig: 3.1.2 yaml: 2.5.0 optionalDependencies: - postcss: 8.4.40 + postcss: 8.4.41 - postcss-modules-extract-imports@3.0.0(postcss@8.4.40): + postcss-modules-extract-imports@3.0.0(postcss@8.4.41): dependencies: - postcss: 8.4.40 + postcss: 8.4.41 - postcss-modules-local-by-default@4.0.4(postcss@8.4.40): + postcss-modules-local-by-default@4.0.4(postcss@8.4.41): dependencies: - icss-utils: 5.1.0(postcss@8.4.40) - postcss: 8.4.40 + icss-utils: 5.1.0(postcss@8.4.41) + postcss: 8.4.41 postcss-selector-parser: 6.0.16 postcss-value-parser: 4.2.0 - postcss-modules-scope@3.1.1(postcss@8.4.40): + postcss-modules-scope@3.1.1(postcss@8.4.41): dependencies: - postcss: 8.4.40 + postcss: 8.4.41 postcss-selector-parser: 6.0.16 - postcss-modules-values@4.0.0(postcss@8.4.40): + postcss-modules-values@4.0.0(postcss@8.4.41): dependencies: - icss-utils: 5.1.0(postcss@8.4.40) - postcss: 8.4.40 + icss-utils: 5.1.0(postcss@8.4.41) + postcss: 8.4.41 - postcss-nested@6.2.0(postcss@8.4.40): + postcss-nested@6.2.0(postcss@8.4.41): dependencies: - postcss: 8.4.40 + postcss: 8.4.41 postcss-selector-parser: 6.1.1 postcss-selector-parser@6.0.16: @@ -13055,6 +13056,12 @@ snapshots: picocolors: 1.0.1 source-map-js: 1.2.0 + postcss@8.4.41: + dependencies: + nanoid: 3.3.7 + picocolors: 1.0.1 + source-map-js: 1.2.0 + potpack@1.0.2: {} prelude-ls@1.2.1: {} @@ -13856,11 +13863,11 @@ snapshots: normalize-path: 3.0.0 object-hash: 3.0.0 picocolors: 1.0.1 - postcss: 8.4.40 - postcss-import: 15.1.0(postcss@8.4.40) - postcss-js: 4.0.1(postcss@8.4.40) - postcss-load-config: 4.0.2(postcss@8.4.40) - postcss-nested: 6.2.0(postcss@8.4.40) + postcss: 8.4.41 + postcss-import: 15.1.0(postcss@8.4.41) + postcss-js: 4.0.1(postcss@8.4.41) + postcss-load-config: 4.0.2(postcss@8.4.41) + postcss-nested: 6.2.0(postcss@8.4.41) postcss-selector-parser: 6.1.1 resolve: 1.22.8 sucrase: 3.35.0 @@ -14247,18 +14254,18 @@ snapshots: unist-util-stringify-position: 4.0.0 vfile-message: 4.0.2 - vite-css-modules@1.4.2(postcss@8.4.40)(rollup@4.20.0)(vite@5.3.5(@types/node@20.12.11)): + vite-css-modules@1.4.2(postcss@8.4.41)(rollup@4.20.0)(vite@5.3.5(@types/node@20.12.11)): dependencies: '@ampproject/remapping': 2.3.0 '@rollup/pluginutils': 5.1.0(rollup@4.20.0) generic-names: 4.0.0 - icss-utils: 5.1.0(postcss@8.4.40) + icss-utils: 5.1.0(postcss@8.4.41) magic-string: 0.30.8 - postcss: 8.4.40 - postcss-modules-extract-imports: 3.0.0(postcss@8.4.40) - postcss-modules-local-by-default: 4.0.4(postcss@8.4.40) - postcss-modules-scope: 3.1.1(postcss@8.4.40) - postcss-modules-values: 4.0.0(postcss@8.4.40) + postcss: 8.4.41 + postcss-modules-extract-imports: 3.0.0(postcss@8.4.41) + postcss-modules-local-by-default: 4.0.4(postcss@8.4.41) + postcss-modules-scope: 3.1.1(postcss@8.4.41) + postcss-modules-values: 4.0.0(postcss@8.4.41) vite: 5.3.5(@types/node@20.12.11) transitivePeerDependencies: - rollup diff --git a/support/sample/create_h5_sample.py b/support/sample/create_h5_sample.py index 74e99e9a2..4abdcd251 100644 --- a/support/sample/create_h5_sample.py +++ b/support/sample/create_h5_sample.py @@ -265,6 +265,13 @@ def print_h5t_class(dataset): vlen_scalar = add_scalar(h5, "vlen_int8", dtype=h5py.vlen_dtype(np.int8)) vlen_scalar[()] = [0, 1] + vlen_array = add_array( + h5, "vlen_float32", shape=(2,), dtype=h5py.vlen_dtype(np.float32) + ) + # Skip to make sure providers fill the gap with an empty array + # vlen_array[0] = [] + vlen_array[1] = [0] + vlen_array = add_array( h5, "vlen_int64", shape=(3,), dtype=h5py.vlen_dtype(np.int64) )