Skip to content

Commit 95178c0

Browse files
committed
Support writing of stage-out STAC by notebook
Closes #32
1 parent 22dbea2 commit 95178c0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* Use micromamba entry point in Docker image (#26)
1111
* Allow setting of CWL workflow ID (#29)
1212
* Add in-notebook configuration interface (#30)
13+
* Support writing of stage-out STAC by notebook (#32)
1314

1415
## Changes in 0.1.0
1516

xcengine/util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ def clear_directory(directory: pathlib.Path) -> None:
2121
def write_stac(
2222
datasets: dict[str, xr.Dataset], stac_root: pathlib.Path
2323
) -> None:
24+
catalog_path = stac_root / "catalog.json"
25+
if catalog_path.exists():
26+
# Assume that the user code generated its own stage-out data
27+
return
2428
catalog = pystac.Catalog(
2529
id="catalog",
2630
description="Root catalog",
27-
href=f"{stac_root}/catalog.json",
31+
href=f"{catalog_path}",
2832
)
2933
for ds_name, ds in datasets.items():
3034
zarr_name = ds_name + ".zarr"

0 commit comments

Comments
 (0)