Skip to content

Commit

Permalink
Use new endpoint for surface aggregation (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
equinor-ruaj authored Aug 26, 2024
1 parent e53f511 commit 9169b44
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/fmu/sumo/explorer/objects/surface_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down

0 comments on commit 9169b44

Please sign in to comment.