|
39 | 39 | "exponential_interp_imp_mat", |
40 | 40 | ] |
41 | 41 |
|
42 | | -# Define a type alias for the expected signature of the metric interpolation functions |
43 | | -# (e.g., linear_interp_arrays) |
44 | | -MetricInterpFunc = Callable[Concatenate[np.ndarray, np.ndarray, ...], np.ndarray] |
45 | | - |
46 | | -# Define a type alias for the expected signature of the matrix interpolation function |
47 | | -# (e.g., linear_interp_imp_mat) |
48 | | -MatrixInterpFunc = Callable[ |
49 | | - Concatenate[sparse.csr_matrix, sparse.csr_matrix, int, ...], |
50 | | - List[sparse.csr_matrix], |
51 | | -] |
52 | | - |
53 | 42 |
|
54 | 43 | def linear_interp_imp_mat( |
55 | 44 | mat_start: sparse.csr_matrix, |
@@ -283,29 +272,30 @@ class InterpolationStrategyBase(ABC): |
283 | 272 |
|
284 | 273 | Attributes |
285 | 274 | ---------- |
286 | | - exposure_interp : MatrixInterpFunc |
| 275 | + exposure_interp : Callable |
287 | 276 | The function used to interpolate sparse impact matrices over the |
288 | 277 | exposure dimension. |
289 | 278 | Signature: (mat_start, mat_end, num_points, **kwargs) -> list[sparse.csr_matrix]. |
290 | | - hazard_interp : MetricInterpFunc |
| 279 | + hazard_interp : Callable |
291 | 280 | The function used to interpolate NumPy arrays of metrics over the |
292 | 281 | hazard dimension. |
293 | 282 | Signature: (arr_start, arr_end, **kwargs) -> np.ndarray. |
294 | | - vulnerability_interp : MetricInterpFunc |
| 283 | + vulnerability_interp : Callable |
295 | 284 | The function used to interpolate NumPy arrays of metrics over the |
296 | 285 | vulnerability dimension. |
297 | 286 | Signature: (arr_start, arr_end, **kwargs) -> np.ndarray. |
298 | 287 | """ |
299 | 288 |
|
300 | | - exposure_interp: MatrixInterpFunc |
301 | | - hazard_interp: MetricInterpFunc |
302 | | - vulnerability_interp: MetricInterpFunc |
| 289 | + exposure_interp: Callable |
| 290 | + hazard_interp: Callable |
| 291 | + vulnerability_interp: Callable |
303 | 292 |
|
304 | 293 | def interp_over_exposure_dim( |
305 | 294 | self, |
306 | 295 | imp_E0: sparse.csr_matrix, |
307 | 296 | imp_E1: sparse.csr_matrix, |
308 | 297 | interpolation_range: int, |
| 298 | + /, |
309 | 299 | **kwargs: Optional[Dict[str, Any]], |
310 | 300 | ) -> List[sparse.csr_matrix]: |
311 | 301 | """ |
@@ -356,6 +346,7 @@ def interp_over_hazard_dim( |
356 | 346 | self, |
357 | 347 | metric_0: np.ndarray, |
358 | 348 | metric_1: np.ndarray, |
| 349 | + /, |
359 | 350 | **kwargs: Optional[Dict[str, Any]], |
360 | 351 | ) -> np.ndarray: |
361 | 352 | """ |
@@ -384,6 +375,7 @@ def interp_over_vulnerability_dim( |
384 | 375 | self, |
385 | 376 | metric_0: np.ndarray, |
386 | 377 | metric_1: np.ndarray, |
| 378 | + /, |
387 | 379 | **kwargs: Optional[Dict[str, Any]], |
388 | 380 | ) -> np.ndarray: |
389 | 381 | """ |
|
0 commit comments