Skip to content

Commit 6cd6405

Browse files
committed
formating using ruff
1 parent 69580d5 commit 6cd6405

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

optiland/phase/constant.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ class ConstantPhaseProfile(BasePhaseProfile):
2424
def __init__(self, phase: float = 0.0):
2525
self.phase = phase
2626

27-
def get_phase(self, x: be.Array, y: be.Array, wavelength: be.Array = None) -> be.Array:
27+
def get_phase(
28+
self, x: be.Array, y: be.Array, wavelength: be.Array = None
29+
) -> be.Array:
2830
"""Calculates the phase added by the profile at coordinates (x, y).
2931
3032
Args:
@@ -51,7 +53,9 @@ def get_gradient(
5153
"""
5254
return be.zeros_like(x), be.zeros_like(y), be.zeros_like(x)
5355

54-
def get_paraxial_gradient(self, y: be.Array, wavelength: be.Array = None) -> be.Array:
56+
def get_paraxial_gradient(
57+
self, y: be.Array, wavelength: be.Array = None
58+
) -> be.Array:
5559
"""Calculates the paraxial phase gradient at y-coordinate.
5660
5761
This is the gradient d_phi/dy evaluated at x=0.

optiland/phase/grid.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ def __init__(
5656
self.y_coords, self.x_coords, self.phase_grid
5757
)
5858

59-
def get_phase(self, x: be.Array, y: be.Array, wavelength: be.Array = None) -> be.Array:
59+
def get_phase(
60+
self, x: be.Array, y: be.Array, wavelength: be.Array = None
61+
) -> be.Array:
6062
"""Calculates the phase added by the profile at coordinates (x, y).
6163
6264
Args:
@@ -88,7 +90,9 @@ def get_gradient(
8890
d_phi_dz = be.zeros_like(x)
8991
return d_phi_dx, d_phi_dy, d_phi_dz
9092

91-
def get_paraxial_gradient(self, y: be.Array, wavelength: be.Array = None) -> be.Array:
93+
def get_paraxial_gradient(
94+
self, y: be.Array, wavelength: be.Array = None
95+
) -> be.Array:
9296
"""Calculates the paraxial phase gradient at y-coordinate.
9397
9498
This is the gradient d_phi/dy evaluated at x=0.

optiland/phase/height_profile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,4 @@ def from_dict(cls, data: dict) -> HeightProfile:
116116
y_coords=be.array(data["y_coords"]),
117117
height_map=be.array(data["height_map"]),
118118
material=data["material"],
119-
)
119+
)

optiland/phase/linear_grating.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ def __init__(
5757
def efficiency(self) -> float:
5858
return self._efficiency
5959

60-
def get_phase(self, x: be.Array, y: be.Array, wavelength: be.Array = None) -> be.Array:
60+
def get_phase(
61+
self, x: be.Array, y: be.Array, wavelength: be.Array = None
62+
) -> be.Array:
6163
"""Calculates the phase added by the profile at coordinates (x, y).
6264
6365
Args:

optiland/phase/radial.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ class RadialPhaseProfile(BasePhaseProfile):
2323
def __init__(self, coefficients: list[float]):
2424
self.coefficients = coefficients
2525

26-
def get_phase(self, x: be.Array, y: be.Array, wavelength: be.Array = None) -> be.Array:
26+
def get_phase(
27+
self, x: be.Array, y: be.Array, wavelength: be.Array = None
28+
) -> be.Array:
2729
"""Calculates the phase added by the profile at coordinates (x, y).
2830
2931
Args:
@@ -74,7 +76,9 @@ def get_gradient(
7476

7577
return d_phi_dx, d_phi_dy, d_phi_dz
7678

77-
def get_paraxial_gradient(self, y: be.Array, wavelength: be.Array = None) -> be.Array:
79+
def get_paraxial_gradient(
80+
self, y: be.Array, wavelength: be.Array = None
81+
) -> be.Array:
7882
"""Calculates the paraxial phase gradient at y-coordinate.
7983
8084
This is the gradient d_phi/dy evaluated at x=0.

0 commit comments

Comments
 (0)