ignore some lint
This commit is contained in:
parent
c6c9159b13
commit
a1568a6f16
6 changed files with 30 additions and 24 deletions
|
|
@ -262,7 +262,7 @@ def maxwell_operator(
|
|||
else:
|
||||
# transform from mn to xyz
|
||||
b_xyz = (m * b_m
|
||||
+ n * b_n) # noqa: E128
|
||||
+ n * b_n) # noqa
|
||||
|
||||
# divide by mu
|
||||
temp = ifftn(b_xyz, axes=range(3))
|
||||
|
|
@ -409,7 +409,7 @@ def inverse_maxwell_operator_approx(
|
|||
else:
|
||||
# transform from mn to xyz
|
||||
h_xyz = (m * hin_m
|
||||
+ n * hin_n) # noqa: E128
|
||||
+ n * hin_n) # noqa
|
||||
|
||||
# multiply by mu
|
||||
temp = ifftn(h_xyz, axes=range(3))
|
||||
|
|
@ -474,7 +474,7 @@ def find_k(
|
|||
`(k, actual_frequency, eigenvalues, eigenvectors)`
|
||||
The found k-vector and its frequency, along with all eigenvalues and eigenvectors.
|
||||
"""
|
||||
direction = numpy.array(direction) / norm(direction)
|
||||
direction = numpy.array(direction) / norm(direction) # type: ignore[operator]
|
||||
|
||||
k_bounds = tuple(sorted(k_bounds)) # type: ignore # we know the length already...
|
||||
assert len(k_bounds) == 2
|
||||
|
|
@ -504,7 +504,7 @@ def find_k(
|
|||
assert n is not None
|
||||
assert v is not None
|
||||
actual_frequency = get_f(float(res.x), band)
|
||||
return direction * float(res.x), float(actual_frequency), n, v
|
||||
return direction * float(res.x), float(actual_frequency), n, v # type: ignore[operator,return-value]
|
||||
|
||||
|
||||
def eigsolve(
|
||||
|
|
|
|||
|
|
@ -87,14 +87,14 @@ def near_to_farfield(
|
|||
|
||||
# Normalized vector potentials N, L
|
||||
N = [-Hn_fft[1] * cos_phi * cos_th + Hn_fft[0] * cos_phi * sin_th,
|
||||
Hn_fft[1] * sin_th + Hn_fft[0] * cos_th] # noqa: E127
|
||||
Hn_fft[1] * sin_th + Hn_fft[0] * cos_th] # noqa
|
||||
L = [ En_fft[1] * cos_phi * cos_th - En_fft[0] * cos_phi * sin_th,
|
||||
-En_fft[1] * sin_th - En_fft[0] * cos_th] # noqa: E128
|
||||
-En_fft[1] * sin_th - En_fft[0] * cos_th] # noqa
|
||||
|
||||
E_far = [-L[1] - N[0],
|
||||
L[0] - N[1]] # noqa: E127
|
||||
L[0] - N[1]] # noqa
|
||||
H_far = [-E_far[1],
|
||||
E_far[0]] # noqa: E127
|
||||
E_far[0]] # noqa
|
||||
|
||||
theta = numpy.arctan2(ky, kx)
|
||||
phi = numpy.arccos(cos_phi)
|
||||
|
|
@ -203,9 +203,9 @@ def far_to_nearfield(
|
|||
|
||||
# Normalized vector potentials N, L
|
||||
L = [0.5 * E_far[1],
|
||||
-0.5 * E_far[0]] # noqa: E128
|
||||
-0.5 * E_far[0]] # noqa
|
||||
N = [L[1],
|
||||
-L[0]] # noqa: E128
|
||||
-L[0]] # noqa
|
||||
|
||||
En_fft = [
|
||||
numpy.divide(
|
||||
|
|
|
|||
|
|
@ -373,8 +373,10 @@ def normalized_fields_e(
|
|||
"""
|
||||
e = exy2e(wavenumber=wavenumber, dxes=dxes, epsilon=epsilon) @ e_xy
|
||||
h = exy2h(wavenumber=wavenumber, omega=omega, dxes=dxes, epsilon=epsilon, mu=mu) @ e_xy
|
||||
e_norm, h_norm = _normalized_fields(e=e, h=h, omega=omega, dxes=dxes, epsilon=epsilon,
|
||||
mu=mu, prop_phase=prop_phase)
|
||||
e_norm, h_norm = _normalized_fields( # type: ignore[call-arg]
|
||||
e=e, h=h, omega=omega, dxes=dxes, epsilon=epsilon,
|
||||
mu=mu, prop_phase=prop_phase,
|
||||
)
|
||||
return e_norm, h_norm
|
||||
|
||||
|
||||
|
|
@ -415,8 +417,10 @@ def normalized_fields_h(
|
|||
"""
|
||||
e = hxy2e(wavenumber=wavenumber, omega=omega, dxes=dxes, epsilon=epsilon, mu=mu) @ h_xy
|
||||
h = hxy2h(wavenumber=wavenumber, dxes=dxes, mu=mu) @ h_xy
|
||||
e_norm, h_norm = _normalized_fields(e=e, h=h, omega=omega, dxes=dxes, epsilon=epsilon,
|
||||
mu=mu, prop_phase=prop_phase)
|
||||
e_norm, h_norm = _normalized_fields( # type: ignore[call-arg]
|
||||
e=e, h=h, omega=omega, dxes=dxes, epsilon=epsilon,
|
||||
mu=mu, prop_phase=prop_phase,
|
||||
)
|
||||
return e_norm, h_norm
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -529,8 +529,10 @@ def normalized_fields_e(
|
|||
"""
|
||||
e = exy2e(angular_wavenumber=angular_wavenumber, omega=omega, dxes=dxes, rmin=rmin, epsilon=epsilon) @ e_xy
|
||||
h = exy2h(angular_wavenumber=angular_wavenumber, omega=omega, dxes=dxes, rmin=rmin, epsilon=epsilon, mu=mu) @ e_xy
|
||||
e_norm, h_norm = _normalized_fields(e=e, h=h, omega=omega, dxes=dxes, rmin=rmin, epsilon=epsilon,
|
||||
mu=mu, prop_phase=prop_phase)
|
||||
e_norm, h_norm = _normalized_fields( # type: ignore[call-arg]
|
||||
e=e, h=h, omega=omega, dxes=dxes, rmin=rmin, epsilon=epsilon,
|
||||
mu=mu, prop_phase=prop_phase,
|
||||
)
|
||||
return e_norm, h_norm
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -380,7 +380,7 @@ def _run_straight_waveguide_case(variant: str) -> WaveguideCalibrationResult:
|
|||
axis=0,
|
||||
polarity=1,
|
||||
slices=MONITOR_SLICES,
|
||||
omega=OMEGA,
|
||||
omega=OMEGA, # type: ignore[call-arg]
|
||||
)
|
||||
|
||||
update_e, update_h = fdtd.updates_with_cpml(cpml_params=_build_cpml_params(), dt=DT, dxes=base_dxes, epsilon=epsilon)
|
||||
|
|
@ -488,7 +488,7 @@ def _run_width_step_scattering_case() -> WaveguideScatteringResult:
|
|||
axis=0,
|
||||
polarity=-1,
|
||||
slices=SCATTERING_REFLECT_SLICES,
|
||||
omega=OMEGA,
|
||||
omega=OMEGA, # type: ignore[call-arg]
|
||||
)
|
||||
transmitted_mode = waveguide_3d.solve_mode(
|
||||
0,
|
||||
|
|
@ -506,7 +506,7 @@ def _run_width_step_scattering_case() -> WaveguideScatteringResult:
|
|||
axis=0,
|
||||
polarity=1,
|
||||
slices=SCATTERING_TRANSMIT_SLICES,
|
||||
omega=OMEGA,
|
||||
omega=OMEGA, # type: ignore[call-arg]
|
||||
)
|
||||
|
||||
update_e, update_h = fdtd.updates_with_cpml(cpml_params=_build_cpml_params(), dt=DT, dxes=base_dxes, epsilon=epsilon)
|
||||
|
|
@ -621,7 +621,7 @@ def _run_pulsed_straight_waveguide_case() -> PulsedWaveguideCalibrationResult:
|
|||
axis=0,
|
||||
polarity=1,
|
||||
slices=MONITOR_SLICES,
|
||||
omega=OMEGA,
|
||||
omega=OMEGA, # type: ignore[call-arg]
|
||||
)
|
||||
|
||||
update_e, update_h = fdtd.updates_with_cpml(cpml_params=_build_cpml_params(), dt=DT, dxes=base_dxes, epsilon=epsilon, dtype=complex)
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ def test_waveguide_3d_compute_overlap_e_uses_adjacent_window(
|
|||
axis=0,
|
||||
polarity=polarity,
|
||||
slices=slices,
|
||||
omega=OMEGA,
|
||||
omega=OMEGA, # type: ignore[call-arg]
|
||||
)
|
||||
|
||||
nonzero = numpy.argwhere(numpy.abs(overlap) > 0)
|
||||
|
|
@ -130,7 +130,7 @@ def test_waveguide_3d_compute_overlap_e_warns_when_window_is_clipped(
|
|||
axis=0,
|
||||
polarity=polarity,
|
||||
slices=slices,
|
||||
omega=OMEGA,
|
||||
omega=OMEGA, # type: ignore[call-arg]
|
||||
)
|
||||
|
||||
nonzero = numpy.argwhere(numpy.abs(overlap) > 0)
|
||||
|
|
@ -158,7 +158,7 @@ def test_waveguide_3d_compute_overlap_e_rejects_empty_overlap_window(
|
|||
axis=0,
|
||||
polarity=polarity,
|
||||
slices=slices,
|
||||
omega=OMEGA,
|
||||
omega=OMEGA, # type: ignore[call-arg]
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -173,7 +173,7 @@ def test_waveguide_3d_compute_overlap_e_rejects_zero_support_window() -> None:
|
|||
axis=0,
|
||||
polarity=1,
|
||||
slices=slices,
|
||||
omega=OMEGA,
|
||||
omega=OMEGA, # type: ignore[call-arg]
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue