diff --git a/flow360/cloud/flow360_requests.py b/flow360/cloud/flow360_requests.py index 64909fcde..c3c0fc0a0 100644 --- a/flow360/cloud/flow360_requests.py +++ b/flow360/cloud/flow360_requests.py @@ -118,6 +118,11 @@ class NewGeometryRequest(Flow360RequestsV2): alias="lengthUnit", description="project length unit" ) description: str = pd_v2.Field(default="", description="project description") + use_nextflow: bool = pd_v2.Field( + default=False, + alias="useNextflow", + description="Route geometry processing through Nextflow pipeline instead of legacy system", + ) class NewSurfaceMeshRequestV2(Flow360RequestsV2): diff --git a/flow360/component/geometry.py b/flow360/component/geometry.py index fe4c6bf10..c19e3c66e 100644 --- a/flow360/component/geometry.py +++ b/flow360/component/geometry.py @@ -107,6 +107,7 @@ def __init__( length_unit: LengthUnitType = "m", tags: List[str] = None, folder: Optional[Folder] = None, + use_nextflow_pipelines: bool = False, ): """ Initialize a GeometryDraft with common attributes. @@ -138,6 +139,7 @@ def __init__( self.length_unit = length_unit self.solver_version = solver_version self.folder = folder + self.use_nextflow_pipelines = use_nextflow_pipelines # pylint: disable=fixme # TODO: create a DependableResourceDraft for GeometryDraft and SurfaceMeshDraft @@ -241,6 +243,7 @@ def _create_project_root_resource( parent_folder_id=self.folder.id if self.folder else "ROOT.FLOW360", length_unit=self.length_unit, description=description, + use_nextflow=self.use_nextflow_pipelines, ) resp = RestApi(GeometryInterface.endpoint).post(req.dict()) @@ -473,10 +476,16 @@ def from_file( length_unit: LengthUnitType = "m", tags: List[str] = None, folder: Optional[Folder] = None, + use_nextflow_pipelines: bool = False, ) -> GeometryDraft: - # For type hint only but proper fix is to fully abstract the Draft class too. - return super().from_file( - file_names, project_name, solver_version, length_unit, tags, folder=folder + return GeometryDraft( + file_names=file_names, + project_name=project_name, + solver_version=solver_version, + length_unit=length_unit, + tags=tags, + folder=folder, + use_nextflow_pipelines=use_nextflow_pipelines, ) @classmethod