Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions src/picterra/forge_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,30 +746,6 @@ def run_dataset_recommendation(self, detector_id: str):
raise APIError(resp.text)
return self._wait_until_operation_completes(resp.json())

def run_advanced_tool(
self, tool_id: str, inputs: dict[str, Any], outputs: dict[str, Any]
):
"""
This is an experimental feature

Runs a tool and waits for its execution, returning the finished operation metadata

Args:
tool_id: The id of the tool to run
inputs: tool inputs
outputs: tool outputs

Raises:
APIError: There was an error while launching and executing the tool
"""
resp = self.sess.post(
self._full_url("advanced_tools/%s/run/" % tool_id),
json={"inputs": inputs, "outputs": outputs},
)
if not resp.ok:
raise APIError(resp.text)
return self._wait_until_operation_completes(resp.json())

def upload_vector_layer(
self,
raster_id: str,
Expand Down
24 changes: 0 additions & 24 deletions tests/test_forge_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1166,30 +1166,6 @@ def test_list_raster_vector_layers(monkeypatch):
)


@responses.activate
def test_run_advanced_tool(monkeypatch):
_add_api_response(
detector_api_url("advanced_tools/foobar/run/"),
responses.POST,
json=OP_RESP,
match=responses.matchers.json_params_matcher(
{
"inputs": {"foo": "bar"},
"outputs": {"spam": [1, 2], "bar": {"foo": None, "bar": 4}},
}
),
)
add_mock_operations_responses("success")
client = _client(monkeypatch)
assert (
client.run_advanced_tool(
"foobar", {"foo": "bar"}, {"spam": [1, 2], "bar": {"foo": None, "bar": 4}}
)["type"]
== "mock_operation_type"
)
assert len(responses.calls) == 2


@responses.activate
def test_import_raster_from_remote_source(monkeypatch):
body = {
Expand Down
Loading