Skip to content

Conversation

@EmileSonneveld
Copy link
Member

cloudinsar/s1-workflows#70

@soxofaan , would this be an ok way to solve this?

@soxofaan
Copy link
Member

soxofaan commented Dec 9, 2025

yes that would solve it, but I'd like to avoid an explosion of these ..._from_process convenience methods (e.g. we'll also need comparable variants for vector cubes, MlModel, and there are also variants ..._from_flat_graph, ..._from_json, ...).

I'm wondering if the "UI" can't be simplified to a single Connection.process() method that handles all that automatically
e.g. something like

class Connection:
    ...
    def process(self, process_id, ...):
         if "process returns raster cube":
              return DataCube(...)
         elif "process returns vector cube":
              return VectorCube(...
         elif "process returns Stac resource":
              return StacResource(....
         ...

@EmileSonneveld
Copy link
Member Author

Ok if I put that in a ticket for later and already merge this?

@EmileSonneveld
Copy link
Member Author

This is the current workaround:

stac_resource = StacResource(
  graph=PGNode(
      process_id="run_cwl_to_stac",
      arguments={
          "cwl_url": "https://raw.githubusercontent.com/cloudinsar/s1-workflows/refs/heads/main/cwl/sar_slc_preprocessing.cwl",
          "context": input_dict_belgium_vv_master_outside_preprocessing,
      },
  ),
  connection=connection,
)

Later, CWLs should be runned with run_udf, so there is no need for this yet.

@soxofaan soxofaan deleted the stac_resource_from_process branch December 10, 2025 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants