@vitessce/spatial-utils 3.3.6 → 3.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blosc-537fd004.js +891 -0
- package/dist/browser-122c4c35.js +786 -0
- package/dist/chunk-INHXZS53-bee20a28.js +19 -0
- package/dist/{deflate-91360e96.js → deflate-88edcce0.js} +1 -1
- package/dist/gzip-6a24f0fe.js +30 -0
- package/dist/{index-ecfc14b5.js → index-2e60bcd0.js} +159 -53
- package/dist/index.js +1 -1
- package/dist/{jpeg-8a56f635.js → jpeg-36de5225.js} +1 -1
- package/dist/{lerc-cafe8298.js → lerc-cecad635.js} +1 -1
- package/dist/lz4-bbd18009.js +808 -0
- package/dist/{lzw-a029f738.js → lzw-19c945c0.js} +1 -1
- package/dist/{packbits-1048f7af.js → packbits-1b575957.js} +1 -1
- package/dist/{raw-862c78b4.js → raw-56a83d25.js} +1 -1
- package/dist/{webimage-452cf0ca.js → webimage-0c15a0b7.js} +1 -1
- package/dist/zlib-175cd38d.js +30 -0
- package/dist/zstd-ec5a40b8.js +808 -0
- package/package.json +5 -5
- package/dist/blosc-0acfcf7e.js +0 -975
- package/dist/gzip-dd5ab7c8.js +0 -28
- package/dist/lz4-abb4416a.js +0 -919
- package/dist/pako.esm-856454b6-c5c8cd15.js +0 -4066
- package/dist/zlib-cd823c38.js +0 -28
- package/dist/zstd-4072ca78.js +0 -919
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __toBinary = /* @__PURE__ */ (() => {
|
|
2
|
+
var table = new Uint8Array(128);
|
|
3
|
+
for (var i = 0; i < 64; i++)
|
|
4
|
+
table[i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i * 4 - 205] = i;
|
|
5
|
+
return (base64) => {
|
|
6
|
+
var n = base64.length, bytes = new Uint8Array((n - (base64[n - 1] == "=") - (base64[n - 2] == "=")) * 3 / 4 | 0);
|
|
7
|
+
for (var i2 = 0, j = 0; i2 < n; ) {
|
|
8
|
+
var c0 = table[base64.charCodeAt(i2++)], c1 = table[base64.charCodeAt(i2++)];
|
|
9
|
+
var c2 = table[base64.charCodeAt(i2++)], c3 = table[base64.charCodeAt(i2++)];
|
|
10
|
+
bytes[j++] = c0 << 2 | c1 >> 4;
|
|
11
|
+
bytes[j++] = c1 << 4 | c2 >> 2;
|
|
12
|
+
bytes[j++] = c2 << 6 | c3;
|
|
13
|
+
}
|
|
14
|
+
return bytes;
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
export {
|
|
18
|
+
__toBinary as _
|
|
19
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
7
|
+
var _a;
|
|
8
|
+
import { g as gzipSync, a as gunzipSync } from "./browser-122c4c35.js";
|
|
9
|
+
var GZip = (_a = class {
|
|
10
|
+
constructor(level = 1) {
|
|
11
|
+
__publicField(this, "level");
|
|
12
|
+
if (level < 0 || level > 9) {
|
|
13
|
+
throw new Error("Invalid gzip compression level, it should be between 0 and 9");
|
|
14
|
+
}
|
|
15
|
+
this.level = level;
|
|
16
|
+
}
|
|
17
|
+
static fromConfig({ level }) {
|
|
18
|
+
return new _a(level);
|
|
19
|
+
}
|
|
20
|
+
encode(data) {
|
|
21
|
+
return gzipSync(data, { level: this.level });
|
|
22
|
+
}
|
|
23
|
+
decode(data) {
|
|
24
|
+
return gunzipSync(data);
|
|
25
|
+
}
|
|
26
|
+
}, __publicField(_a, "codecId", "gzip"), _a);
|
|
27
|
+
var gzip_default = GZip;
|
|
28
|
+
export {
|
|
29
|
+
gzip_default as default
|
|
30
|
+
};
|
|
@@ -22,7 +22,7 @@ var __privateSet = (obj, member, value, setter2) => {
|
|
|
22
22
|
setter2 ? setter2.call(obj, value) : member.set(obj, value);
|
|
23
23
|
return value;
|
|
24
24
|
};
|
|
25
|
-
var _bytes, _encoder, _encode_buffer, _strides, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _shape2, _strides2, _metadata, _metadata2, _a2, _b;
|
|
25
|
+
var _bytes, _encoder, _data, _encode_buffer, _strides, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _shape2, _strides2, _encoder_config, _decoder_config, _metadata, _metadata2, _a2, _b;
|
|
26
26
|
import "react";
|
|
27
27
|
function _mergeNamespaces(n3, m) {
|
|
28
28
|
for (var i2 = 0; i2 < m.length; i2++) {
|
|
@@ -119066,16 +119066,16 @@ function addDecoder(cases, importFn) {
|
|
|
119066
119066
|
}
|
|
119067
119067
|
cases.forEach((c) => registry$2.set(c, importFn));
|
|
119068
119068
|
}
|
|
119069
|
-
addDecoder([void 0, 1], () => import("./raw-
|
|
119070
|
-
addDecoder(5, () => import("./lzw-
|
|
119069
|
+
addDecoder([void 0, 1], () => import("./raw-56a83d25.js").then((m) => m.default));
|
|
119070
|
+
addDecoder(5, () => import("./lzw-19c945c0.js").then((m) => m.default));
|
|
119071
119071
|
addDecoder(6, () => {
|
|
119072
119072
|
throw new Error("old style JPEG compression is not supported.");
|
|
119073
119073
|
});
|
|
119074
|
-
addDecoder(7, () => import("./jpeg-
|
|
119075
|
-
addDecoder([8, 32946], () => import("./deflate-
|
|
119076
|
-
addDecoder(32773, () => import("./packbits-
|
|
119077
|
-
addDecoder(34887, () => import("./lerc-
|
|
119078
|
-
addDecoder(50001, () => import("./webimage-
|
|
119074
|
+
addDecoder(7, () => import("./jpeg-36de5225.js").then((m) => m.default));
|
|
119075
|
+
addDecoder([8, 32946], () => import("./deflate-88edcce0.js").then((m) => m.default));
|
|
119076
|
+
addDecoder(32773, () => import("./packbits-1b575957.js").then((m) => m.default));
|
|
119077
|
+
addDecoder(34887, () => import("./lerc-cecad635.js").then((m) => m.default));
|
|
119078
|
+
addDecoder(50001, () => import("./webimage-0c15a0b7.js").then((m) => m.default));
|
|
119079
119079
|
function decodeRowAcc(row, stride) {
|
|
119080
119080
|
let length2 = row.length - stride;
|
|
119081
119081
|
let offset = 0;
|
|
@@ -131266,14 +131266,14 @@ function normalizeCoordinateTransformations(coordinateTransformations, datasets)
|
|
|
131266
131266
|
return result;
|
|
131267
131267
|
}
|
|
131268
131268
|
class NodeNotFoundError extends Error {
|
|
131269
|
-
constructor(
|
|
131270
|
-
super(
|
|
131269
|
+
constructor(context, options = {}) {
|
|
131270
|
+
super(`Node not found: ${context}`, options);
|
|
131271
131271
|
this.name = "NodeNotFoundError";
|
|
131272
131272
|
}
|
|
131273
131273
|
}
|
|
131274
131274
|
class KeyError extends Error {
|
|
131275
|
-
constructor(
|
|
131276
|
-
super(
|
|
131275
|
+
constructor(path) {
|
|
131276
|
+
super(`Missing key: ${path}`);
|
|
131277
131277
|
this.name = "KeyError";
|
|
131278
131278
|
}
|
|
131279
131279
|
}
|
|
@@ -131384,56 +131384,56 @@ class ByteStringArray {
|
|
|
131384
131384
|
_encoder = new WeakMap();
|
|
131385
131385
|
const _UnicodeStringArray = class {
|
|
131386
131386
|
constructor(chars, x2, byteOffset, length2) {
|
|
131387
|
-
|
|
131387
|
+
__privateAdd(this, _data, void 0);
|
|
131388
131388
|
__publicField(this, "chars");
|
|
131389
131389
|
__privateAdd(this, _encode_buffer, void 0);
|
|
131390
131390
|
this.chars = chars;
|
|
131391
131391
|
if (typeof x2 === "number") {
|
|
131392
|
-
this
|
|
131392
|
+
__privateSet(this, _data, new Int32Array(x2 * chars));
|
|
131393
131393
|
} else if (x2 instanceof ArrayBuffer) {
|
|
131394
131394
|
if (length2)
|
|
131395
131395
|
length2 *= chars;
|
|
131396
|
-
this
|
|
131396
|
+
__privateSet(this, _data, new Int32Array(x2, byteOffset, length2));
|
|
131397
131397
|
} else {
|
|
131398
131398
|
const values = x2;
|
|
131399
131399
|
const d = new _UnicodeStringArray(chars, 1);
|
|
131400
|
-
this
|
|
131400
|
+
__privateSet(this, _data, new Int32Array(function* () {
|
|
131401
131401
|
for (let str of values) {
|
|
131402
131402
|
d.set(0, str);
|
|
131403
|
-
yield* d
|
|
131403
|
+
yield* __privateGet(d, _data);
|
|
131404
131404
|
}
|
|
131405
|
-
}());
|
|
131405
|
+
}()));
|
|
131406
131406
|
}
|
|
131407
131407
|
__privateSet(this, _encode_buffer, new Int32Array(chars));
|
|
131408
131408
|
}
|
|
131409
131409
|
get BYTES_PER_ELEMENT() {
|
|
131410
|
-
return this
|
|
131410
|
+
return __privateGet(this, _data).BYTES_PER_ELEMENT * this.chars;
|
|
131411
131411
|
}
|
|
131412
131412
|
get byteLength() {
|
|
131413
|
-
return this
|
|
131413
|
+
return __privateGet(this, _data).byteLength;
|
|
131414
131414
|
}
|
|
131415
131415
|
get byteOffset() {
|
|
131416
|
-
return this
|
|
131416
|
+
return __privateGet(this, _data).byteOffset;
|
|
131417
131417
|
}
|
|
131418
131418
|
/** @type {ArrayBuffer} */
|
|
131419
131419
|
get buffer() {
|
|
131420
|
-
return this
|
|
131420
|
+
return __privateGet(this, _data).buffer;
|
|
131421
131421
|
}
|
|
131422
131422
|
/** @type {number} */
|
|
131423
131423
|
get length() {
|
|
131424
|
-
return this
|
|
131424
|
+
return __privateGet(this, _data).length / this.chars;
|
|
131425
131425
|
}
|
|
131426
131426
|
get(idx) {
|
|
131427
131427
|
const offset = this.chars * idx;
|
|
131428
131428
|
let result = "";
|
|
131429
131429
|
for (let i2 = 0; i2 < this.chars; i2++) {
|
|
131430
|
-
result += String.fromCodePoint(this
|
|
131430
|
+
result += String.fromCodePoint(__privateGet(this, _data)[offset + i2]);
|
|
131431
131431
|
}
|
|
131432
131432
|
return result.replace(/\u0000/g, "");
|
|
131433
131433
|
}
|
|
131434
131434
|
set(idx, value) {
|
|
131435
131435
|
const offset = this.chars * idx;
|
|
131436
|
-
const view = this
|
|
131436
|
+
const view = __privateGet(this, _data).subarray(offset, offset + this.chars);
|
|
131437
131437
|
view.fill(0);
|
|
131438
131438
|
for (let i2 = 0; i2 < this.chars; i2++) {
|
|
131439
131439
|
view[i2] = value.codePointAt(i2) ?? 0;
|
|
@@ -131441,9 +131441,9 @@ const _UnicodeStringArray = class {
|
|
|
131441
131441
|
}
|
|
131442
131442
|
fill(value) {
|
|
131443
131443
|
this.set(0, value);
|
|
131444
|
-
let encoded = this
|
|
131444
|
+
let encoded = __privateGet(this, _data).subarray(0, this.chars);
|
|
131445
131445
|
for (let i2 = 1; i2 < this.length; i2++) {
|
|
131446
|
-
this
|
|
131446
|
+
__privateGet(this, _data).set(encoded, i2 * this.chars);
|
|
131447
131447
|
}
|
|
131448
131448
|
}
|
|
131449
131449
|
*[Symbol.iterator]() {
|
|
@@ -131453,6 +131453,7 @@ const _UnicodeStringArray = class {
|
|
|
131453
131453
|
}
|
|
131454
131454
|
};
|
|
131455
131455
|
let UnicodeStringArray = _UnicodeStringArray;
|
|
131456
|
+
_data = new WeakMap();
|
|
131456
131457
|
_encode_buffer = new WeakMap();
|
|
131457
131458
|
function json_decode_object(bytes) {
|
|
131458
131459
|
const str = new TextDecoder().decode(bytes);
|
|
@@ -131818,8 +131819,115 @@ const _VLenUTF8 = class {
|
|
|
131818
131819
|
let VLenUTF8 = _VLenUTF8;
|
|
131819
131820
|
_shape2 = new WeakMap();
|
|
131820
131821
|
_strides2 = new WeakMap();
|
|
131822
|
+
function throw_on_nan_replacer(_key, value) {
|
|
131823
|
+
if (value !== value) {
|
|
131824
|
+
throw new Error("JsonCodec allow_nan is false but NaN was encountered during encoding.");
|
|
131825
|
+
}
|
|
131826
|
+
if (value === Infinity) {
|
|
131827
|
+
throw new Error("JsonCodec allow_nan is false but Infinity was encountered during encoding.");
|
|
131828
|
+
}
|
|
131829
|
+
if (value === -Infinity) {
|
|
131830
|
+
throw new Error("JsonCodec allow_nan is false but -Infinity was encountered during encoding.");
|
|
131831
|
+
}
|
|
131832
|
+
return value;
|
|
131833
|
+
}
|
|
131834
|
+
function sort_keys_replacer(_key, value) {
|
|
131835
|
+
return value instanceof Object && !(value instanceof Array) ? Object.keys(value).sort().reduce((sorted, key) => {
|
|
131836
|
+
sorted[key] = value[key];
|
|
131837
|
+
return sorted;
|
|
131838
|
+
}, {}) : value;
|
|
131839
|
+
}
|
|
131840
|
+
const _JsonCodec = class {
|
|
131841
|
+
constructor(configuration) {
|
|
131842
|
+
__publicField(this, "configuration");
|
|
131843
|
+
__publicField(this, "kind", "array_to_bytes");
|
|
131844
|
+
__privateAdd(this, _encoder_config, void 0);
|
|
131845
|
+
__privateAdd(this, _decoder_config, void 0);
|
|
131846
|
+
this.configuration = configuration;
|
|
131847
|
+
const { encoding = "utf-8", skipkeys = false, ensure_ascii = true, check_circular = true, allow_nan = true, sort_keys = true, indent, strict = true } = configuration;
|
|
131848
|
+
let separators = configuration.separators;
|
|
131849
|
+
if (!separators) {
|
|
131850
|
+
if (!indent) {
|
|
131851
|
+
separators = [",", ":"];
|
|
131852
|
+
} else {
|
|
131853
|
+
separators = [", ", ": "];
|
|
131854
|
+
}
|
|
131855
|
+
}
|
|
131856
|
+
__privateSet(this, _encoder_config, {
|
|
131857
|
+
encoding,
|
|
131858
|
+
skipkeys,
|
|
131859
|
+
ensure_ascii,
|
|
131860
|
+
check_circular,
|
|
131861
|
+
allow_nan,
|
|
131862
|
+
indent,
|
|
131863
|
+
separators,
|
|
131864
|
+
sort_keys
|
|
131865
|
+
});
|
|
131866
|
+
__privateSet(this, _decoder_config, { strict });
|
|
131867
|
+
}
|
|
131868
|
+
static fromConfig(configuration) {
|
|
131869
|
+
return new _JsonCodec(configuration);
|
|
131870
|
+
}
|
|
131871
|
+
encode(buf) {
|
|
131872
|
+
const { indent, encoding, ensure_ascii, check_circular, allow_nan, sort_keys } = __privateGet(this, _encoder_config);
|
|
131873
|
+
if (encoding !== "utf-8") {
|
|
131874
|
+
throw new Error("JsonCodec does not yet support non-utf-8 encoding.");
|
|
131875
|
+
}
|
|
131876
|
+
const replacer_functions = [];
|
|
131877
|
+
if (!check_circular) {
|
|
131878
|
+
throw new Error("JsonCodec does not yet support skipping the check for circular references during encoding.");
|
|
131879
|
+
}
|
|
131880
|
+
if (!allow_nan) {
|
|
131881
|
+
replacer_functions.push(throw_on_nan_replacer);
|
|
131882
|
+
}
|
|
131883
|
+
if (sort_keys) {
|
|
131884
|
+
replacer_functions.push(sort_keys_replacer);
|
|
131885
|
+
}
|
|
131886
|
+
const items = Array.from(buf.data);
|
|
131887
|
+
items.push("|O");
|
|
131888
|
+
items.push(buf.shape);
|
|
131889
|
+
let replacer = void 0;
|
|
131890
|
+
if (replacer_functions.length) {
|
|
131891
|
+
replacer = function(key, value) {
|
|
131892
|
+
let new_value = value;
|
|
131893
|
+
replacer_functions.forEach((sub_replacer) => {
|
|
131894
|
+
new_value = sub_replacer(key, new_value);
|
|
131895
|
+
});
|
|
131896
|
+
return new_value;
|
|
131897
|
+
};
|
|
131898
|
+
}
|
|
131899
|
+
let json_str = JSON.stringify(items, replacer, indent);
|
|
131900
|
+
if (ensure_ascii) {
|
|
131901
|
+
json_str = json_str.replace(/[\u007F-\uFFFF]/g, function(chr) {
|
|
131902
|
+
const full_str = "0000" + chr.charCodeAt(0).toString(16);
|
|
131903
|
+
const sub_str = full_str.substring(full_str.length - 4);
|
|
131904
|
+
return "\\u" + sub_str;
|
|
131905
|
+
});
|
|
131906
|
+
}
|
|
131907
|
+
return new TextEncoder().encode(json_str);
|
|
131908
|
+
}
|
|
131909
|
+
decode(bytes) {
|
|
131910
|
+
const { strict } = __privateGet(this, _decoder_config);
|
|
131911
|
+
if (!strict) {
|
|
131912
|
+
throw new Error("JsonCodec does not yet support non-strict decoding.");
|
|
131913
|
+
}
|
|
131914
|
+
const items = json_decode_object(bytes);
|
|
131915
|
+
const shape = items.pop();
|
|
131916
|
+
items.pop();
|
|
131917
|
+
if (!shape) {
|
|
131918
|
+
throw new Error("0D not implemented for JsonCodec.");
|
|
131919
|
+
} else {
|
|
131920
|
+
const stride = get_strides(shape, "C");
|
|
131921
|
+
const data = items;
|
|
131922
|
+
return { data, shape, stride };
|
|
131923
|
+
}
|
|
131924
|
+
}
|
|
131925
|
+
};
|
|
131926
|
+
let JsonCodec = _JsonCodec;
|
|
131927
|
+
_encoder_config = new WeakMap();
|
|
131928
|
+
_decoder_config = new WeakMap();
|
|
131821
131929
|
function create_default_registry() {
|
|
131822
|
-
return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-
|
|
131930
|
+
return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-537fd004.js").then((m) => m.default)).set("gzip", () => import("./gzip-6a24f0fe.js").then((m) => m.default)).set("lz4", () => import("./lz4-bbd18009.js").then((m) => m.default)).set("zlib", () => import("./zlib-175cd38d.js").then((m) => m.default)).set("zstd", () => import("./zstd-ec5a40b8.js").then((m) => m.default)).set("transpose", () => TransposeCodec).set("bytes", () => BytesCodec).set("crc32c", () => Crc32cCodec).set("vlen-utf8", () => VLenUTF8).set("json2", () => JsonCodec);
|
|
131823
131931
|
}
|
|
131824
131932
|
const registry = create_default_registry();
|
|
131825
131933
|
function create_codec_pipeline(chunk_metadata) {
|
|
@@ -132062,6 +132170,7 @@ let Array$1 = (_b = class extends Location {
|
|
|
132062
132170
|
return is_dtype(this.dtype, query);
|
|
132063
132171
|
}
|
|
132064
132172
|
}, _a2 = CONTEXT_MARKER, _metadata2 = new WeakMap(), _b);
|
|
132173
|
+
let VERSION_COUNTER = create_version_counter();
|
|
132065
132174
|
function create_version_counter() {
|
|
132066
132175
|
let version_counts = /* @__PURE__ */ new WeakMap();
|
|
132067
132176
|
function get_counts(store) {
|
|
@@ -132079,7 +132188,6 @@ function create_version_counter() {
|
|
|
132079
132188
|
}
|
|
132080
132189
|
};
|
|
132081
132190
|
}
|
|
132082
|
-
let VERSION_COUNTER = create_version_counter();
|
|
132083
132191
|
async function load_attrs(location) {
|
|
132084
132192
|
let meta_bytes = await location.store.get(location.resolve(".zattrs").path);
|
|
132085
132193
|
if (!meta_bytes)
|
|
@@ -132105,7 +132213,9 @@ async function open_array_v2(location, attrs) {
|
|
|
132105
132213
|
let { path } = location.resolve(".zarray");
|
|
132106
132214
|
let meta2 = await location.store.get(path);
|
|
132107
132215
|
if (!meta2) {
|
|
132108
|
-
throw new NodeNotFoundError(
|
|
132216
|
+
throw new NodeNotFoundError("v2 array", {
|
|
132217
|
+
cause: new KeyError(path)
|
|
132218
|
+
});
|
|
132109
132219
|
}
|
|
132110
132220
|
VERSION_COUNTER.increment(location.store, "v2");
|
|
132111
132221
|
return new Array$1(location.store, location.path, v2_to_v3_array_metadata(json_decode_object(meta2), attrs));
|
|
@@ -132114,7 +132224,9 @@ async function open_group_v2(location, attrs) {
|
|
|
132114
132224
|
let { path } = location.resolve(".zgroup");
|
|
132115
132225
|
let meta2 = await location.store.get(path);
|
|
132116
132226
|
if (!meta2) {
|
|
132117
|
-
throw new NodeNotFoundError(
|
|
132227
|
+
throw new NodeNotFoundError("v2 group", {
|
|
132228
|
+
cause: new KeyError(path)
|
|
132229
|
+
});
|
|
132118
132230
|
}
|
|
132119
132231
|
VERSION_COUNTER.increment(location.store, "v2");
|
|
132120
132232
|
return new Group(location.store, location.path, v2_to_v3_group_metadata(json_decode_object(meta2), attrs));
|
|
@@ -132123,7 +132235,9 @@ async function _open_v3(location) {
|
|
|
132123
132235
|
let { store, path } = location.resolve("zarr.json");
|
|
132124
132236
|
let meta2 = await location.store.get(path);
|
|
132125
132237
|
if (!meta2) {
|
|
132126
|
-
throw new NodeNotFoundError(
|
|
132238
|
+
throw new NodeNotFoundError("v3 array or group", {
|
|
132239
|
+
cause: new KeyError(path)
|
|
132240
|
+
});
|
|
132127
132241
|
}
|
|
132128
132242
|
let meta_doc = json_decode_object(meta2);
|
|
132129
132243
|
if (meta_doc.node_type === "array" && (meta_doc.data_type === "uint64" || meta_doc.data_type === "int64") && meta_doc.fill_value != void 0) {
|
|
@@ -132145,8 +132259,8 @@ async function open_v3(location, options = {}) {
|
|
|
132145
132259
|
throw new Error(`Expected node of kind ${options.kind}, found ${kind}.`);
|
|
132146
132260
|
}
|
|
132147
132261
|
async function open(location, options = {}) {
|
|
132148
|
-
|
|
132149
|
-
|
|
132262
|
+
let store = "store" in location ? location.store : location;
|
|
132263
|
+
let version_max = VERSION_COUNTER.version_max(store);
|
|
132150
132264
|
let open_primary = version_max === "v2" ? open.v2 : open.v3;
|
|
132151
132265
|
let open_secondary = version_max === "v2" ? open.v3 : open.v2;
|
|
132152
132266
|
return open_primary(location, options).catch((err2) => {
|
|
@@ -132190,7 +132304,7 @@ function* product(...iterables) {
|
|
|
132190
132304
|
results[i2] = iterators[i2].next();
|
|
132191
132305
|
}
|
|
132192
132306
|
}
|
|
132193
|
-
function slice_indices(start, stop, step, length2) {
|
|
132307
|
+
function slice_indices({ start, stop, step }, length2) {
|
|
132194
132308
|
if (step === 0) {
|
|
132195
132309
|
throw new Error("slice step cannot be zero");
|
|
132196
132310
|
}
|
|
@@ -132231,10 +132345,7 @@ function slice(start, stop, step = null) {
|
|
|
132231
132345
|
return {
|
|
132232
132346
|
start,
|
|
132233
132347
|
stop,
|
|
132234
|
-
step
|
|
132235
|
-
indices(length2) {
|
|
132236
|
-
return slice_indices(this.start, this.stop, this.step, length2);
|
|
132237
|
-
}
|
|
132348
|
+
step
|
|
132238
132349
|
};
|
|
132239
132350
|
}
|
|
132240
132351
|
function create_queue() {
|
|
@@ -132302,7 +132413,7 @@ class SliceDimIndexer {
|
|
|
132302
132413
|
__publicField(this, "dim_chunk_len");
|
|
132303
132414
|
__publicField(this, "nitems");
|
|
132304
132415
|
__publicField(this, "nchunks");
|
|
132305
|
-
const [start, stop, step] = dim_sel
|
|
132416
|
+
const [start, stop, step] = slice_indices(dim_sel, dim_len);
|
|
132306
132417
|
this.start = start;
|
|
132307
132418
|
this.stop = stop;
|
|
132308
132419
|
this.step = step;
|
|
@@ -132388,25 +132499,20 @@ function unwrap(arr, idx) {
|
|
|
132388
132499
|
}
|
|
132389
132500
|
async function get$1(arr, selection, opts, setter2) {
|
|
132390
132501
|
var _a3;
|
|
132391
|
-
|
|
132392
|
-
|
|
132502
|
+
let context = get_context(arr);
|
|
132503
|
+
let indexer = new BasicIndexer({
|
|
132393
132504
|
selection,
|
|
132394
132505
|
shape: arr.shape,
|
|
132395
132506
|
chunk_shape: arr.chunks
|
|
132396
132507
|
});
|
|
132397
|
-
|
|
132398
|
-
|
|
132508
|
+
let out = setter2.prepare(new context.TypedArray(indexer.shape.reduce((a2, b) => a2 * b, 1)), indexer.shape, context.get_strides(indexer.shape, opts.order));
|
|
132509
|
+
let queue = ((_a3 = opts.create_queue) == null ? void 0 : _a3.call(opts)) ?? create_queue();
|
|
132399
132510
|
for (const { chunk_coords, mapping } of indexer) {
|
|
132400
|
-
queue.add(
|
|
132401
|
-
|
|
132511
|
+
queue.add(async () => {
|
|
132512
|
+
let { data, shape, stride } = await arr.getChunk(chunk_coords, opts.opts);
|
|
132513
|
+
let chunk = setter2.prepare(data, shape, stride);
|
|
132402
132514
|
setter2.set_from_chunk(out, chunk, mapping);
|
|
132403
|
-
})
|
|
132404
|
-
if (!(err2 instanceof KeyError))
|
|
132405
|
-
throw err2;
|
|
132406
|
-
if (context.fill_value) {
|
|
132407
|
-
setter2.set_scalar(out, mapping.map((m) => m.to).filter((s2) => s2 !== null), context.fill_value);
|
|
132408
|
-
}
|
|
132409
|
-
}));
|
|
132515
|
+
});
|
|
132410
132516
|
}
|
|
132411
132517
|
await queue.onIdle();
|
|
132412
132518
|
return indexer.shape.length === 0 ? unwrap(out.data, 0) : out;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D, e, a, b, c, d, F, G, Z, C, r, n, E, A, y, l, m, z, x, h, q, v, o, i, f, j, k, u, t, p, s, w } from "./index-
|
|
1
|
+
import { D, e, a, b, c, d, F, G, Z, C, r, n, E, A, y, l, m, z, x, h, q, v, o, i, f, j, k, u, t, p, s, w } from "./index-2e60bcd0.js";
|
|
2
2
|
import "react";
|
|
3
3
|
export {
|
|
4
4
|
D as DEFAULT_CELLS_LAYER,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
|
|
2
|
-
import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-
|
|
2
|
+
import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-2e60bcd0.js";
|
|
3
3
|
import "react";
|
|
4
4
|
const LercParameters = {
|
|
5
5
|
Version: 0,
|