Skip to content

Commit

Permalink
Refactor - Removed unused duplicated strat unit schema (#824)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anders2303 authored Dec 9, 2024
1 parent 8dd8da3 commit cbb406c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 46 deletions.
6 changes: 6 additions & 0 deletions backend_py/primary/primary/routers/surface/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ class PointSetXY(BaseModel):


class StratigraphicUnit(BaseModel):
"""
Stratigraphic unit from SMDA
Camel case attributes needed for esvIntersection component in front-end
"""

identifier: str
top: str
base: str
Expand Down
21 changes: 1 addition & 20 deletions backend_py/primary/primary/routers/well/converters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from primary.services.smda_access.types import WellboreHeader, WellboreTrajectory, WellborePick, StratigraphicUnit
from primary.services.smda_access.types import WellboreHeader, WellboreTrajectory, WellborePick
from primary.services.ssdl_access.types import (
WellboreCasing,
WellboreCompletion,
Expand Down Expand Up @@ -27,25 +27,6 @@ def convert_wellbore_pick_to_schema(wellbore_pick: WellborePick) -> schemas.Well
)


def convert_stratigraphic_unit_to_schema(
stratigraphic_unit: StratigraphicUnit,
) -> schemas.StratigraphicUnit:
return schemas.StratigraphicUnit(
identifier=stratigraphic_unit.identifier,
top=stratigraphic_unit.top,
base=stratigraphic_unit.base,
stratUnitLevel=stratigraphic_unit.strat_unit_level,
stratUnitType=stratigraphic_unit.strat_unit_type,
topAge=stratigraphic_unit.top_age,
baseAge=stratigraphic_unit.base_age,
stratUnitParent=stratigraphic_unit.strat_unit_parent,
colorR=stratigraphic_unit.color_r,
colorG=stratigraphic_unit.color_g,
colorB=stratigraphic_unit.color_b,
lithologyType=stratigraphic_unit.lithology_type,
)


def convert_wellbore_header_to_schema(
drilled_wellbore_header: WellboreHeader,
) -> schemas.WellboreHeader:
Expand Down
26 changes: 0 additions & 26 deletions backend_py/primary/primary/routers/well/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,6 @@
from pydantic import BaseModel


class StratigraphicUnit(BaseModel):
"""
Stratigraphic unit from SMDA
Camel case attributes needed for esvIntersection component in front-end
"""

identifier: str
top: str
base: str
stratUnitLevel: int
stratUnitType: str
topAge: int | float
baseAge: int | float
stratUnitParent: Optional[str] = None
colorR: int
colorG: int
colorB: int
lithologyType: int | float | str = "unknown"


class WellboreHeader(BaseModel):
wellboreUuid: str
uniqueWellboreIdentifier: str
Expand Down Expand Up @@ -66,11 +45,6 @@ class WellborePick(BaseModel):
mdUnit: str


class WellborePicksAndStratigraphicUnits(BaseModel):
wellbore_picks: List[WellborePick] = []
stratigraphic_units: List[StratigraphicUnit] = []


class WellboreCompletion(BaseModel):
mdTop: float
mdBottom: float
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/api/models/StratigraphicUnit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
/**
* Stratigraphic unit from SMDA
*
* Camel case attributes needed for esvIntersection component in front-end
*/
export type StratigraphicUnit = {
identifier: string;
top: string;
Expand Down

0 comments on commit cbb406c

Please sign in to comment.