Skip to content

Commit

Permalink
Housekeeping: removed unused/misused B64EncodedNumpyArray pydantic mo…
Browse files Browse the repository at this point in the history
…del (equinor#370)
  • Loading branch information
sigurdp authored Sep 28, 2023
1 parent 290273a commit 05ce9de
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 25 deletions.
6 changes: 3 additions & 3 deletions backend/src/backend/primary/routers/grid/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from src.backend.primary.user_session_proxy import proxy_to_user_session

from src.services.sumo_access.grid_access import GridAccess
from .schemas import GridSurface, B64EncodedNumpyArray, GridIntersection
from .schemas import GridSurface, GridIntersection

router = APIRouter()

Expand Down Expand Up @@ -84,7 +84,7 @@ async def grid_parameter(
parameter_name: str = Query(description="Grid parameter"),
realization: str = Query(description="Realization"),
authenticated_user: AuthenticatedUser = Depends(AuthHelper.get_authenticated_user),
) -> B64EncodedNumpyArray:
) -> List[float]:
"""Get a grid parameter"""

query_params = {
Expand Down Expand Up @@ -192,7 +192,7 @@ async def statistical_grid_parameter(
parameter_name: str = Query(description="Grid parameter"),
realizations: List[str] = Query(description="Realizations"),
authenticated_user: AuthenticatedUser = Depends(AuthHelper.get_authenticated_user),
) -> B64EncodedNumpyArray:
) -> List[float]:
"""Get a grid parameter"""

query_params = {
Expand Down
6 changes: 0 additions & 6 deletions backend/src/backend/primary/routers/grid/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
from pydantic import BaseModel


class B64EncodedNumpyArray(BaseModel):
bvals: str
dtype: str
shape: List[int]


class GridSurface(BaseModel):
polys: dict
points: dict
Expand Down
1 change: 0 additions & 1 deletion frontend/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export { CancelablePromise, CancelError } from './core/CancelablePromise';
export { OpenAPI } from './core/OpenAPI';
export type { OpenAPIConfig } from './core/OpenAPI';

export type { B64EncodedNumpyArray as B64EncodedNumpyArray_api } from './models/B64EncodedNumpyArray';
export type { Body_get_realizations_response as Body_get_realizations_response_api } from './models/Body_get_realizations_response';
export type { CaseInfo as CaseInfo_api } from './models/CaseInfo';
export type { Completions as Completions_api } from './models/Completions';
Expand Down
10 changes: 0 additions & 10 deletions frontend/src/api/models/B64EncodedNumpyArray.ts

This file was deleted.

9 changes: 4 additions & 5 deletions frontend/src/api/services/GridService.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { B64EncodedNumpyArray } from '../models/B64EncodedNumpyArray';
import type { GridIntersection } from '../models/GridIntersection';
import type { GridSurface } from '../models/GridSurface';

Expand Down Expand Up @@ -104,7 +103,7 @@ export class GridService {
* @param gridName Grid name
* @param parameterName Grid parameter
* @param realization Realization
* @returns B64EncodedNumpyArray Successful Response
* @returns number Successful Response
* @throws ApiError
*/
public gridParameter(
Expand All @@ -113,7 +112,7 @@ export class GridService {
gridName: string,
parameterName: string,
realization: string,
): CancelablePromise<B64EncodedNumpyArray> {
): CancelablePromise<Array<number>> {
return this.httpRequest.request({
method: 'GET',
url: '/grid/grid_parameter',
Expand Down Expand Up @@ -206,7 +205,7 @@ export class GridService {
* @param gridName Grid name
* @param parameterName Grid parameter
* @param realizations Realizations
* @returns B64EncodedNumpyArray Successful Response
* @returns number Successful Response
* @throws ApiError
*/
public statisticalGridParameter(
Expand All @@ -215,7 +214,7 @@ export class GridService {
gridName: string,
parameterName: string,
realizations: Array<string>,
): CancelablePromise<B64EncodedNumpyArray> {
): CancelablePromise<Array<number>> {
return this.httpRequest.request({
method: 'GET',
url: '/grid/statistical_grid_parameter',
Expand Down

0 comments on commit 05ce9de

Please sign in to comment.