taco-eo 0.6.2__tar.gz → 0.6.3__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 (79) hide show
  1. {taco_eo-0.6.2 → taco_eo-0.6.3}/CHANGELOG.md +7 -0
  2. {taco_eo-0.6.2 → taco_eo-0.6.3}/PKG-INFO +1 -1
  3. {taco_eo-0.6.2 → taco_eo-0.6.3}/pyproject.toml +1 -1
  4. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/metadata/_base.py +1 -0
  5. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/metadata/derived.py +1 -0
  6. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/writer/metadata_tables.py +9 -1
  7. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/test_extension_contract.py +37 -0
  8. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/test_metadata.py +2 -0
  9. {taco_eo-0.6.2 → taco_eo-0.6.3}/.gitignore +0 -0
  10. {taco_eo-0.6.2 → taco_eo-0.6.3}/LICENSE +0 -0
  11. {taco_eo-0.6.2 → taco_eo-0.6.3}/README.md +0 -0
  12. {taco_eo-0.6.2 → taco_eo-0.6.3}/examples/change_detection.py +0 -0
  13. {taco_eo-0.6.2 → taco_eo-0.6.3}/examples/geospatial.py +0 -0
  14. {taco_eo-0.6.2 → taco_eo-0.6.3}/examples/minimal.py +0 -0
  15. {taco_eo-0.6.2 → taco_eo-0.6.3}/examples/numpy_minimal.py +0 -0
  16. {taco_eo-0.6.2 → taco_eo-0.6.3}/examples/oceantaco_istac.py +0 -0
  17. {taco_eo-0.6.2 → taco_eo-0.6.3}/examples/partitioned.py +0 -0
  18. {taco_eo-0.6.2 → taco_eo-0.6.3}/examples/sequence.py +0 -0
  19. {taco_eo-0.6.2 → taco_eo-0.6.3}/examples/stac_segmentation.py +0 -0
  20. {taco_eo-0.6.2 → taco_eo-0.6.3}/examples/time_series.py +0 -0
  21. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/__init__.py +0 -0
  22. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/_graph.py +0 -0
  23. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/_parquet.py +0 -0
  24. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/_publish.py +0 -0
  25. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/_repr.py +0 -0
  26. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/_source.py +0 -0
  27. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/_view.py +0 -0
  28. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/contract/__init__.py +0 -0
  29. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/contract/collection.py +0 -0
  30. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/contract/contract.py +0 -0
  31. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/contract/naming.py +0 -0
  32. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/contract/sample.py +0 -0
  33. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/contract/structure.py +0 -0
  34. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/contract/types.py +0 -0
  35. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/cozip.py +0 -0
  36. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/dataset.py +0 -0
  37. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/errors.py +0 -0
  38. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/extensions/__init__.py +0 -0
  39. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/extensions/rumi.py +0 -0
  40. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/extensions/spatiotemporal.py +0 -0
  41. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/metadata/__init__.py +0 -0
  42. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/metadata/asset.py +0 -0
  43. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/metadata/collection.py +0 -0
  44. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/metadata/data/admin/admin0.parquet +0 -0
  45. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/metadata/data/admin/admin1.parquet +0 -0
  46. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/metadata/data/admin/admin2.parquet +0 -0
  47. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/metadata/folder.py +0 -0
  48. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/metadata/sample.py +0 -0
  49. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/metadata/spatiotemporal.py +0 -0
  50. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/metadata/split.py +0 -0
  51. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/py.typed +0 -0
  52. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/reader/__init__.py +0 -0
  53. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/reader/engine.py +0 -0
  54. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/schema.py +0 -0
  55. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/tacocat.py +0 -0
  56. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/validate.py +0 -0
  57. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/writer/__init__.py +0 -0
  58. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/writer/archive.py +0 -0
  59. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/writer/core.py +0 -0
  60. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/writer/folder.py +0 -0
  61. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/writer/progress.py +0 -0
  62. {taco_eo-0.6.2 → taco_eo-0.6.3}/taco/writer/staging.py +0 -0
  63. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/__init__.py +0 -0
  64. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/conftest.py +0 -0
  65. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/datasets.py +0 -0
  66. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/test_collection.py +0 -0
  67. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/test_contract.py +0 -0
  68. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/test_examples.py +0 -0
  69. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/test_extension_rumi.py +0 -0
  70. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/test_extension_spatiotemporal.py +0 -0
  71. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/test_parquet.py +0 -0
  72. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/test_progress.py +0 -0
  73. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/test_publish.py +0 -0
  74. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/test_reader.py +0 -0
  75. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/test_tacocat.py +0 -0
  76. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/test_types.py +0 -0
  77. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/test_validate.py +0 -0
  78. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/test_writer.py +0 -0
  79. {taco_eo-0.6.2 → taco_eo-0.6.3}/tests/test_writer_cases.py +0 -0
@@ -5,6 +5,13 @@ All notable changes to `taco` are documented here. The format follows
5
5
 
6
6
  ## Unreleased
7
7
 
8
+ ## 0.6.3 - 2026-09-13
9
+
10
+ ### Fixed
11
+
12
+ - `GeoEnrich` now receives the complete metadata level before applying the
13
+ same globally sorted, concurrent Earth Engine batching used by Taco v2.
14
+
8
15
  ## 0.6.2 - 2026-09-13
