Water bodies detection¶
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.{version}.cwl", "detect_water_body")
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", "detect_water_body")
In [3]:
Copied!
wf.plot()
wf.plot()
Out[3]:
Inputs¶
In [4]:
Copied!
wf.display_inputs()
wf.display_inputs()
Id | Type | Label | Doc |
---|---|---|---|
aoi |
string |
None | area of interest as a bounding box |
epsg |
string |
None | EPSG code |
bands |
string[] |
None | bands used for the NDWI |
item |
string |
None | STAC item |
Steps¶
In [5]:
Copied!
wf.display_steps()
wf.display_steps()
Id | Runs | Label | Doc |
---|---|---|---|
crop |
#crop |
None | None |
normalized_difference |
#norm_diff |
None | None |
otsu |
#otsu |
None | None |
Outputs¶
In [6]:
Copied!
wf.display_outputs()
wf.display_outputs()
Id | Type | Label | Doc |
---|---|---|---|
detected_water_body |
File |
None | None |
Component diagram¶
In [7]:
Copied!
wf.display_components_diagram(entrypoint="detect_water_body")
wf.display_components_diagram(entrypoint="detect_water_body")
Class diagram¶
In [8]:
Copied!
wf.display_class_diagram(entrypoint="detect_water_body")
wf.display_class_diagram(entrypoint="detect_water_body")
--------------------------------------------------------------------------- RemoteDisconnected Traceback (most recent call last) Cell In[8], line 1 ----> 1 wf.display_class_diagram(entrypoint="detect_water_body") 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:80, in WorkflowViewer._display_puml(self, diagram_type, wf, workflow_id) 76 encoded = deflate_and_encode(clear_output) 78 diagram_url = f"https://img.plantuml.biz/plantuml/png/{encoded}" ---> 80 with urlopen(diagram_url) as url: 81 img = Image.open(BytesIO(url.read())) 82 display(img) File /opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/urllib/request.py:189, in urlopen(url, data, timeout, context) 187 else: 188 opener = _opener --> 189 return opener.open(url, data, timeout) File /opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/urllib/request.py:489, in OpenerDirector.open(self, fullurl, data, timeout) 486 req = meth(req) 488 sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method()) --> 489 response = self._open(req, data) 491 # post-process response 492 meth_name = protocol+"_response" File /opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/urllib/request.py:506, in OpenerDirector._open(self, req, data) 503 return result 505 protocol = req.type --> 506 result = self._call_chain(self.handle_open, protocol, protocol + 507 '_open', req) 508 if result: 509 return result File /opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/urllib/request.py:466, in OpenerDirector._call_chain(self, chain, kind, meth_name, *args) 464 for handler in handlers: 465 func = getattr(handler, meth_name) --> 466 result = func(*args) 467 if result is not None: 468 return result File /opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/urllib/request.py:1367, in HTTPSHandler.https_open(self, req) 1366 def https_open(self, req): -> 1367 return self.do_open(http.client.HTTPSConnection, req, 1368 context=self._context) File /opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/urllib/request.py:1323, in AbstractHTTPHandler.do_open(self, http_class, req, **http_conn_args) 1321 except OSError as err: # timeout error 1322 raise URLError(err) -> 1323 r = h.getresponse() 1324 except: 1325 h.close() File /opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/http/client.py:1430, in HTTPConnection.getresponse(self) 1428 try: 1429 try: -> 1430 response.begin() 1431 except ConnectionError: 1432 self.close() File /opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/http/client.py:331, in HTTPResponse.begin(self) 329 # read until we get a non-100 response 330 while True: --> 331 version, status, reason = self._read_status() 332 if status != CONTINUE: 333 break File /opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/http/client.py:300, in HTTPResponse._read_status(self) 296 print("reply:", repr(line)) 297 if not line: 298 # Presumably, the server closed the connection before 299 # sending a valid response. --> 300 raise RemoteDisconnected("Remote end closed connection without" 301 " response") 302 try: 303 version, status, reason = line.split(None, 2) RemoteDisconnected: Remote end closed connection without response
In [ ]:
Copied!
In [ ]:
Copied!