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

make mypy happy #194

Merged
merged 2 commits into from
Oct 17, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:

- name: Upgrade pip and setuptools
run: |
python3 -m pip install pip setuptools --upgrade
python3 -m pip install --break-system-packages pip setuptools --upgrade

# See: https://github.com/marketplace/actions/setup-miniconda
- name: Setup Mambaforge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def create_hi_pass_viz(formatted_data_folder: Path, output_folder: Path, mesh_pa
topo_array[...] = topo_array_fsi

if quantity in {"d", "v", "p"} and amplitude:
assert vector_data_amplitude is not None
geo_array = vector_data_amplitude.create_dataset("Mesh/0/mesh/geometry", (n_nodes_fsi, 3))
geo_array[...] = coord_array_fsi
topo_array = vector_data_amplitude.create_dataset("Mesh/0/mesh/topology", (n_elements_fsi, 4), dtype="i")
Expand Down Expand Up @@ -235,6 +236,7 @@ def create_hi_pass_viz(formatted_data_folder: Path, output_folder: Path, mesh_pa
att_type = "Scalar"

if amplitude:
assert vector_data_amplitude is not None
v_array_amplitude = vector_data_amplitude.create_dataset(array_name, (n_nodes_fsi, 1))
v_array_amplitude[:, 0] = components_data_amplitude[0][:, idx]
rms_magnitude[:, idx] = components_data_amplitude[0][:, idx]
Expand Down Expand Up @@ -263,6 +265,7 @@ def create_hi_pass_viz(formatted_data_folder: Path, output_folder: Path, mesh_pa
att_type = "Tensor"

if amplitude:
assert vector_data_amplitude is not None
array_name = f"{viz_type_amplitude}/{viz_type_amplitude}_{idx}"
if idx == 0:
assert dof_info is not None
Expand Down Expand Up @@ -310,6 +313,7 @@ def create_hi_pass_viz(formatted_data_folder: Path, output_folder: Path, mesh_pa

array_name = f"{viz_type_magnitude}/{viz_type_magnitude}_{idx}"
assert dof_info_amplitude is not None
assert vector_data_mps is not None
if idx == 0:
for name, data in dof_info_amplitude.items():
dof_array = vector_data_mps.create_dataset(f"{array_name}/{name}", data=data)
Expand All @@ -326,6 +330,7 @@ def create_hi_pass_viz(formatted_data_folder: Path, output_folder: Path, mesh_pa
att_type = "Vector"

if amplitude:
assert vector_data_amplitude is not None
v_array_amplitude = vector_data_amplitude.create_dataset(array_name, (n_nodes_fsi, 3))
v_array_amplitude[:, 0] = components_data_amplitude[1][:, idx]
v_array_amplitude[:, 1] = components_data_amplitude[2][:, idx]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ def get_spectrogram(dfNearest: pd.DataFrame, fsamp: float, nWindow: int, overlap
bins = np.linspace(start_t, end_t, 100)
Pxx_mean = interp_spline(freqs, bins)

assert Pxx_mean is not None, "Pxx_mean is None"
Pxx_mean[Pxx_mean < 0] = 1e-16

return Pxx_mean, freqs, bins
Expand Down