taco-eo 0.6.0__tar.gz → 0.6.2__tar.gz

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.
Files changed (81) hide show
  1. {taco_eo-0.6.0 → taco_eo-0.6.2}/CHANGELOG.md +16 -0
  2. {taco_eo-0.6.0 → taco_eo-0.6.2}/PKG-INFO +5 -4
  3. {taco_eo-0.6.0 → taco_eo-0.6.2}/README.md +4 -3
  4. {taco_eo-0.6.0 → taco_eo-0.6.2}/pyproject.toml +1 -1
  5. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/contract/contract.py +9 -15
  6. taco_eo-0.6.2/taco/extensions/__init__.py +7 -0
  7. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/extensions/spatiotemporal.py +25 -25
  8. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/metadata/folder.py +7 -7
  9. taco_eo-0.6.2/taco/metadata/sample.py +5 -0
  10. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/metadata/spatiotemporal.py +10 -10
  11. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/datasets.py +13 -9
  12. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/test_collection.py +1 -0
  13. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/test_contract.py +17 -1
  14. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/test_extension_spatiotemporal.py +20 -18
  15. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/test_metadata.py +27 -23
  16. taco_eo-0.6.0/taco/extensions/__init__.py +0 -7
  17. taco_eo-0.6.0/taco/metadata/sample.py +0 -5
  18. {taco_eo-0.6.0 → taco_eo-0.6.2}/.gitignore +0 -0
  19. {taco_eo-0.6.0 → taco_eo-0.6.2}/LICENSE +0 -0
  20. {taco_eo-0.6.0 → taco_eo-0.6.2}/examples/change_detection.py +0 -0
  21. {taco_eo-0.6.0 → taco_eo-0.6.2}/examples/geospatial.py +0 -0
  22. {taco_eo-0.6.0 → taco_eo-0.6.2}/examples/minimal.py +0 -0
  23. {taco_eo-0.6.0 → taco_eo-0.6.2}/examples/numpy_minimal.py +0 -0
  24. {taco_eo-0.6.0 → taco_eo-0.6.2}/examples/oceantaco_istac.py +0 -0
  25. {taco_eo-0.6.0 → taco_eo-0.6.2}/examples/partitioned.py +0 -0
  26. {taco_eo-0.6.0 → taco_eo-0.6.2}/examples/sequence.py +0 -0
  27. {taco_eo-0.6.0 → taco_eo-0.6.2}/examples/stac_segmentation.py +0 -0
  28. {taco_eo-0.6.0 → taco_eo-0.6.2}/examples/time_series.py +0 -0
  29. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/__init__.py +0 -0
  30. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/_graph.py +0 -0
  31. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/_parquet.py +0 -0
  32. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/_publish.py +0 -0
  33. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/_repr.py +0 -0
  34. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/_source.py +0 -0
  35. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/_view.py +0 -0
  36. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/contract/__init__.py +0 -0
  37. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/contract/collection.py +0 -0
  38. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/contract/naming.py +0 -0
  39. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/contract/sample.py +0 -0
  40. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/contract/structure.py +0 -0
  41. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/contract/types.py +0 -0
  42. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/cozip.py +0 -0
  43. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/dataset.py +0 -0
  44. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/errors.py +0 -0
  45. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/extensions/rumi.py +0 -0
  46. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/metadata/__init__.py +0 -0
  47. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/metadata/_base.py +0 -0
  48. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/metadata/asset.py +0 -0
  49. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/metadata/collection.py +0 -0
  50. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/metadata/data/admin/admin0.parquet +0 -0
  51. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/metadata/data/admin/admin1.parquet +0 -0
  52. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/metadata/data/admin/admin2.parquet +0 -0
  53. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/metadata/derived.py +0 -0
  54. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/metadata/split.py +0 -0
  55. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/py.typed +0 -0
  56. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/reader/__init__.py +0 -0
  57. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/reader/engine.py +0 -0
  58. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/schema.py +0 -0
  59. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/tacocat.py +0 -0
  60. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/validate.py +0 -0
  61. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/writer/__init__.py +0 -0
  62. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/writer/archive.py +0 -0
  63. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/writer/core.py +0 -0
  64. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/writer/folder.py +0 -0
  65. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/writer/metadata_tables.py +0 -0
  66. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/writer/progress.py +0 -0
  67. {taco_eo-0.6.0 → taco_eo-0.6.2}/taco/writer/staging.py +0 -0
  68. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/__init__.py +0 -0
  69. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/conftest.py +0 -0
  70. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/test_examples.py +0 -0
  71. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/test_extension_contract.py +0 -0
  72. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/test_extension_rumi.py +0 -0
  73. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/test_parquet.py +0 -0
  74. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/test_progress.py +0 -0
  75. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/test_publish.py +0 -0
  76. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/test_reader.py +0 -0
  77. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/test_tacocat.py +0 -0
  78. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/test_types.py +0 -0
  79. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/test_validate.py +0 -0
  80. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/test_writer.py +0 -0
  81. {taco_eo-0.6.0 → taco_eo-0.6.2}/tests/test_writer_cases.py +0 -0
@@ -5,6 +5,22 @@ All notable changes to `taco` are documented here. The format follows
5
5
 
6
6
  ## Unreleased
7
7
 
