Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded to mypy version 1.5.1 #300

Merged
merged 2 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 32 additions & 36 deletions backend/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sumo-wrapper-python = "^0.3.4"
black = "^22.12.0"
pylint = "^2.15.10"
pytest = "^7.2.1"
mypy = "^0.991"
mypy = "^1.5.1"
bandit = "^1.7.5"
types-requests = "^2.31.0.1"

Expand Down
2 changes: 1 addition & 1 deletion backend/src/backend/primary/routers/explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class EnsembleDetails(BaseModel):
name: str
case_name: str
case_uuid: str
realizations: List[int]
realizations: Sequence[int]


@router.get("/fields")
Expand Down
2 changes: 1 addition & 1 deletion backend/src/backend/primary/routers/surface/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ def to_api_surface_data(xtgeo_surf: xtgeo.RegularSurface) -> schemas.SurfaceData
val_min=xtgeo_surf.values.min(),
val_max=xtgeo_surf.values.max(),
rot_deg=xtgeo_surf.rotation,
mesh_data=orjson.dumps(float32values), # pylint: disable=maybe-no-member,
mesh_data=orjson.dumps(float32values).decode(),
)
2 changes: 1 addition & 1 deletion backend/src/services/sumo_access/parameter_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def create_ensemble_sensitivities(
return sensitivities if sensitivities else None


def find_sensitivity_type(sens_case_names: List[str]) -> str:
def find_sensitivity_type(sens_case_names: List[str]) -> SensitivityType:
"""Find the sensitivity type based on the sensitivity case names"""
if len(sens_case_names) == 1 and sens_case_names[0] == "p10_p90":
return SensitivityType.MONTECARLO
Expand Down
1 change: 1 addition & 0 deletions backend/src/services/sumo_access/summary_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class VectorInfo(BaseModel):

class VectorMetadata(BaseModel):
unit: str
is_total: bool
is_rate: bool
is_historical: bool
keyword: str
Expand Down
2 changes: 1 addition & 1 deletion backend/src/services/sumo_access/surface_polygon_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ class SurfacePolygonsDirectory(BaseModel):

@classmethod
def create_empty(cls) -> SurfacePolygonsDirectory:
return cls(attributes=[], names=[])
return cls(attributes=[], names=[], valid_attributes_for_name=[])
2 changes: 1 addition & 1 deletion backend/src/services/sumo_access/surface_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ class StaticSurfaceDirectory(BaseModel):

@classmethod
def create_empty(cls) -> StaticSurfaceDirectory:
return cls(attributes=[], names=[])
return cls(attributes=[], names=[], valid_attributes_for_name=[])
6 changes: 5 additions & 1 deletion backend/src/services/utils/well_completion_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
WellCompletionWell,
WellCompletionDataSet,
WellCompletionZone,
WellCompletionUnitInfo,
WellCompletionUnits,
)


Expand Down Expand Up @@ -67,7 +69,9 @@ def create_well_completion_dataset(self) -> WellCompletionDataSet:

return WellCompletionDataSet(
version="1.1.0",
units={"kh": {"unit": self._kh_unit, "decimalPlaces": self._kh_decimal_places}},
units=WellCompletionUnits(
kh=WellCompletionUnitInfo(unit=self._kh_unit, decimalPlaces=self._kh_decimal_places)
),
stratigraphy=self._extract_stratigraphy(self._dummy_stratigraphy(), self._zones),
timeSteps=[pd.to_datetime(str(dte)).strftime("%Y-%m-%d") for dte in self._datemap.keys()],
wells=self._extract_wells(),
Expand Down