From 9169b440fe0ec53d01b925b51fe4ef228d0a801b Mon Sep 17 00:00:00 2001 From: Runar Ask Johannessen <89020325+equinor-ruaj@users.noreply.github.com> Date: Mon, 26 Aug 2024 11:11:13 +0200 Subject: [PATCH] Use new endpoint for surface aggregation (#340) --- .../sumo/explorer/objects/surface_collection.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/fmu/sumo/explorer/objects/surface_collection.py b/src/fmu/sumo/explorer/objects/surface_collection.py index 7d16ef87..f22bedb2 100644 --- a/src/fmu/sumo/explorer/objects/surface_collection.py +++ b/src/fmu/sumo/explorer/objects/surface_collection.py @@ -134,8 +134,12 @@ def _aggregate(self, operation: str) -> RegularSurface: object_ids = list(map(lambda obj: obj["_id"], objects)) res = self._sumo.post( - "/surface/aggregate", - json={"operation": [operation], "object_ids": object_ids}, + "/aggregations", + json={ + "operation": [operation], + "object_ids": object_ids, + "class": "surface", + }, ) self._aggregation_cache[operation] = surface_from_file( @@ -152,8 +156,12 @@ async def _aggregate_async(self, operation: str) -> RegularSurface: object_ids = list(map(lambda obj: obj["_id"], objects)) res = await self._sumo.post_async( - "/surface/aggregate", - json={"operation": [operation], "object_ids": object_ids}, + "/aggregations", + json={ + "operations": [operation], + "object_ids": object_ids, + "class": "surface", + }, ) self._aggregation_cache[operation] = surface_from_file(