Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-kiaer committed Oct 2, 2023
1 parent 2c3a19b commit d4a5ec9
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def get_table_names_and_descriptions(
access = await InplaceVolumetricsAccess.from_case_uuid(
authenticated_user.get_sumo_access_token(), case_uuid, ensemble_name
)
table_names = await access.get_table_names_and_metadata()
table_names = access.get_table_names_and_metadata()
return table_names


Expand All @@ -49,7 +49,7 @@ async def get_realizations_response(
access = await InplaceVolumetricsAccess.from_case_uuid(
authenticated_user.get_sumo_access_token(), case_uuid, ensemble_name
)
response = await access.get_response(table_name, response_name, categorical_filter, realizations)
response = access.get_response(table_name, response_name, categorical_filter, realizations)
return response


Expand Down
2 changes: 1 addition & 1 deletion backend/src/backend/primary/routers/parameters/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ async def get_sensitivities(

access = await ParameterAccess.from_case_uuid(authenticated_user.get_sumo_access_token(), case_uuid, ensemble_name)

sensitivities = await access.get_parameters_and_sensitivities().sensitivities
sensitivities = access.get_parameters_and_sensitivities().sensitivities
return sensitivities if sensitivities else []
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async def get_well_completions_data(
access = await WellCompletionsAccess.from_case_uuid(
authenticated_user.get_sumo_access_token(), case_uuid, ensemble_name
)
well_completions_data = await access.get_well_completions_data(realization=realization)
well_completions_data = access.get_well_completions_data(realization=realization)

if not well_completions_data:
raise HTTPException(status_code=404, detail="Well completions data not found")
Expand Down
10 changes: 5 additions & 5 deletions backend/src/backend/user_session/routers/grid/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async def grid_surface(
realization = request.query_params.get("realization")

# Get Xtgeo grid
xtgeo_grid = get_grid_geometry(
xtgeo_grid = await get_grid_geometry(
authenticated_user=authenticated_user,
case_uuid=case_uuid,
ensemble_name=ensemble_name,
Expand Down Expand Up @@ -94,7 +94,7 @@ async def grid_parameter(
realization = request.query_params.get("realization")

# Get Xtgeo grid
xtgeo_grid = get_grid_geometry(
xtgeo_grid = await get_grid_geometry(
authenticated_user=authenticated_user,
case_uuid=case_uuid,
ensemble_name=ensemble_name,
Expand Down Expand Up @@ -141,7 +141,7 @@ async def grid_parameter_intersection( # pylint: disable=too-many-locals

timer = PerfTimer()
# Get Xtgeo grid
xtgeo_grid = get_grid_geometry(
xtgeo_grid = await get_grid_geometry(
authenticated_user=authenticated_user,
case_uuid=case_uuid,
ensemble_name=ensemble_name,
Expand Down Expand Up @@ -420,7 +420,7 @@ async def statistical_grid_parameter(
if not grid_access.grids_have_equal_nxnynz(grid_name=grid_name):
raise ValueError("Grids must have equal nx, ny, nz")

xtgeo_grid = get_grid_geometry(
xtgeo_grid = await get_grid_geometry(
authenticated_user=authenticated_user,
case_uuid=case_uuid,
ensemble_name=ensemble_name,
Expand Down Expand Up @@ -472,7 +472,7 @@ async def get_grid_geometry(
"""Get the xtgeo grid geometry for a given realization"""
token = authenticated_user.get_sumo_access_token()
grid_access = await GridAccess.from_case_uuid(token, case_uuid, ensemble_name)
grid_geometry = grid_access.get_grid_geometry(grid_name, int(realization))
grid_geometry = await grid_access.get_grid_geometry(grid_name, int(realization))

return grid_geometry

Expand Down
4 changes: 1 addition & 3 deletions backend/src/services/smda_access/queries/_get_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ async def get(access_token: str, endpoint: str, params: dict) -> List[dict]:
elif response.status_code == 404:
print(f"{str(response.status_code) } {endpoint} either does not exists or can not be found")
else:
print(
f"[WARNING:] Can not fetch data from endpont {endpoint} ({ str(response.status_code)})"
)
print(f"[WARNING:] Can not fetch data from endpont {endpoint} ({ str(response.status_code)})")
print(f"TIME SMDA fetch {endpoint} took {timer.lap_s():.2f} seconds")

return results
4 changes: 3 additions & 1 deletion backend/src/services/smda_access/well_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ async def get_field_wellbore_trajectories(
return wellbore_trajectories

async def get_wellbore_trajectories(self, wellbore_uuids: List[str]) -> List[WellBoreTrajectory]:
wellbore_trajectories = await get_wellbore_trajectories(access_token=self._smda_token, wellbore_uuids=wellbore_uuids)
wellbore_trajectories = await get_wellbore_trajectories(
access_token=self._smda_token, wellbore_uuids=wellbore_uuids
)
return wellbore_trajectories

async def get_well_headers(self, field_identifier: str) -> List[WellBoreHeader]:
Expand Down
4 changes: 2 additions & 2 deletions backend/src/services/sumo_access/queries/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def get_stratigraphic_column_identifier(sumo_client: SumoClient, case_id:
size=1,
select="masterdata.smda.stratigraphic_column.identifier",
)

hits = response["hits"]["hits"]
return hits[0]["_source"]["masterdata"]["smda"]["stratigraphic_column"]["identifier"]

Expand All @@ -24,7 +24,7 @@ async def get_field_identifiers(sumo_client: SumoClient, case_id: str) -> List[s
size=1,
select="masterdata.smda.field.identifier",
)

hits = response["hits"]["hits"]
fields = hits[0]["_source"]["masterdata"]["smda"]["field"]
return [field["identifier"] for field in fields]

0 comments on commit d4a5ec9

Please sign in to comment.