|
1 | 1 | import colorsys |
2 | 2 | import math |
3 | 3 | from pathlib import Path |
4 | | -from typing import ClassVar, Optional |
| 4 | +from typing import ClassVar |
5 | 5 |
|
6 | 6 | import matplotlib.pyplot as plt |
7 | 7 | import numpy as np |
@@ -222,7 +222,7 @@ def plot_volumetric_strain_vs_angle( |
222 | 222 | ylim_range=None, |
223 | 223 | layout="single", |
224 | 224 | downsample: int = 1, |
225 | | - markevery: Optional[int] = None, |
| 225 | + markevery: int | None = None, |
226 | 226 | external_data=None, |
227 | 227 | ): |
228 | 228 | self.setup_plot_style() |
@@ -455,7 +455,7 @@ def extract_lie_aperture_from_list( |
455 | 455 | self, file_list: list[str], material_names: list[str], fracture_mat_id=3 |
456 | 456 | ) -> dict[str, tuple[np.ndarray, np.ndarray]]: |
457 | 457 | by_material: dict[str, tuple[np.ndarray, np.ndarray]] = {} |
458 | | - for vtu_file, mat_name in zip(file_list, material_names): |
| 458 | + for vtu_file, mat_name in zip(file_list, material_names, strict=False): |
459 | 459 | mesh = ot.MeshSeries(self.output_dir / vtu_file)[-1] |
460 | 460 | sub = self.get_sub_mesh_by_material(mesh, fracture_mat_id) |
461 | 461 | coords = sub.points |
@@ -484,7 +484,7 @@ def extract_vpf_width_from_list( |
484 | 484 | self, file_list: list[str], material_names: list[str] |
485 | 485 | ) -> dict[str, tuple[np.ndarray, np.ndarray]]: |
486 | 486 | width_by_material: dict[str, tuple[np.ndarray, np.ndarray]] = {} |
487 | | - for vtu_file, material_name in zip(file_list, material_names): |
| 487 | + for vtu_file, material_name in zip(file_list, material_names, strict=False): |
488 | 488 | mesh = ot.MeshSeries(self.output_dir / vtu_file)[-1] |
489 | 489 | cell_data = mesh.cell_data |
490 | 490 |
|
@@ -513,7 +513,7 @@ def extract_vpf_stress_from_list( |
513 | 513 | stress_type: str = "normal", |
514 | 514 | ) -> dict[str, tuple[np.ndarray, np.ndarray]]: |
515 | 515 | stress_by_material: dict[str, tuple[np.ndarray, np.ndarray]] = {} |
516 | | - for vtu_file, material_name in zip(file_list, material_names): |
| 516 | + for vtu_file, material_name in zip(file_list, material_names, strict=False): |
517 | 517 | mesh = ot.MeshSeries(self.output_dir / vtu_file)[-1] |
518 | 518 | cell_data = mesh.cell_data |
519 | 519 | point_data = mesh.point_data |
@@ -662,10 +662,10 @@ def plot_avg_width_vs_stress( |
662 | 662 | self, |
663 | 663 | pee_load_values: dict[str, list[float]], |
664 | 664 | metric: str = "width", |
665 | | - methods_to_include: Optional[list[str]] = None, |
666 | | - ylim_range: Optional[tuple[float, float]] = None, |
667 | | - external_data: Optional[dict[str, dict[str, dict[str, list[float]]]]] = None, |
668 | | - benchmark_tag: Optional[str] = None, |
| 665 | + methods_to_include: list[str] | None = None, |
| 666 | + ylim_range: tuple[float, float] | None = None, |
| 667 | + external_data: dict[str, dict[str, dict[str, list[float]]]] | None = None, |
| 668 | + benchmark_tag: str | None = None, |
669 | 669 | ) -> np.ndarray: |
670 | 670 | if methods_to_include is None: |
671 | 671 | methods_to_include = ["VPF", "LIE"] |
@@ -836,12 +836,11 @@ def plot_fracture_aperture_profiles( |
836 | 836 | widthProfile: dict[str, dict[str, tuple[np.ndarray, np.ndarray]]], |
837 | 837 | benchmark_tag: str, |
838 | 838 | downsample: int = 1, |
839 | | - markevery: Optional[int] = None, |
840 | | - ylim: Optional[tuple[float, float]] = None, |
| 839 | + markevery: int | None = None, |
| 840 | + ylim: tuple[float, float] | None = None, |
841 | 841 | method_label: str = "FEM", |
842 | | - external_data: Optional[ |
843 | | - dict[str, dict[str, dict[str, dict[str, list[float]]]]] |
844 | | - ] = None, |
| 842 | + external_data: dict[str, dict[str, dict[str, dict[str, list[float]]]]] |
| 843 | + | None = None, |
845 | 844 | ) -> None: |
846 | 845 | self.setup_plot_style() |
847 | 846 | for load_case, mat_prof in widthProfile.items(): |
@@ -974,7 +973,7 @@ def plot_fracture_aperture_profiles( |
974 | 973 |
|
975 | 974 | @staticmethod |
976 | 975 | def load_external_data( |
977 | | - ext_dir: str | Path, benchmark_tag: Optional[str] = None |
| 976 | + ext_dir: str | Path, benchmark_tag: str | None = None |
978 | 977 | ) -> dict[str, dict]: |
979 | 978 | """ |
980 | 979 | Scans ext_dir for extracted_*.npz and returns dicts: |
|
0 commit comments