From 4e3a163522e3b8d0b23f20294055b8250bc25bd8 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Tue, 14 Jan 2025 21:59:12 -0800 Subject: [PATCH] indentation & style --- examples/fdfd.py | 56 ++++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/examples/fdfd.py b/examples/fdfd.py index 4612ba0..e28a2d2 100644 --- a/examples/fdfd.py +++ b/examples/fdfd.py @@ -46,20 +46,24 @@ def test0(solver=generic_solver): # #### Create the grid, mask, and draw the device #### grid = gridlock.Grid(edge_coords) epsilon = grid.allocate(n_air**2, dtype=numpy.float32) - grid.draw_cylinder(epsilon, - surface_normal=2, - center=center, - radius=max(radii), - thickness=th, - eps=n_ring**2, - num_points=24) - grid.draw_cylinder(epsilon, - surface_normal=2, - center=center, - radius=min(radii), - thickness=th*1.1, - eps=n_air ** 2, - num_points=24) + grid.draw_cylinder( + epsilon, + surface_normal=2, + center=center, + radius=max(radii), + thickness=th, + foreground=n_ring**2, + num_points=24, + ) + grid.draw_cylinder( + epsilon, + surface_normal=2, + center=center, + radius=min(radii), + thickness=th*1.1, + foreground=n_air ** 2, + num_points=24, + ) dxes = [grid.dxyz, grid.autoshifted_dxyz()] for a in (0, 1, 2): @@ -71,9 +75,9 @@ def test0(solver=generic_solver): J[1][15, grid.shape[1]//2, grid.shape[2]//2] = 1 - ''' - Solve! - ''' + # + # Solve! + # sim_args = { 'omega': omega, 'dxes': dxes, @@ -87,9 +91,9 @@ def test0(solver=generic_solver): E = unvec(x, grid.shape) - ''' - Plot results - ''' + # + # Plot results + # pyplot.figure() pyplot.pcolor(numpy.real(E[1][:, :, grid.shape[2]//2]), cmap='seismic') pyplot.axis('equal') @@ -169,9 +173,9 @@ def test1(solver=generic_solver): # pcolor((numpy.abs(J3).sum(axis=2).sum(axis=0) > 0).astype(float).T) pyplot.show(block=True) - ''' - Solve! - ''' + # + # Solve! + # sim_args = { 'omega': omega, 'dxes': dxes, @@ -188,9 +192,9 @@ def test1(solver=generic_solver): E = unvec(x, grid.shape) - ''' - Plot results - ''' + # + # Plot results + # center = grid.pos2ind([0, 0, 0], None).astype(int) pyplot.figure() pyplot.subplot(2, 2, 1)