Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Alec Hammond committed Apr 11, 2024
1 parent e14534f commit 1e08ab2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 3 additions & 1 deletion python/adjoint/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,9 @@ def conic_filter(
"""
Nx, Ny, X, Y = mesh_grid(radius, Lx, Ly, resolution, periodic_axes)
x = x.reshape(Nx, Ny) # Ensure the input is 2d
h = npa.where(X**2 + Y**2 < radius**2, (1 - np.sqrt(abs(X**2 + Y**2)) / radius), 0)
h = npa.where(
X**2 + Y**2 < radius**2, (1 - np.sqrt(abs(X**2 + Y**2)) / radius), 0
)
return convolve_design_weights_and_kernel(x, h, periodic_axes)


Expand Down
9 changes: 2 additions & 7 deletions python/examples/waveguide_crossing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""waveguide_crossing.py - Using meep's adjoint solver, designs a waveguide
crossing that maximizes transmission at a single frequency.
crossing that maximizes transmission at a single frequency.
Two approaches are demonstrated: (1) start with the nominal crossing shape and
perform shape optimization via meep's smoothed projection feature; (2) run a
Expand Down Expand Up @@ -611,12 +611,7 @@ def analyze_FOM_convergence(
damping_factor=damping_factor,
)
print("Running shape optimization WITH smoothing...")
(
_,
results_smoothed,
_,
_,
) = run_shape_optimization(
(_, results_smoothed, _, _,) = run_shape_optimization(
beta=beta,
resolution=resolution,
maxeval=maxeval,
Expand Down

0 comments on commit 1e08ab2

Please sign in to comment.