|
1 | 1 | import json
|
2 | 2 | import pathlib
|
3 |
| -from typing import Union |
| 3 | +from typing import Union, Optional |
4 | 4 | import typing
|
5 | 5 |
|
6 | 6 | from openeo.internal.graph_building import PGNode
|
@@ -51,12 +51,11 @@ def _api_version(self):
|
51 | 51 | def connection(self):
|
52 | 52 | return self._connection
|
53 | 53 |
|
54 |
| - def save_ml_model(self, format: str = "default", options: dict = None): |
| 54 | + def save_ml_model(self, options: Optional[dict] = None): |
55 | 55 | pgnode = PGNode(
|
56 | 56 | process_id="save_ml_model",
|
57 | 57 | arguments={
|
58 |
| - "data": {'from_node': self._pg}, |
59 |
| - "format": format, |
| 58 | + "data": {"from_node": self}, |
60 | 59 | "options": options or {}
|
61 | 60 | }
|
62 | 61 | )
|
@@ -86,17 +85,10 @@ def execute_batch(
|
86 | 85 | print=print, max_poll_interval=max_poll_interval, connection_retry_interval=connection_retry_interval
|
87 | 86 | )
|
88 | 87 |
|
89 |
| - def send_job(self, out_format=None, job_options=None, **format_options) -> RESTJob: |
| 88 | + def send_job(self, **kwargs) -> RESTJob: |
90 | 89 | """
|
91 | 90 | Sends a job to the backend and returns a ClientJob instance.
|
92 | 91 |
|
93 |
| - :param out_format: String Format of the job result. |
94 |
| - :param job_options: |
95 |
| - :param format_options: String Parameters for the job result format |
96 |
| - :return: status: ClientJob resulting job. |
| 92 | + :return: resulting job. |
97 | 93 | """
|
98 |
| - shp = self |
99 |
| - if out_format: |
100 |
| - # add `save_result` node |
101 |
| - shp = shp.save_ml_model(format=out_format, options=format_options) |
102 |
| - return self._connection.create_job(process_graph=shp.flat_graph(), additional=job_options) |
| 94 | + return self._connection.create_job(process_graph=self.flat_graph(), **kwargs) |
0 commit comments