Consumer¶
This is a downstream Application Package that produces the mean value using as input the Zarr store of the 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
Plot the Application Paca
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-occurrence.{version}.cwl", "water-bodies-occurrence")
version = "0.3.0"
wf = WorkflowViewer.from_file(f"https://github.com/eoap/zarr-cloud-native-format/releases/download/{version}/app-water-bodies-occurrence.{version}.cwl", "water-bodies-occurrence")
In [3]:
Copied!
wf.plot()
wf.plot()
Out[3]:
Inputs¶
In [4]:
Copied!
wf.display_inputs()
wf.display_inputs()
| Id | Type | Label | Doc |
|---|---|---|---|
zarr-stac-catalog |
Directory |
Zarr store STAC Catalog | Input STAC catalog with datacube |
Steps¶
In [5]:
Copied!
wf.display_steps()
wf.display_steps()
| Id | Runs | Label | Doc |
|---|---|---|---|
step_occurrence |
#occurrence |
Water bodies occurrence | Water bodies occurrence based on NDWI and otsu threshold |
Outputs¶
In [6]:
Copied!
wf.display_outputs()
wf.display_outputs()
| Id | Type | Label | Doc |
|---|---|---|---|
stac-catalog |
Directory |
STAC catalog | Output STAC catalog with water bodies occurrence |
Component diagram¶
In [7]:
Copied!
wf.display_components_diagram()
wf.display_components_diagram()
Class diagram¶
In [8]:
Copied!
wf.display_class_diagram()
wf.display_class_diagram()
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[8], 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-occurrence.steps.step_occurrence = #occurrence
In [ ]:
Copied!