8
+ ## 0.6.2 - 2026-09-13
9
+
10
+ ### Removed
11
+
12
+ - Writer-time extension graphs and operational configuration are no longer
13
+ serialized as `taco:derived` in `COLLECTION.json`. The active contract keeps
14
+ them only in memory while `run()` computes the declared metadata columns.
15
+
16
+ ## 0.6.1 - 2026-09-13
17
+
18
+ ### Changed
19
+
20
+ - Rename the standalone `SAC`, `ISAC`, and `TAC` APIs and namespaces to the
21
+ explicit `Spatial`/`spatial`, `ISpatial`/`ispatial`, and
22
+ `Temporal`/`temporal` names. `STAC` and `ISTAC` are unchanged.
23
+
8
24
  ## 0.6.0 - 2026-09-13
9
25
 
10
26
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: taco-eo
3
- Version: 0.6.0
3
+ Version: 0.6.2
4
4
  Summary: Read and write TACO datasets in Python.
5
5
  Project-URL: Homepage, https://asterisk.coop/taco
6
6
  Project-URL: Specification, https://asterisk.coop/taco/spec
@@ -73,9 +73,10 @@ parts = taco.read(["part-0.zip", "part-1.zip"])
73
73
  Every example is self-contained, uses synthetic data, and writes its output in
74
74
  the current directory.
75
75
 
76
- Spatial and temporal metadata use separate profiles: `SAC` for regular spatial
77
- grids, `ISAC` for irregular footprints, and `TAC` for time alone. `STAC`
78
- combines `SAC` + `TAC`; `ISTAC` combines `ISAC` + `TAC`.
76
+ Spatial and temporal metadata use separate profiles: `Spatial` for regular
77
+ spatial grids, `ISpatial` for irregular footprints, and `Temporal` for time
78
+ alone. `STAC` combines regular spatial + temporal metadata; `ISTAC` combines
79
+ irregular spatial + temporal metadata.
79
80
 
80
81
  | Example | What it demonstrates |
81
82
  | --- | --- |
@@ -19,9 +19,10 @@ parts = taco.read(["part-0.zip", "part-1.zip"])
19
19
  Every example is self-contained, uses synthetic data, and writes its output in
20
20
  the current directory.
21
21
 
22
- Spatial and temporal metadata use separate profiles: `SAC` for regular spatial
23
- grids, `ISAC` for irregular footprints, and `TAC` for time alone. `STAC`
24
- combines `SAC` + `TAC`; `ISTAC` combines `ISAC` + `TAC`.
22
+ Spatial and temporal metadata use separate profiles: `Spatial` for regular
23
+ spatial grids, `ISpatial` for irregular footprints, and `Temporal` for time
24
+ alone. `STAC` combines regular spatial + temporal metadata; `ISTAC` combines
25
+ irregular spatial + temporal metadata.
25
26
 
26
27
  | Example | What it demonstrates |
27
28
  | --- | --- |
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "taco-eo"
7
- version = "0.6.0"
7
+ version = "0.6.2"
8
8
  description = "Read and write TACO datasets in Python."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -20,18 +20,18 @@ SAMPLE_LEVEL = "sample"
20
20
  CHILDREN_LEVEL = "children"
21
21
 
