Skip to content

Commit 20931d6

Browse files
py38 compatibility - test_production_well_stimulation_cost/test_geophires_x.py
1 parent a3cd9d2 commit 20931d6

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

tests/test_geophires_x.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
from __future__ import annotations
2+
13
import math
24
import os
35
import tempfile
46
import uuid
57
from pathlib import Path
68
from typing import Any
7-
from typing import Optional
89

910
from geophires_x.OptionList import PlantType
1011
from geophires_x.OptionList import WellDrillingCostCorrelation
@@ -270,7 +271,7 @@ def _sanitize_nan(self, r: GeophiresXResult) -> None:
270271
except TypeError:
271272
pass
272273

273-
def _get_unequal_dicts_approximate_percent_difference(self, d1: dict, d2: dict) -> Optional[float]:
274+
def _get_unequal_dicts_approximate_percent_difference(self, d1: dict, d2: dict) -> float | None:
274275
for i in range(99):
275276
try:
276277
self.assertDictAlmostEqual(d1, d2, percent=i)
@@ -967,9 +968,9 @@ def test_sbt_coaxial_raises_error(self):
967968

968969
def test_production_well_stimulation_cost(self):
969970
def _get_result(
970-
prod_well_stim_MUSD: Optional[int] = None,
971-
inj_well_stim_MUSD: Optional[int] = None,
972-
additional_params: Optional[dict[str, Any]] = None,
971+
prod_well_stim_MUSD: int | None = None,
972+
inj_well_stim_MUSD: int | None = None,
973+
additional_params: dict[str, Any] | None = None,
973974
) -> GeophiresXResult:
974975
if additional_params is None:
975976
additional_params = {}
@@ -1030,9 +1031,9 @@ def _get_result(
10301031

10311032
def test_indirect_costs(self):
10321033
def _get_result(
1033-
indirect_cost_percent: Optional[int] = None,
1034-
stimulation_indirect_cost_percent: Optional[int] = None,
1035-
wellfield_indirect_cost_percent: Optional[int] = None,
1034+
indirect_cost_percent: int | None = None,
1035+
stimulation_indirect_cost_percent: int | None = None,
1036+
wellfield_indirect_cost_percent: int | None = None,
10361037
input_file_path: str = 'geophires_x_tests/generic-egs-case.txt',
10371038
) -> float:
10381039
p = {}
@@ -1130,7 +1131,7 @@ def wellfield_cost(result_cap_costs):
11301131

11311132
def test_contingency(self):
11321133
def _get_result(
1133-
contingency_percentage: Optional[int] = None,
1134+
contingency_percentage: int | None = None,
11341135
input_file_path: str = 'geophires_x_tests/generic-egs-case.txt',
11351136
) -> float:
11361137
p = {}

0 commit comments

Comments
 (0)