9
16
 
10
17
  ### Removed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: taco-eo
3
- Version: 0.6.2
3
+ Version: 0.6.3
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
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "taco-eo"
7
- version = "0.6.2"
7
+ version = "0.6.3"
8
8
  description = "Read and write TACO datasets in Python."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -75,6 +75,7 @@ class Extension(ABC):
75
75
  """
76
76
 
77
77
  __taco_scopes__: ClassVar[frozenset[str]] = frozenset()
78
+ __taco_complete_level__: ClassVar[bool] = False
78
79
 
79
80
  @property
80
81
  def input_model(self) -> type[BaseModel] | None:
@@ -177,6 +177,7 @@ class GeoEnrich(DerivedMetadata):
177
177
  """Fetch selected Earth Engine variables and resolve administrative names."""
178
178
 
179
179
  __taco_scopes__: ClassVar[frozenset[str]] = frozenset({"sample"})
180
+ __taco_complete_level__: ClassVar[bool] = True
180
181
 
181
182
  variables: tuple[str, ...]
182
183
  scale_m: float
@@ -111,6 +111,14 @@ class MetadataTableWriter:
111
111
  self._writers: dict[str, pq.ParquetWriter] = {}
112
112
  self._next_id = dict.fromkeys(contract.levels, 0)
113
113
  self._verified_extensions: set[str] = set()
114
+ self._complete_levels = {
115
+ level
116
+ for level in contract.levels
117
+ if any(
118
+ group.extension is not None and group.extension.__taco_complete_level__
119
+ for group in contract._groups[level]
120
+ )
121
+ }
114
122
  self._summaries = _collection_summaries(contract)
115
123
  self.paths = {level: directory / level_to_filename(level) for level in contract.levels}
116
124
  directory.mkdir(parents=True, exist_ok=True)
@@ -183,7 +191,7 @@ class MetadataTableWriter:
183
191
  self._buffers[level].append(row)
184
192
  self._asset_buffers[level].append(asset)
185
193
  self._next_id[level] += 1
186
- if len(self._buffers[level]) >= self.batch_size:
194
+ if level not in self._complete_levels and len(self._buffers[level]) >= self.batch_size:
187
195
  self._flush(level)
188
196
 
189
197
  def _parquet_writer(self, level: str) -> pq.ParquetWriter:
@@ -57,6 +57,27 @@ class Generated(taco.Extension):
57
57
  return {"value": context.columns[self.dependency]}
58
58
 
59
59
 
60
+ COMPLETE_BATCHES: list[int] = []
61
+
62
+
63
+ @dataclass(frozen=True)
64
+ class CompleteGenerated(taco.Extension):
65
+ __taco_scopes__: ClassVar[frozenset[str]] = frozenset({"sample"})
66
+ __taco_complete_level__: ClassVar[bool] = True
67
+
68
+ @property
69
+ def requires(self) -> tuple[str, ...]:
70
+ return ()
71
+
72
+ @property
73
+ def fields(self) -> pa.Schema:
74
+ return pa.schema([pa.field("value", pa.int64(), nullable=False)])
75
+
76
+ def run(self, context: taco.ExtensionContext) -> Mapping[str, Sequence[Any]]:
77
+ COMPLETE_BATCHES.append(len(context))
78
+ return {"value": list(range(len(context)))}
79
+
80
+
60
81
  @dataclass(frozen=True)
61
82
  class Broken(taco.Extension):
62
83
  behavior: str
@@ -114,6 +135,22 @@ def test_extension_combines_inputs_with_local_assets(tmp_path: Path) -> None:
114
135
  assert row["value:asset_name"] == "value.bin"
115
136
 
116
137
 
138
+ def test_complete_level_extension_receives_all_rows(tmp_path: Path) -> None:
139
+ COMPLETE_BATCHES.clear()
140
+ contract = taco.Contract(
141
+ structure=None,
142
+ metadata=taco.MetadataSchema(taco.Level("sample", complete=CompleteGenerated())),
143
+ )
144
+ with taco.open_writer(collection(contract), tmp_path / "complete", batch_size=1) as writer:
145
+ writer.extend([taco.Sample(assets=b"x") for _ in range(3)])
146
+ writer.run()
147
+
148
+ # The second call is the writer's one-row independence check.
149
+ assert COMPLETE_BATCHES == [3, 1]
150
+ values = open_view(tmp_path / "complete").level("sample").column("complete:value").to_pylist()
151
+ assert values == [0, 1, 2]
152
+
153
+
117
154
  def test_executable_extensions_reject_a_dependency_cycle() -> None:
118
155
  with pytest.raises(ContractError, match="cycle"):
119
156
  taco.Contract(
@@ -306,6 +306,8 @@ def test_geoenrich_batches_requests(monkeypatch: pytest.MonkeyPatch) -> None:
306
306
 
307
307
 
308
308
  def test_geoenrich_configuration() -> None:
309
+ assert taco.metadata.sample.GeoEnrich.__taco_complete_level__
310
+ assert not taco.metadata.sample.MajorTOM.__taco_complete_level__
309
311
  with pytest.raises(ValueError, match="unknown"):
310
312
  taco.metadata.sample.GeoEnrich(["nope"])
311
313
  with pytest.raises(ValueError, match="positive"):
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
File without changes
File without changes
File without changes
File without changes