Producer¶
Application Package to produce a Zarr store with detected water bodies described as a STAC Collection including the STAC Datacube extension.
In [1]:
Copied!
import os
import sys
module_path = os.path.abspath(os.path.join(".."))
sys.path.insert(0, module_path)
from helpers import WorkflowViewer
import cwl_loader
cwl_loader.logger.remove()
cwl_loader.logger.add(sys.stderr, level="INFO")
import os
import sys
module_path = os.path.abspath(os.path.join(".."))
sys.path.insert(0, module_path)
from helpers import WorkflowViewer
import cwl_loader
cwl_loader.logger.remove()
cwl_loader.logger.add(sys.stderr, level="INFO")
Out[1]:
1
In [2]:
Copied!
version = "0.3.0"
wf = WorkflowViewer.from_file(f"https://github.com/eoap/zarr-cloud-native-format/releases/download/{version}/app-water-bodies.{version}.cwl", "water-bodies")
version = "0.3.0"
wf = WorkflowViewer.from_file(f"https://github.com/eoap/zarr-cloud-native-format/releases/download/{version}/app-water-bodies.{version}.cwl", "water-bodies")
Inputs¶
In [3]:
Copied!
wf.display_inputs()
wf.display_inputs()
| Id | Type | Label | Doc |
|---|---|---|---|
stac_api_endpoint |
https://raw.githubusercontent.com/eoap/schemas/main/experimental/api-endpoint.yaml#APIEndpoint |
STAC API endpoint | STAC API endpoint |
search_request |
https://raw.githubusercontent.com/eoap/schemas/main/experimental/discovery.yaml#STACSearchSettings |
STAC search request | STAC search request |
bands |
string[] |
bands used for the NDWI | bands used for the NDWI |
Steps¶
In [4]:
Copied!
wf.display_steps()
wf.display_steps()
| Id | Runs | Label | Doc |
|---|---|---|---|
discovery |
#stac-client |
STAC API discovery | Discover STAC items from a STAC API endpoint based on a search request |
convert_search |
#convert-search |
Convert Search | Convert Search results to get the item self hrefs and the area of interest |
water_bodies |
#detect_water_body |
Water bodies detection | Water bodies detection based on NDWI and otsu threshold applied to each STAC item (sub-workflow) |
stac |
#stac |
Create a STAC catalog with COG outputs | Create a STAC catalog with the detected water bodies COG outputs |
stac_zarr |
#stac-zarr |
Create a STAC Catalog for the Zarr store | Create a STAC Catalog for the Zarr store from the STAC catalog with COG outputs |
Outputs¶
In [5]:
Copied!
wf.display_outputs()
wf.display_outputs()
| Id | Type | Label | Doc |
|---|---|---|---|
zarr_stac_catalog |
Directory |
None | None |
stac_catalog |
Directory |
None | None |
Component diagram¶
In [6]:
Copied!
wf.display_components_diagram()
wf.display_components_diagram()
Class diagram¶
In [7]:
Copied!
wf.display_class_diagram()
wf.display_class_diagram()
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[7], line 1 ----> 1 wf.display_class_diagram() File ~/work/zarr-cloud-native-format/zarr-cloud-native-format/docs/helpers.py:99, in WorkflowViewer.display_class_diagram(self, entrypoint) 96 entrypoint = self.entrypoint 98 wf = search_process(process_id=entrypoint, process=self.workflow) ---> 99 self._display_puml(DiagramType.CLASS, wf=wf, workflow_id=entrypoint) File ~/work/zarr-cloud-native-format/zarr-cloud-native-format/docs/helpers.py:68, in WorkflowViewer._display_puml(self, diagram_type, wf, workflow_id) 65 def _display_puml(self, diagram_type: DiagramType, wf, workflow_id=None): 67 out = StringIO() ---> 68 to_puml( 69 cwl_document=wf, 70 diagram_type=diagram_type, 71 output_stream=out, 72 workflow_id=workflow_id, 73 ) 75 clear_output = out.getvalue() 76 encoded = deflate_and_encode(clear_output) File /opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/site-packages/cwl2puml/__init__.py:159, in to_puml(cwl_document, diagram_type, output_stream, workflow_id) 143 ''' 144 Converts a CWL, given its document model, to a PlantUML diagram. 145 (...) 152 `None`: none 153 ''' 154 assert_process_contained( 155 process=cwl_document, 156 process_id=workflow_id 157 ) --> 159 assert_connected_graph(cwl_document) 161 index = to_index(cwl_document) if isinstance(cwl_document, list) else { workflow_id: cwl_document } 163 template = _jinja_environment.get_template(f"{diagram_type.name.lower()}.puml") File /opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/site-packages/cwl_loader/utils.py:141, in assert_connected_graph(process) 139 if issues: 140 nl = '\n' --> 141 raise ValueError(f"Detected unresolved links in the input $graph:\n{nl.join(issues)}") ValueError: Detected unresolved links in the input $graph: - water-bodies.steps.discovery = #stac-client - water-bodies.steps.convert_search = #convert-search - water-bodies.steps.water_bodies = #detect_water_body - water-bodies.steps.stac = #stac - water-bodies.steps.stac_zarr = #stac-zarr
In [ ]:
Copied!