|
| 1 | +from __future__ import annotations |
| 2 | + |
1 | 3 | import math |
2 | 4 | import os |
3 | 5 | import tempfile |
4 | 6 | import uuid |
5 | 7 | from pathlib import Path |
6 | 8 | from typing import Any |
7 | | -from typing import Optional |
8 | 9 |
|
9 | 10 | from geophires_x.OptionList import PlantType |
10 | 11 | from geophires_x.OptionList import WellDrillingCostCorrelation |
@@ -270,7 +271,7 @@ def _sanitize_nan(self, r: GeophiresXResult) -> None: |
270 | 271 | except TypeError: |
271 | 272 | pass |
272 | 273 |
|
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: |
274 | 275 | for i in range(99): |
275 | 276 | try: |
276 | 277 | self.assertDictAlmostEqual(d1, d2, percent=i) |
@@ -967,9 +968,9 @@ def test_sbt_coaxial_raises_error(self): |
967 | 968 |
|
968 | 969 | def test_production_well_stimulation_cost(self): |
969 | 970 | 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, |
973 | 974 | ) -> GeophiresXResult: |
974 | 975 | if additional_params is None: |
975 | 976 | additional_params = {} |
@@ -1030,9 +1031,9 @@ def _get_result( |
1030 | 1031 |
|
1031 | 1032 | def test_indirect_costs(self): |
1032 | 1033 | 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, |
1036 | 1037 | input_file_path: str = 'geophires_x_tests/generic-egs-case.txt', |
1037 | 1038 | ) -> float: |
1038 | 1039 | p = {} |
@@ -1130,7 +1131,7 @@ def wellfield_cost(result_cap_costs): |
1130 | 1131 |
|
1131 | 1132 | def test_contingency(self): |
1132 | 1133 | def _get_result( |
1133 | | - contingency_percentage: Optional[int] = None, |
| 1134 | + contingency_percentage: int | None = None, |
1134 | 1135 | input_file_path: str = 'geophires_x_tests/generic-egs-case.txt', |
1135 | 1136 | ) -> float: |
1136 | 1137 | p = {} |
|
0 commit comments