Skip to content

Commit

Permalink
changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
manzt committed Aug 22, 2023
1 parent b3a914e commit c442cb1
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
8 changes: 8 additions & 0 deletions .changeset/nice-jars-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@zarrita/indexing": patch
"@zarrita/ndarray": patch
"zarrita": patch
"@zarrita/core": patch
---

feat: support VlenUTF8 codec and introduce Object Array
1 change: 0 additions & 1 deletion packages/core/__tests__/consolidated.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,4 @@ describe("openConsolidated", () => {
let arr = h.open(grp.resolve("1d.chunked.i2"), { kind: "array" });
expect(arr.kind).toBe("array");
});

});
6 changes: 2 additions & 4 deletions packages/core/__tests__/open.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,17 +299,16 @@ describe("v2", () => {
[[0, 0, 0], ["a", "aa"]],
[[1, 0, 0], ["b", "bb"]],
[[0, 1, 0], ["aaa", "aaaa"]],
[[1, 1, 0], ["bbb", "bbbb"]]
[[1, 1, 0], ["bbb", "bbbb"]],
])(`getChunk(%j) -> %j`, async (index, expected) => {
expect(await arr.getChunk(index)).toStrictEqual({
data: expected,
shape: [1, 1, 2],
stride: [2, 2, 1],
});
})
});
});


describe("3d.chunked.mixed.i2.C", async () => {
let arr = await open.v2(store.resolve("/3d.chunked.mixed.i2.C"), {
kind: "array",
Expand Down Expand Up @@ -891,5 +890,4 @@ describe("v3", () => {
});
});
});

});
2 changes: 1 addition & 1 deletion packages/core/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export function v2_to_v3_array_metadata(
}
if ("endian" in dtype && dtype.endian === "big") {
codecs.push({ name: "endian", configuration: { endian: "big" } });
}
}
for (let { id, ...configuration } of meta.filters ?? []) {
codecs.push({ name: id, configuration });
}
Expand Down
3 changes: 0 additions & 3 deletions packages/indexing/__tests__/get.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ async function get_v2(
}

describe("get v2", () => {

it("1d.contiguous.zlib.i2", async () => {
expect(await get_v2("/1d.contiguous.zlib.i2")).toMatchInlineSnapshot(`
{
Expand Down Expand Up @@ -568,7 +567,6 @@ describe("get v2", () => {
stride: [4, 2, 1],
});
});

});

async function get_v3(
Expand Down Expand Up @@ -684,7 +682,6 @@ describe("get v3", () => {
expect(res.shape).toStrictEqual([3, 3, 3]);
});


it("3d.chunked.mixed.i2.C", async () => {
let res = await get_v3("/3d.chunked.mixed.i2.C");
expect(res.data).toStrictEqual(new Int16Array(range(27)));
Expand Down
7 changes: 5 additions & 2 deletions packages/indexing/src/ops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ type CompatChunk<D extends core.DataType> = {
stride: number[];
};

function object_array_proxy<T extends core.DataType>(arr: T[], offset = 0, lengthArg?: number): TypedArrayProxy<T> {
function object_array_proxy<T extends core.DataType>(
arr: T[],
offset = 0,
lengthArg?: number,
): TypedArrayProxy<T> {
let length = lengthArg ?? arr.length - offset;
return new Proxy(arr, {
get(target, prop: string) {
Expand All @@ -57,7 +61,6 @@ function object_array_proxy<T extends core.DataType>(arr: T[], offset = 0, lengt
return true;
},
}) as any;

}

function string_array_proxy<D extends core.ByteStr | core.UnicodeStr>(
Expand Down

0 comments on commit c442cb1

Please sign in to comment.