22
22
  _PROFILE_TYPES = {
23
- "sac": {
23
+ "spatial": {
24
24
  "crs": "string",
25
25
  "tensor_shape": "list<int64>",
26
26
  "geotransform": "list<double>",
27
27
  "centroid": "binary",
28
28
  },
29
- "isac": {
29
+ "ispatial": {
30
30
  "crs": "string",
31
31
  "geometry": "binary",
32
32
  "centroid": "binary",
33
33
  },
34
- "tac": {
34
+ "temporal": {
35
35
  "time_start": "timestamp[us, UTC]",
36
36
  },
37
37
  "stac": {
@@ -214,20 +214,20 @@ class Contract:
214
214
  raise ContractError(f"metadata level {level!r} must choose either STAC or ISTAC, not both")
215
215
  names = ", ".join(name.upper() for name in profiles)
216
216
  raise ContractError(f"metadata level {level!r} must choose one metadata profile, got {names}")
217
- for namespace in ("sac", "stac"):
217
+ for namespace in ("spatial", "stac"):
218
218
  if f"{namespace}:geometry" in fields:
219
- irregular = "ISAC" if namespace == "sac" else "ISTAC"
219
+ irregular = "ISpatial" if namespace == "spatial" else "ISTAC"
220
220
  raise ContractError(
221
221
  f"metadata level {level!r} puts geometry in {namespace.upper()}; "
222
222
  f"use the {irregular} group for irregular footprints"
223
223
  )
224
- for namespace in ("isac", "istac"):
224
+ for namespace in ("ispatial", "istac"):
225
225
  irregular_grid_fields = {
226
226
  f"{namespace}:tensor_shape",
227
227
  f"{namespace}:geotransform",
228
228
  }.intersection(fields)
229
229
  if irregular_grid_fields:
230
- regular = "SAC" if namespace == "isac" else "STAC"
230
+ regular = "Spatial" if namespace == "ispatial" else "STAC"
231
231
  raise ContractError(
232
232
  f"metadata level {level!r} puts affine-grid fields in {namespace.upper()}; "
233
233
  f"use the {regular} group for regular chunks"
@@ -239,7 +239,7 @@ class Contract:
239
239
  missing = sorted(set(expected) - present)
240
240
  if missing:
241
241
  raise ContractError(f"{namespace.upper()} metadata at level {level!r} is missing fields {missing}")
242
- optional = _PROFILE_OPTIONAL_TYPES if namespace in {"tac", "stac", "istac"} else {}
242
+ optional = _PROFILE_OPTIONAL_TYPES if namespace in {"temporal", "stac", "istac"} else {}
243
243
  for name, expected_type in {**expected, **optional}.items():
244
244
  qualified = f"{namespace}:{name}"
245
245
  if qualified in fields and fields[qualified].type != expected_type:
@@ -701,19 +701,13 @@ class Contract:
701
701
  self.apply_extensions(level, rows, assets=assets, verify=verify)
702
702
 
703
703
  def to_dict(self) -> dict[str, Any]:
704
- result: dict[str, Any] = {
704
+ return {
705
705
  "taco:structure": None if self.structure is None else list(self.structure),
706
706
  "taco:metadata": {
707
707
  level: {name: spec.to_dict() for name, spec in fields.items()}
708
708
  for level, fields in self.metadata.items()
709
709
  },
710
710
  }
711
- if self.extensions:
712
- # The serialized name remains taco:derived for TACO v3 reader
713
- # compatibility. The Python execution API is the broader
714
- # Extension abstraction.
715
- result["taco:derived"] = self.extensions
716
- return result
717
711
 
718
712
  @classmethod
719
713
  def from_dict(cls, data: Mapping[str, Any]) -> Contract:
@@ -0,0 +1,7 @@
1
+ """Explicit metadata operations executed during ``writer.run()``."""
2
+
3
+ from ..metadata.derived import GeoEnrich, MajorTOM
4
+ from .rumi import Rumi
5
+ from .spatiotemporal import ISTAC, STAC, ISpatial, Spatial, Temporal
6
+
7
+ __all__ = ["ISTAC", "STAC", "GeoEnrich", "ISpatial", "MajorTOM", "Rumi", "Spatial", "Temporal"]
@@ -11,11 +11,11 @@ from typing import Any, ClassVar
11
11
  import pyarrow as pa
12
12
 
13
13
  from ..metadata._base import Extension, ExtensionContext
14
- from ..metadata.spatiotemporal import ISAC as ISACMetadata
15
14
  from ..metadata.spatiotemporal import ISTAC as ISTACMetadata
16
- from ..metadata.spatiotemporal import SAC as SACMetadata
17
15
  from ..metadata.spatiotemporal import STAC as STACMetadata
18
- from ..metadata.spatiotemporal import TAC as TACMetadata
16
+ from ..metadata.spatiotemporal import ISpatial as ISpatialMetadata
17
+ from ..metadata.spatiotemporal import Spatial as SpatialMetadata
18
+ from ..metadata.spatiotemporal import Temporal as TemporalMetadata
19
19
 
20
20
 
21
21
  def _point_wkb(longitude: float, latitude: float) -> bytes:
@@ -168,51 +168,51 @@ def _temporal_run(context: ExtensionContext, namespace: str) -> dict[str, Sequen
168
168
 
169
169
 
170
170
  @dataclass(frozen=True)
171
- class SAC(Extension):
171
+ class Spatial(Extension):
172
172
  """Complete regular spatial metadata during ``writer.run()``."""
173
173
 
174
174
  __taco_scopes__: ClassVar[frozenset[str]] = frozenset({"sample", "folder"})
175
- model: type[SACMetadata] = SACMetadata
175
+ model: type[SpatialMetadata] = SpatialMetadata
176
176
 
177
177
  def __post_init__(self) -> None:
178
- if not isinstance(self.model, type) or not issubclass(self.model, SACMetadata):
179
- raise TypeError("SAC model must inherit taco.metadata.sample.SAC")
178
+ if not isinstance(self.model, type) or not issubclass(self.model, SpatialMetadata):
179
+ raise TypeError("Spatial model must inherit taco.metadata.sample.Spatial")
180
180
 
181
181
  @property
182
- def input_model(self) -> type[SACMetadata]:
182
+ def input_model(self) -> type[SpatialMetadata]:
183
183
  return self.model
184
184
 
185
185
  @property
186
186
  def requires(self) -> tuple[str, ...]:
187
- return ("sac:crs", "sac:tensor_shape", "sac:geotransform")
187
+ return ("spatial:crs", "spatial:tensor_shape", "spatial:geotransform")
188
188
 
189
189
  @property
190
190
  def fields(self) -> pa.Schema:
191
191
  return pa.schema([_centroid_field()])
192
192
 
193
193
  def run(self, context: ExtensionContext) -> Mapping[str, Sequence[Any]]:
194
- return _regular_run(context, "sac")
194
+ return _regular_run(context, "spatial")
195
195
 
196
196
 
197
197
  @dataclass(frozen=True)
198
- class ISAC(Extension):
198
+ class ISpatial(Extension):
199
199
  """Complete irregular spatial metadata during ``writer.run()``."""
200
200
 
201
201
  check_antimeridian: bool = False
202
- model: type[ISACMetadata] = ISACMetadata
202
+ model: type[ISpatialMetadata] = ISpatialMetadata
203
203
  __taco_scopes__: ClassVar[frozenset[str]] = frozenset({"sample", "folder"})
204
204
 
205
205
  def __post_init__(self) -> None:
206
- if not isinstance(self.model, type) or not issubclass(self.model, ISACMetadata):
207
- raise TypeError("ISAC model must inherit taco.metadata.sample.ISAC")
206
+ if not isinstance(self.model, type) or not issubclass(self.model, ISpatialMetadata):
207
+ raise TypeError("ISpatial model must inherit taco.metadata.sample.ISpatial")
208
208
 
209
209
  @property
210
- def input_model(self) -> type[ISACMetadata]:
210
+ def input_model(self) -> type[ISpatialMetadata]:
211
211
  return self.model
212
212
 
213
213
  @property
214
214
  def requires(self) -> tuple[str, ...]:
215
- return ("isac:crs", "isac:geometry")
215
+ return ("ispatial:crs", "ispatial:geometry")
216
216
 
217
217
  @property
218
218
  def fields(self) -> pa.Schema:
@@ -222,34 +222,34 @@ class ISAC(Extension):
222
222
  return {"check_antimeridian": self.check_antimeridian}
223
223
 
224
224
  def run(self, context: ExtensionContext) -> Mapping[str, Sequence[Any]]:
225
- return _irregular_run(context, "isac", self.check_antimeridian)
225
+ return _irregular_run(context, "ispatial", self.check_antimeridian)
226
226
 
227
227
 
228
228
  @dataclass(frozen=True)
229
- class TAC(Extension):
229
+ class Temporal(Extension):
230
230
  """Complete temporal metadata during ``writer.run()``."""
231
231
 
232
232
  __taco_scopes__: ClassVar[frozenset[str]] = frozenset({"sample", "folder"})
233
- model: type[TACMetadata] = TACMetadata
233
+ model: type[TemporalMetadata] = TemporalMetadata
234
234
 
235
235
  def __post_init__(self) -> None:
236
- if not isinstance(self.model, type) or not issubclass(self.model, TACMetadata):
237
- raise TypeError("TAC model must inherit taco.metadata.sample.TAC")
236
+ if not isinstance(self.model, type) or not issubclass(self.model, TemporalMetadata):
237
+ raise TypeError("Temporal model must inherit taco.metadata.sample.Temporal")
238
238
 
239
239
  @property
240
- def input_model(self) -> type[TACMetadata]:
240
+ def input_model(self) -> type[TemporalMetadata]:
241
241
  return self.model
242
242
 
243
243
  @property
244
244
  def requires(self) -> tuple[str, ...]:
245
- return ("tac:time_start", "tac:time_end")
245
+ return ("temporal:time_start", "temporal:time_end")
246
246
 
247
247
  @property
248
248
  def fields(self) -> pa.Schema:
249
249
  return pa.schema([_middle_field()])
250
250
 
251
251
  def run(self, context: ExtensionContext) -> Mapping[str, Sequence[Any]]:
252
- return _temporal_run(context, "tac")
252
+ return _temporal_run(context, "temporal")
253
253
 
254
254
 
255
255
  @dataclass(frozen=True)
@@ -313,4 +313,4 @@ class ISTAC(Extension):
313
313
  }
314
314
 
315
315
 
316
- __all__ = ["ISAC", "ISTAC", "SAC", "STAC", "TAC", "geometry_centroid", "raster_centroid"]
316
+ __all__ = ["ISTAC", "STAC", "ISpatial", "Spatial", "Temporal", "geometry_centroid", "raster_centroid"]
@@ -1,21 +1,21 @@
1
1
  from typing import ClassVar
2
2
 
3
- from .sample import ISAC as _SampleISAC
4
3
  from .sample import ISTAC as _SampleISTAC
5
- from .sample import SAC as _SampleSAC
6
4
  from .sample import STAC as _SampleSTAC
7
- from .sample import TAC as _SampleTAC
5
+ from .sample import ISpatial as _SampleISpatial
6
+ from .sample import Spatial as _SampleSpatial
7
+ from .sample import Temporal as _SampleTemporal
8
8
 
9
9
 
10
- class SAC(_SampleSAC):
10
+ class Spatial(_SampleSpatial):
11
11
  __taco_scopes__: ClassVar[frozenset[str]] = frozenset({"folder"})
12
12
 
13
13
 
14
- class ISAC(_SampleISAC):
14
+ class ISpatial(_SampleISpatial):
15
15
  __taco_scopes__: ClassVar[frozenset[str]] = frozenset({"folder"})
16
16
 
17
17
 
18
- class TAC(_SampleTAC):
18
+ class Temporal(_SampleTemporal):
19
19
  __taco_scopes__: ClassVar[frozenset[str]] = frozenset({"folder"})
20
20
 
21
21
 
@@ -27,4 +27,4 @@ class ISTAC(_SampleISTAC):
27
27
  __taco_scopes__: ClassVar[frozenset[str]] = frozenset({"folder"})
28
28
 
29
29
 
30
- __all__ = ["ISAC", "ISTAC", "SAC", "STAC", "TAC"]
30
+ __all__ = ["ISTAC", "STAC", "ISpatial", "Spatial", "Temporal"]
@@ -0,0 +1,5 @@
1
+ from .derived import GeoEnrich, MajorTOM
2
+ from .spatiotemporal import ISTAC, STAC, ISpatial, Spatial, Temporal
3
+ from .split import Split
4
+
5
+ __all__ = ["ISTAC", "STAC", "GeoEnrich", "ISpatial", "MajorTOM", "Spatial", "Split", "Temporal"]
@@ -170,10 +170,10 @@ def _validate_time_range(model: Any) -> None:
170
170
  raise ValueError("time_start must not be after time_end")
171
171
 
172
172
 
173
- class SAC(SampleModel):
173
+ class Spatial(SampleModel):
174
174
  """Spatial metadata for regular raster chunks."""
175
175
 
176
- __taco_namespace__ = "sac"
176
+ __taco_namespace__ = "spatial"
177
177
  __taco_summaries__ = (_SpatialExtent,)
178
178
 
179
179
  crs: str = Field(min_length=1, description="Coordinate reference system (WKT2, EPSG, or PROJ)")
@@ -189,13 +189,13 @@ class SAC(SampleModel):
189
189
  @field_validator("centroid")
190
190
  @classmethod
191
191
  def _centroid(cls, value: bytes | None) -> bytes | None:
192
- return _validate_centroid(value, "sac")
192
+ return _validate_centroid(value, "spatial")
193
193
 
194
194
 
195
- class ISAC(SampleModel):
195
+ class ISpatial(SampleModel):
196
196
  """Spatial metadata for samples with irregular footprints."""
197
197
 
198
- __taco_namespace__ = "isac"
198
+ __taco_namespace__ = "ispatial"
199
199
  __taco_summaries__ = (_SpatialExtent,)
200
200
 
201
201
  crs: str = Field(min_length=1, description="Coordinate reference system (WKT2, EPSG, or PROJ)")
@@ -205,20 +205,20 @@ class ISAC(SampleModel):
205
205
  @field_validator("centroid")
206
206
  @classmethod
207
207
  def _centroid(cls, value: bytes | None) -> bytes | None:
208
- return _validate_centroid(value, "isac")
208
+ return _validate_centroid(value, "ispatial")
209
209
 
210
210
 
211
- class TAC(SampleModel):
211
+ class Temporal(SampleModel):
212
212
  """Temporal metadata for samples without a required spatial profile."""
213
213
 
214
- __taco_namespace__ = "tac"
214
+ __taco_namespace__ = "temporal"
215
215
 
216
216
  time_start: TimestampUTC = Field(description="Acquisition start")
217
217
  time_end: TimestampUTC | None = Field(default=None, description="Acquisition end")
218
218
  time_middle: TimestampUTC | None = Field(default=None, description="Acquisition midpoint")
219
219
 
220
220
  @model_validator(mode="after")
221
- def _times(self) -> TAC:
221
+ def _times(self) -> Temporal:
222
222
  _validate_time_range(self)
223
223
  return self
224
224
 
@@ -277,4 +277,4 @@ class ISTAC(SampleModel):
277
277
  return self
278
278
 
279
279
 
280
- __all__ = ["ISAC", "ISTAC", "SAC", "STAC", "TAC"]
280
+ __all__ = ["ISTAC", "STAC", "ISpatial", "Spatial", "Temporal"]
@@ -110,13 +110,13 @@ def spatial_profile(
110
110
  model: type[BaseModel],
111
111
  ) -> BaseModel:
112
112
  x = -76.0 + index
113
- if profile == "sac":
113
+ if profile == "spatial":
114
114
  return model(
115
115
  crs="EPSG:4326",
116
116
  tensor_shape=(1, 16, 16),
117
117
  geotransform=(x - 0.1, 0.2 / 16, 0, -11.9, 0, -0.2 / 16),
118
118
  )
119
- if profile == "isac":
119
+ if profile == "ispatial":
120
120
  return model(crs="EPSG:4326", geometry=polygon(x - 0.1, -12.1, x + 0.1, -11.9))
121
121
  return model(
122
122
  time_start=datetime(2024, 1, index + 1, tzinfo=timezone.utc),
@@ -469,11 +469,15 @@ def derived_metadata() -> DatasetCase:
469
469
 
470
470
 
471
471
  def independent_profile(profile: str) -> DatasetCase:
472
- sample_extension = {"sac": taco.extensions.SAC, "isac": taco.extensions.ISAC, "tac": taco.extensions.TAC}[profile]
472
+ sample_extension = {
473
+ "spatial": taco.extensions.Spatial,
474
+ "ispatial": taco.extensions.ISpatial,
475
+ "temporal": taco.extensions.Temporal,
476
+ }[profile]
473
477
  folder_model = {
474
- "sac": taco.metadata.folder.SAC,
475
- "isac": taco.metadata.folder.ISAC,
476
- "tac": taco.metadata.folder.TAC,
478
+ "spatial": taco.metadata.folder.Spatial,
479
+ "ispatial": taco.metadata.folder.ISpatial,
480
+ "temporal": taco.metadata.folder.Temporal,
477
481
  }[profile]
478
482
  contract = taco.Contract(
479
483
  structure=["scene/data.bin"],
@@ -514,9 +518,9 @@ CASES = (
514
518
  deep_hierarchy(),
515
519
  rich_metadata(),
516
520
  derived_metadata(),
517
- independent_profile("sac"),
518
- independent_profile("isac"),
519
- independent_profile("tac"),
521
+ independent_profile("spatial"),
522
+ independent_profile("ispatial"),
523
+ independent_profile("temporal"),
520
524
  )
521
525
 
522
526
 
@@ -15,6 +15,7 @@ def test_collection_round_trip(collection: taco.Collection) -> None:
15
15
  assert data["taco:version"] == "3.0.0"
16
16
  assert data["labels:num_classes"] == 2
17
17
  assert "metadata" not in data
18
+ assert "taco:derived" not in data
18
19
  loaded = taco.Collection.from_json(collection.to_json())
19
20
  assert loaded.to_dict() == data
20
21
 
@@ -137,7 +137,7 @@ def test_derived_declaration_and_dependency() -> None:
137
137
  taco.Level("sample", stac=taco.extensions.STAC(), grid=taco.extensions.MajorTOM(50))
138
138
  ),
139
139
  )
140
- descriptor = contract.to_dict()["taco:derived"]["sample"]["grid"]
140
+ descriptor = contract.extensions["sample"]["grid"]
141
141
  assert descriptor["requires"] == ["stac:centroid"]
142
142
  assert descriptor["produces"] == ["grid:code"]
143
143
  assert descriptor["configuration"]["dist_km"] == 50
@@ -189,6 +189,22 @@ def test_serialized_derived_declaration_is_validated() -> None:
189
189
  )
190
190
 
191
191
 
192
+ def test_execution_graph_is_not_serialized() -> None:
193
+ contract = taco.Contract(
194
+ structure=None,
195
+ metadata=taco.MetadataSchema(
196
+ taco.Level("sample", stac=taco.extensions.STAC(), grid=taco.extensions.MajorTOM())
197
+ ),
198
+ )
199
+ assert contract.extensions
200
+ assert "taco:derived" not in contract.to_dict()
201
+
202
+ legacy = {**contract.to_dict(), "taco:derived": contract.extensions}
203
+ loaded = taco.Contract.from_dict(legacy)
204
+ assert loaded.extensions == contract.extensions
205
+ assert "taco:derived" not in loaded.to_dict()
206
+
207
+
192
208
  def test_derived_configuration_must_be_json() -> None:
193
209
  with pytest.raises(ContractError, match="JSON serializable"):
194
210
  taco.Contract(
@@ -43,7 +43,9 @@ def stac(model: type[taco.metadata.sample.STAC] = taco.metadata.sample.STAC) ->
43
43
  )
44
44
 
45
45
 
46
- def sac(model: type[taco.metadata.sample.SAC] = taco.metadata.sample.SAC) -> taco.metadata.sample.SAC:
46
+ def spatial(
47
+ model: type[taco.metadata.sample.Spatial] = taco.metadata.sample.Spatial,
48
+ ) -> taco.metadata.sample.Spatial:
47
49
  return model(
48
50
  crs="EPSG:4326",
49
51
  tensor_shape=(1, 10, 10),
@@ -71,65 +73,65 @@ def test_extension_dependencies_ignore_declaration_order(tmp_path: Path) -> None
71
73
  assert row["majortom:code"].startswith("0010km_")
72
74
 
73
75
 
74
- def test_sac_is_regular_spatial_only_and_composes_with_majortom(tmp_path: Path) -> None:
76
+ def test_spatial_is_regular_only_and_composes_with_majortom(tmp_path: Path) -> None:
75
77
  contract = taco.Contract(
76
78
  structure=None,
77
79
  metadata=taco.MetadataSchema(
78
80
  taco.Level(
79
81
  "sample",
80
- majortom=taco.extensions.MajorTOM(centroid="sac:centroid"),
81
- sac=taco.extensions.SAC(),
82
+ majortom=taco.extensions.MajorTOM(centroid="spatial:centroid"),
83
+ spatial=taco.extensions.Spatial(),
82
84
  )
83
85
  ),
84
86
  )
85
87
  with taco.open_writer(collection(contract), tmp_path / "dataset") as writer:
86
- writer.add(taco.Sample(assets=b"x", metadata=taco.Metadata(sac=sac())))
88
+ writer.add(taco.Sample(assets=b"x", metadata=taco.Metadata(spatial=spatial())))
87
89
  writer.run()
88
90
 
89
91
  dataset = open_view(tmp_path / "dataset")
90
92
  row = dataset.level("sample").to_pylist()[0]
91
- assert row["sac:centroid"] == point(0, 0)
93
+ assert row["spatial:centroid"] == point(0, 0)
92
94
  assert row["majortom:code"].startswith("0100km_")
93
- assert not any(name.startswith(("stac:", "tac:")) for name in row)
95
+ assert not any(name.startswith(("stac:", "temporal:")) for name in row)
94
96
  assert dataset.collection.extent == taco.contract.Extent((0, 0, 0, 0))
95
97
 
96
98
 
97
- def test_tac_is_temporal_only(tmp_path: Path) -> None:
99
+ def test_temporal_is_temporal_only(tmp_path: Path) -> None:
98
100
  contract = taco.Contract(
99
101
  structure=None,
100
- metadata=taco.MetadataSchema(taco.Level("sample", tac=taco.extensions.TAC())),
102
+ metadata=taco.MetadataSchema(taco.Level("sample", temporal=taco.extensions.Temporal())),
101
103
  )
102
- metadata = taco.metadata.sample.TAC(
104
+ metadata = taco.metadata.sample.Temporal(
103
105
  time_start=datetime(2024, 1, 1, tzinfo=timezone.utc),
104
106
  time_end=datetime(2024, 1, 3, tzinfo=timezone.utc),
105
107
  )
106
108
  with taco.open_writer(collection(contract), tmp_path / "dataset") as writer:
107
- writer.add(taco.Sample(assets=b"x", metadata=taco.Metadata(tac=metadata)))
109
+ writer.add(taco.Sample(assets=b"x", metadata=taco.Metadata(temporal=metadata)))
108
110
  writer.run()
109
111
 
110
112
  dataset = open_view(tmp_path / "dataset")
111
113
  row = dataset.level("sample").to_pylist()[0]
112
- assert row["tac:time_middle"] == datetime(2024, 1, 2, tzinfo=timezone.utc)
113
- assert not any(name.startswith(("sac:", "stac:", "istac:", "isac:")) for name in row)
114
+ assert row["temporal:time_middle"] == datetime(2024, 1, 2, tzinfo=timezone.utc)
115
+ assert not any(name.startswith(("spatial:", "stac:", "istac:", "ispatial:")) for name in row)
114
116
  assert dataset.collection.extent is None
115
117
 
116
118
 
117
- def test_isac_is_irregular_spatial_only(tmp_path: Path) -> None:
119
+ def test_ispatial_is_irregular_spatial_only(tmp_path: Path) -> None:
118
120
  contract = taco.Contract(
119
121
  structure=None,
120
- metadata=taco.MetadataSchema(taco.Level("sample", isac=taco.extensions.ISAC())),
122
+ metadata=taco.MetadataSchema(taco.Level("sample", ispatial=taco.extensions.ISpatial())),
121
123
  )
122
- metadata = taco.metadata.sample.ISAC(
124
+ metadata = taco.metadata.sample.ISpatial(
123
125
  crs="EPSG:4326",
124
126
  geometry=Polygon([(-77, -13), (-75, -13), (-75, -11), (-77, -11)]).wkb,
125
127
  )
126
128
  with taco.open_writer(collection(contract), tmp_path / "dataset") as writer:
127
- writer.add(taco.Sample(assets=b"x", metadata=taco.Metadata(isac=metadata)))
129
+ writer.add(taco.Sample(assets=b"x", metadata=taco.Metadata(ispatial=metadata)))
128
130
  writer.run()
129
131
 
130
132
  dataset = open_view(tmp_path / "dataset")
131
133
  row = dataset.level("sample").to_pylist()[0]
132
- assert coordinates(row["isac:centroid"]) == pytest.approx((-76, -12))
134
+ assert coordinates(row["ispatial:centroid"]) == pytest.approx((-76, -12))
133
135
  assert dataset.collection.extent == taco.contract.Extent((-76, -12, -76, -12))
134
136
 
135
137
 
@@ -22,9 +22,9 @@ def point(x: float, y: float) -> bytes:
22
22
 
23
23
 
24
24
  def test_sample_metadata_facade_keeps_public_imports() -> None:
25
- assert taco.metadata.sample.SAC is taco.metadata.spatiotemporal.SAC
26
- assert taco.metadata.sample.ISAC is taco.metadata.spatiotemporal.ISAC
27
- assert taco.metadata.sample.TAC is taco.metadata.spatiotemporal.TAC
25
+ assert taco.metadata.sample.Spatial is taco.metadata.spatiotemporal.Spatial
26
+ assert taco.metadata.sample.ISpatial is taco.metadata.spatiotemporal.ISpatial
27
+ assert taco.metadata.sample.Temporal is taco.metadata.spatiotemporal.Temporal
28
28
  assert taco.metadata.sample.STAC is taco.metadata.spatiotemporal.STAC
29
29
  assert taco.metadata.sample.ISTAC is taco.metadata.spatiotemporal.ISTAC
30
30
  assert taco.metadata.sample.MajorTOM is taco.metadata.derived.MajorTOM
@@ -103,12 +103,12 @@ def test_stac_and_istac_have_distinct_v2_profiles() -> None:
103
103
 
104
104
 
105
105
  def test_spatial_and_temporal_profiles_have_distinct_namespaces() -> None:
106
- assert taco.metadata.sample.SAC.__taco_namespace__ == "sac"
107
- assert taco.metadata.sample.ISAC.__taco_namespace__ == "isac"
108
- assert taco.metadata.sample.TAC.__taco_namespace__ == "tac"
109
- assert tuple(taco.metadata.sample.SAC.model_fields) == ("crs", "tensor_shape", "geotransform", "centroid")
110
- assert tuple(taco.metadata.sample.ISAC.model_fields) == ("crs", "geometry", "centroid")
111
- assert tuple(taco.metadata.sample.TAC.model_fields) == ("time_start", "time_end", "time_middle")
106
+ assert taco.metadata.sample.Spatial.__taco_namespace__ == "spatial"
107
+ assert taco.metadata.sample.ISpatial.__taco_namespace__ == "ispatial"
108
+ assert taco.metadata.sample.Temporal.__taco_namespace__ == "temporal"
109
+ assert tuple(taco.metadata.sample.Spatial.model_fields) == ("crs", "tensor_shape", "geotransform", "centroid")
110
+ assert tuple(taco.metadata.sample.ISpatial.model_fields) == ("crs", "geometry", "centroid")
111
+ assert tuple(taco.metadata.sample.Temporal.model_fields) == ("time_start", "time_end", "time_middle")
112
112
 
113
113
 
114
114
  def test_stac_grid_validation() -> None:
@@ -176,26 +176,28 @@ def test_contract_rejects_mixed_profiles_and_incomplete_new_profiles() -> None:
176
176
  with pytest.raises(ContractError, match="must choose one metadata profile"):
177
177
  taco.Contract(
178
178
  structure=None,
179
- metadata=taco.MetadataSchema(taco.Level("sample", sac=taco.extensions.SAC(), tac=taco.extensions.TAC())),
179
+ metadata=taco.MetadataSchema(
180
+ taco.Level("sample", spatial=taco.extensions.Spatial(), temporal=taco.extensions.Temporal())
181
+ ),
180
182
  )
181
- with pytest.raises(ContractError, match=r"SAC metadata.*missing fields"):
182
- taco.Contract(structure=None, metadata={"sample": {"sac:centroid": "binary"}})
183
- with pytest.raises(ContractError, match=r"TAC metadata.*missing fields"):
183
+ with pytest.raises(ContractError, match=r"SPATIAL metadata.*missing fields"):
184
+ taco.Contract(structure=None, metadata={"sample": {"spatial:centroid": "binary"}})
185
+ with pytest.raises(ContractError, match=r"TEMPORAL metadata.*missing fields"):
184
186
  taco.Contract(
185
187
  structure=None,
186
- metadata={"sample": {"tac:time_middle": "timestamp[us, UTC]"}},
188
+ metadata={"sample": {"temporal:time_middle": "timestamp[us, UTC]"}},
187
189
  )
188
190
 
189
191
 
190
192
  def test_derived_centroid_dependency_is_configurable() -> None:
191
- majortom = taco.extensions.MajorTOM(centroid="sac:centroid")
192
- geoenrich = taco.extensions.GeoEnrich(["elevation"], centroid="isac:centroid")
193
- assert majortom.requires == ("sac:centroid",)
194
- assert majortom.configuration()["centroid"] == "sac:centroid"
195
- assert geoenrich.requires == ("isac:centroid",)
196
- assert geoenrich.configuration()["centroid"] == "isac:centroid"
193
+ majortom = taco.extensions.MajorTOM(centroid="spatial:centroid")
194
+ geoenrich = taco.extensions.GeoEnrich(["elevation"], centroid="ispatial:centroid")
195
+ assert majortom.requires == ("spatial:centroid",)
196
+ assert majortom.configuration()["centroid"] == "spatial:centroid"
197
+ assert geoenrich.requires == ("ispatial:centroid",)
198
+ assert geoenrich.configuration()["centroid"] == "ispatial:centroid"
197
199
  with pytest.raises(ValueError, match="ending in ':centroid'"):
198
- taco.extensions.MajorTOM(centroid="sac:geometry")
200
+ taco.extensions.MajorTOM(centroid="spatial:geometry")
199
201
 
200
202
 
201
203
  def test_collection_models() -> None:
@@ -420,7 +422,7 @@ def test_custom_derived_group(tmp_path) -> None:
420
422
  structure=None,
421
423
  metadata=taco.MetadataSchema(taco.Level("sample", base=Base, next=PlusOne())),
422
424
  )
423
- assert contract.to_dict()["taco:derived"]["sample"]["next"]["configuration"] == {"values": [1, 2]}
425
+ assert contract.extensions["sample"]["next"]["configuration"] == {"values": [1, 2]}
424
426
  collection = taco.Collection(
425
427
  contract=contract,
426
428
  id="derived",
@@ -435,7 +437,9 @@ def test_custom_derived_group(tmp_path) -> None:
435
437
  writer.run()
436
438
  from taco._view import open_view
437
439
 
438
- assert open_view(tmp_path / "derived").level("sample").column("next:value").to_pylist() == [3]
440
+ dataset = open_view(tmp_path / "derived")
441
+ assert dataset.level("sample").column("next:value").to_pylist() == [3]
442
+ assert "taco:derived" not in dataset.collection_json
439
443
 
440
444
 
441
445
  @dataclass(frozen=True)
@@ -1,7 +0,0 @@
1
- """Explicit metadata operations executed during ``writer.run()``."""
2
-
3
- from ..metadata.derived import GeoEnrich, MajorTOM
4
- from .rumi import Rumi
5
- from .spatiotemporal import ISAC, ISTAC, SAC, STAC, TAC
6
-
7
- __all__ = ["ISAC", "ISTAC", "SAC", "STAC", "TAC", "GeoEnrich", "MajorTOM", "Rumi"]
@@ -1,5 +0,0 @@
1
- from .derived import GeoEnrich, MajorTOM
2
- from .spatiotemporal import ISAC, ISTAC, SAC, STAC, TAC
3
- from .split import Split
4
-
5
- __all__ = ["ISAC", "ISTAC", "SAC", "STAC", "TAC", "GeoEnrich", "MajorTOM", "Split"]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes