Skip to content

Commit fb49f63

Browse files
authored
chore: update for v0.1 releases of spatial, multiscales, proj (#18)
1 parent c4d4758 commit fb49f63

26 files changed

Lines changed: 79 additions & 80 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Python library for creating and validating [GeoZarr](https://github.com/zarr-developers/geozarr-spec)-compliant metadata. Provides Pydantic models, helper functions, and a CLI for the modular [Zarr conventions](https://github.com/zarr-conventions):
44

55
- **[spatial:](https://github.com/zarr-conventions/spatial)** -- Coordinate transforms between array indices and spatial coordinates
6-
- **[proj:](https://github.com/zarr-experimental/geo-proj)** -- Coordinate Reference System (CRS) via EPSG codes, WKT2, or PROJJSON
6+
- **[proj:](https://github.com/zarr-conventions/proj)** -- Coordinate Reference System (CRS) via EPSG codes, WKT2, or PROJJSON
77
- **[multiscales](https://github.com/zarr-conventions/multiscales)** -- Pyramid structures and resolution levels
88

99
## Installation

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Python library for creating and validating [GeoZarr](https://github.com/zarr-developers/geozarr-spec)-compliant metadata. Provides Pydantic models, helper functions, and a CLI for the modular [Zarr conventions](https://github.com/zarr-conventions):
44

55
- **[spatial:](https://github.com/zarr-conventions/spatial)** -- Coordinate transforms between array indices and spatial coordinates
6-
- **[proj:](https://github.com/zarr-experimental/geo-proj)** -- Coordinate Reference System (CRS) via EPSG codes, WKT2, or PROJJSON
6+
- **[proj:](https://github.com/zarr-conventions/proj)** -- Coordinate Reference System (CRS) via EPSG codes, WKT2, or PROJJSON
77
- **[multiscales](https://github.com/zarr-conventions/multiscales)** -- Pyramid structures and resolution levels
88

99
## Quick example

metazarr/scripts/compile-validators.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ const OUT_DIR = resolve(__dirname, "../src/generated");
1919

2020
/** Known convention schemas to pre-compile, keyed by schema URL. */
2121
const SCHEMAS = {
22-
"https://raw.githubusercontent.com/zarr-conventions/geo-proj/refs/heads/main/schema.json":
23-
{ id: "geo_proj", draft: "07" },
22+
"https://raw.githubusercontent.com/zarr-conventions/proj/refs/heads/main/schema.json":
23+
{ id: "proj", draft: "07" },
2424
"https://raw.githubusercontent.com/zarr-conventions/spatial/refs/heads/main/schema.json":
2525
{ id: "spatial", draft: "07" },
2626
"https://raw.githubusercontent.com/zarr-conventions/multiscales/refs/heads/main/schema.json":

metazarr/src/conventions.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* @typedef {Object} ConventionInfo
55
* @property {string} uuid - Convention UUID
6-
* @property {string} name - Convention name (e.g. "proj:", "spatial:")
6+
* @property {string} name - Convention name (e.g. "proj", "spatial")
77
* @property {string} display - Human-readable display name
88
* @property {string} color - Colorblind-friendly color for UI display
99
* @property {string|undefined} schemaUrl - URL to JSON Schema
@@ -16,14 +16,14 @@
1616
*/
1717
const KNOWN_CONVENTIONS = {
1818
"f17cb550-5864-4468-aeb7-f3180cfb622f": {
19-
name: "proj:",
19+
name: "proj",
2020
display: "Geospatial Projection (proj:)",
2121
color: "#0072B2", // blue
22-
schemaUrl: "https://raw.githubusercontent.com/zarr-conventions/geo-proj/refs/heads/main/schema.json",
23-
specUrl: "https://github.com/zarr-conventions/geo-proj/blob/main/README.md",
22+
schemaUrl: "https://raw.githubusercontent.com/zarr-conventions/proj/refs/heads/main/schema.json",
23+
specUrl: "https://github.com/zarr-conventions/proj/blob/main/README.md",
2424
},
2525
"689b58e2-cf7b-45e0-9fff-9cfc0883d6b4": {
26-
name: "spatial:",
26+
name: "spatial",
2727
display: "Spatial Coordinates (spatial:)",
2828
color: "#E69F00", // orange
2929
schemaUrl: "https://raw.githubusercontent.com/zarr-conventions/spatial/refs/heads/main/schema.json",

metazarr/test/consolidated-v3.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const SAMPLE_ROOT_ZARR_JSON = {
2222
attributes: {
2323
zarr_conventions: [
2424
{ uuid: "d35379db-88df-4056-af3a-620245f8e347", name: "multiscales" },
25-
{ uuid: "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4", name: "spatial:" },
25+
{ uuid: "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4", name: "spatial" },
2626
],
2727
"spatial:dimensions": ["Y", "X"],
2828
},

metazarr/test/conventions.test.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ describe("detectConventions", () => {
77
zarr_conventions: [
88
{
99
uuid: "f17cb550-5864-4468-aeb7-f3180cfb622f",
10-
name: "proj:",
10+
name: "proj",
1111
schema_url:
12-
"https://raw.githubusercontent.com/zarr-experimental/geo-proj/refs/tags/v1/schema.json",
12+
"https://raw.githubusercontent.com/zarr-conventions/proj/refs/tags/v0.1/schema.json",
1313
},
1414
{
1515
uuid: "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4",
16-
name: "spatial:",
16+
name: "spatial",
1717
schema_url:
18-
"https://raw.githubusercontent.com/zarr-conventions/spatial/refs/tags/v1/schema.json",
18+
"https://raw.githubusercontent.com/zarr-conventions/spatial/refs/tags/v0.1/schema.json",
1919
},
2020
],
2121
"proj:code": "EPSG:26711",
@@ -24,10 +24,10 @@ describe("detectConventions", () => {
2424

2525
const result = detectConventions(attrs);
2626
expect(result).toHaveLength(2);
27-
expect(result[0].name).toBe("proj:");
27+
expect(result[0].name).toBe("proj");
2828
expect(result[0].display).toBe("Geospatial Projection (proj:)");
29-
expect(result[0].schemaUrl).toContain("geo-proj");
30-
expect(result[1].name).toBe("spatial:");
29+
expect(result[0].schemaUrl).toContain("proj");
30+
expect(result[1].name).toBe("spatial");
3131
expect(result[1].display).toBe("Spatial Coordinates (spatial:)");
3232
});
3333

@@ -40,11 +40,11 @@ describe("detectConventions", () => {
4040
},
4141
{
4242
uuid: "f17cb550-5864-4468-aeb7-f3180cfb622f",
43-
name: "proj:",
43+
name: "proj",
4444
},
4545
{
4646
uuid: "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4",
47-
name: "spatial:",
47+
name: "spatial",
4848
},
4949
],
5050
};
@@ -53,8 +53,8 @@ describe("detectConventions", () => {
5353
expect(result).toHaveLength(3);
5454
expect(result.map((c) => c.name)).toEqual([
5555
"multiscales",
56-
"proj:",
57-
"spatial:",
56+
"proj",
57+
"spatial",
5858
]);
5959
});
6060

@@ -83,7 +83,7 @@ describe("detectConventions", () => {
8383

8484
const result = detectConventions(attrs);
8585
expect(result).toHaveLength(2);
86-
expect(result.map((c) => c.name).sort()).toEqual(["proj:", "spatial:"]);
86+
expect(result.map((c) => c.name).sort()).toEqual(["proj", "spatial"]);
8787
// Fallback detection still provides schema URLs from the registry
8888
for (const conv of result) {
8989
expect(conv.schemaUrl).toContain("refs/heads/main");
@@ -133,7 +133,7 @@ describe("detectConventions", () => {
133133
zarr_conventions: [
134134
{
135135
uuid: "f17cb550-5864-4468-aeb7-f3180cfb622f",
136-
name: "proj:",
136+
name: "proj",
137137
schema_url: "https://example.com/old-tagged-schema.json",
138138
spec_url: "https://example.com/spec",
139139
},
@@ -142,9 +142,9 @@ describe("detectConventions", () => {
142142

143143
const result = detectConventions(attrs);
144144
expect(result[0].schemaUrl).toContain("refs/heads/main");
145-
expect(result[0].schemaUrl).toContain("geo-proj");
145+
expect(result[0].schemaUrl).toContain("proj");
146146
// Registry specUrl takes precedence over data spec_url for known conventions
147-
expect(result[0].specUrl).toContain("geo-proj");
147+
expect(result[0].specUrl).toContain("proj");
148148
expect(result[0].specUrl).toContain("blob/main");
149149
});
150150

@@ -166,8 +166,8 @@ describe("detectConventions", () => {
166166
it("does not duplicate conventions", () => {
167167
const attrs = {
168168
zarr_conventions: [
169-
{ uuid: "f17cb550-5864-4468-aeb7-f3180cfb622f", name: "proj:" },
170-
{ uuid: "f17cb550-5864-4468-aeb7-f3180cfb622f", name: "proj:" },
169+
{ uuid: "f17cb550-5864-4468-aeb7-f3180cfb622f", name: "proj" },
170+
{ uuid: "f17cb550-5864-4468-aeb7-f3180cfb622f", name: "proj" },
171171
],
172172
};
173173

@@ -182,7 +182,7 @@ describe("getKnownConvention", () => {
182182
"f17cb550-5864-4468-aeb7-f3180cfb622f",
183183
);
184184
expect(conv).toBeDefined();
185-
expect(conv.name).toBe("proj:");
185+
expect(conv.name).toBe("proj");
186186
});
187187

188188
it("returns undefined for unknown UUID", () => {

metazarr/test/report.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ function withZarrConventions(attrs, conventions) {
2424

2525
const SPATIAL_CONV_ENTRY = {
2626
uuid: "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4",
27-
name: "spatial:",
27+
name: "spatial",
2828
};
2929

3030
const PROJ_CONV_ENTRY = {
3131
uuid: "f17cb550-5864-4468-aeb7-f3180cfb622f",
32-
name: "proj:",
32+
name: "proj",
3333
};
3434

3535
describe("collectNodes", () => {

metazarr/test/validator.test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { runValidation, buildNodeDocument } from "../src/validator.js";
88
* for test-only schemas while exercising the same error processing logic.
99
*/
1010

11-
// Minimal geo-proj schema (Draft-07) for testing
11+
// Minimal proj schema (Draft-07) for testing
1212
const PROJ_SCHEMA = {
1313
$schema: "http://json-schema.org/draft-07/schema#",
1414
type: "object",
@@ -59,7 +59,7 @@ const CONTAINS_REF_SCHEMA = {
5959
type: "object",
6060
properties: {
6161
uuid: { const: "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4" },
62-
name: { const: "spatial:" },
62+
name: { const: "spatial" },
6363
description: { const: "Spatial coordinate information" },
6464
},
6565
anyOf: [{ required: ["uuid"] }, { required: ["name"] }],
@@ -82,7 +82,7 @@ describe("runValidation", () => {
8282
node_type: "array",
8383
attributes: {
8484
zarr_conventions: [
85-
{ uuid: "f17cb550-5864-4468-aeb7-f3180cfb622f", name: "proj:" },
85+
{ uuid: "f17cb550-5864-4468-aeb7-f3180cfb622f", name: "proj" },
8686
],
8787
"proj:code": "EPSG:26711",
8888
},
@@ -133,8 +133,8 @@ describe("runValidation", () => {
133133
node_type: "group",
134134
attributes: {
135135
zarr_conventions: [
136-
{ uuid: "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4", name: "spatial:", description: "Wrong desc" },
137-
{ uuid: "f17cb550-5864-4468-aeb7-f3180cfb622f", name: "proj:" },
136+
{ uuid: "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4", name: "spatial", description: "Wrong desc" },
137+
{ uuid: "f17cb550-5864-4468-aeb7-f3180cfb622f", name: "proj" },
138138
],
139139
"spatial:dimensions": ["Y", "X"],
140140
},
@@ -170,7 +170,7 @@ describe("runValidation", () => {
170170
node_type: "group",
171171
attributes: {
172172
zarr_conventions: [
173-
{ uuid: "f17cb550-5864-4468-aeb7-f3180cfb622f", name: "proj:" },
173+
{ uuid: "f17cb550-5864-4468-aeb7-f3180cfb622f", name: "proj" },
174174
],
175175
// spatial:dimensions is missing (required)
176176
},
@@ -196,8 +196,8 @@ describe("runValidation", () => {
196196
attributes: {
197197
zarr_conventions: [
198198
{ uuid: "d35379db-88df-4056-af3a-620245f8e347", name: "multiscales" },
199-
{ uuid: "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4", name: "spatial:", description: "Wrong" },
200-
{ uuid: "f17cb550-5864-4468-aeb7-f3180cfb622f", name: "proj:" },
199+
{ uuid: "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4", name: "spatial", description: "Wrong" },
200+
{ uuid: "f17cb550-5864-4468-aeb7-f3180cfb622f", name: "proj" },
201201
],
202202
"spatial:dimensions": ["Y", "X"],
203203
},
@@ -210,7 +210,7 @@ describe("runValidation", () => {
210210
const failure = result.containsFailures[0];
211211
// Best match should be index 1 (spatial entry)
212212
expect(failure.bestMatchIndex).toBe(1);
213-
expect(failure.bestMatchItem.name).toBe("spatial:");
213+
expect(failure.bestMatchItem.name).toBe("spatial");
214214

215215
// Should NOT have errors about multiscales (index 0) or proj (index 2)
216216
expect(result.errors).toEqual([]);

src/geozarr_toolkit/cli.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,15 @@ def info_command(args: argparse.Namespace) -> int:
227227
for level in layout:
228228
asset = level.get("asset", "?")
229229
derived = level.get("derived_from", "")
230+
chunk_shape = level.get("read_chunk_shape")
231+
parts = [asset]
230232
if derived:
231-
print(f" - {asset} (from {derived})")
232-
else:
233-
print(f" - {asset}")
233+
parts.append(f"from {derived}")
234+
if chunk_shape:
235+
parts.append(f"read_chunk_shape={chunk_shape}")
236+
print(
237+
f" - {parts[0]}" + (f" ({', '.join(parts[1:])})" if len(parts) > 1 else "")
238+
)
234239
print()
235240

236241
if args.verbose:

src/geozarr_toolkit/conventions/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
PROJ_SCHEMA_URL,
4949
PROJ_SPEC_URL,
5050
PROJ_UUID,
51-
GeoProj,
5251
Proj,
5352
ProjConventionMetadata,
5453
)
@@ -70,7 +69,6 @@
7069
"SPATIAL_SCHEMA_URL",
7170
"SPATIAL_SPEC_URL",
7271
"SPATIAL_UUID",
73-
"GeoProj",
7472
"Multiscales",
7573
"MultiscalesAttrs",
7674
"MultiscalesConventionMetadata",

0 commit comments

Comments
 (0)