Skip to content

Commit

Permalink
Fix lint/code style errors/warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgenherje committed Oct 27, 2023
1 parent 2946b3c commit 93f28ac
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 30 deletions.
4 changes: 1 addition & 3 deletions backend/src/backend/primary/routers/seismic/router.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import logging
import numpy as np
from numpy.typing import NDArray
from typing import List, Optional

from fastapi import APIRouter, Depends, HTTPException, Query, Body
Expand Down Expand Up @@ -67,7 +65,7 @@ async def get_seismic_fence(

vds_handle: Optional[VdsHandle] = None
try:
vds_handle: VdsHandle = await seismic_access.get_vds_handle(
vds_handle = await seismic_access.get_vds_handle(
realization=realization_num,
seismic_attribute=seismic_attribute,
time_or_interval_str=time_or_interval_str,
Expand Down
24 changes: 12 additions & 12 deletions backend/src/services/vds_access/request_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
from enum import StrEnum
from typing import List

"""
This file contains the request types for the vds-slice service found in the following file:
https://github.com/equinor/vds-slice/blob/master/api/request.go
Master commit hash: ab6f39789bf3d3b59a8df14f1c4682d340dc0bf3
https://github.com/equinor/vds-slice/blob/ab6f39789bf3d3b59a8df14f1c4682d340dc0bf3/api/request.go
"""
######################################################################################################
#
# This file contains the request types for the vds-slice service found in the following file:
#
# https://github.com/equinor/vds-slice/blob/master/api/request.go
#
# Master commit hash: ab6f39789bf3d3b59a8df14f1c4682d340dc0bf3
#
# https://github.com/equinor/vds-slice/blob/ab6f39789bf3d3b59a8df14f1c4682d340dc0bf3/api/request.go
#
######################################################################################################


class VdsInterpolation(StrEnum):
Expand Down Expand Up @@ -66,7 +68,7 @@ def __init__(self, x_points: List[float], y_points: List[float]) -> None:
self.x_points = x_points
self.y_points = y_points

def to_list(self) -> List[float]:
def to_list(self) -> List[List[float]]:
return [[x, y] for x, y in zip(self.x_points, self.y_points)]


Expand Down Expand Up @@ -94,8 +96,6 @@ class VdsMetadataRequest(VdsRequestedResource):
See: https://github.com/equinor/vds-slice/blob/ab6f39789bf3d3b59a8df14f1c4682d340dc0bf3/api/request.go#L62-L64
"""

pass


@dataclass
class VdsFenceRequest(VdsRequestedResource):
Expand Down
22 changes: 11 additions & 11 deletions backend/src/services/vds_access/response_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@

from pydantic import BaseModel

"""
This file contains the response types for the vds-slice service found in the following file:
https://github.com/equinor/vds-slice/blob/master/internal/core/core.go
Master commit hash: ab6f39789bf3d3b59a8df14f1c4682d340dc0bf3
https://github.com/equinor/vds-slice/blob/ab6f39789bf3d3b59a8df14f1c4682d340dc0bf3/internal/core/core.go
"""
######################################################################################################
#
# This file contains the response types for the vds-slice service found in the following file:
#
# https://github.com/equinor/vds-slice/blob/master/internal/core/core.go
#
# Master commit hash: ab6f39789bf3d3b59a8df14f1c4682d340dc0bf3
#
# https://github.com/equinor/vds-slice/blob/ab6f39789bf3d3b59a8df14f1c4682d340dc0bf3/internal/core/core.go
#
######################################################################################################


@dataclass
Expand Down Expand Up @@ -39,8 +41,6 @@ class VdsFenceMetadata(VdsArray):
See: https://github.com/equinor/vds-slice/blob/ab6f39789bf3d3b59a8df14f1c4682d340dc0bf3/internal/core/core.go#L160-L162
"""

pass


class VdsAxis(BaseModel):
"""
Expand Down
3 changes: 2 additions & 1 deletion backend/src/services/vds_access/vds_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from requests_toolbelt.multipart.decoder import MultipartDecoder, BodyPart
import httpx

from src import config

from .response_types import VdsMetadata, VdsFenceMetadata
from .request_types import (
VdsCoordinates,
Expand All @@ -17,7 +19,6 @@
VdsMetadataRequest,
)

from src import config

LOGGER = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/modules/Intersection/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { Select, SelectOption } from "@lib/components/Select";
import { useValidState } from "@lib/hooks/useValidState";
import { useGetWellHeaders } from "@modules/_shared/WellBore";

import { isEqual, set } from "lodash";
import { isEqual } from "lodash";

import { useSeismicCubeDirectoryQuery } from "./queryHooks";
import { State } from "./state";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ export function updateLayout(
): void {
// Calculate midpoint for xAxis
// Need to calculate y...
const _hMid: number = curtain ? (curtain[0][0] + curtain[curtain.length - 1][0]) / 2 - extension : 1000;

void curtain; // TODO: Remove this line when curtain is used
void extension; // TODO: Remove this line when extension is used
// const _hMid: number = curtain ? (curtain[0][0] + curtain[curtain.length - 1][0]) / 2 - extension : 1000;

// this.controller.setViewport(hMid, 1750, 5000);

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/modules/Intersection/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const view = ({ moduleContext, workbenchSettings }: ModuleFCProps<State>)
}
)
.then((image) => setSeismicFenceImageBitmapAndStatus({ image: image ?? null, errorStatus: false }))
.catch((_error) => setSeismicFenceImageBitmapAndStatus({ image: null, errorStatus: true }));
.catch(() => setSeismicFenceImageBitmapAndStatus({ image: null, errorStatus: true }));

setWellboreTrajectoryProjection(newWellboreTrajectoryProjection);
setSeismicImageDataArray(newSeismicImageDataArray);
Expand Down

0 comments on commit 93f28ac

Please sign in to comment.