Skip to content

Commit

Permalink
Add option to control iteration resolution for get_min_sbend_size
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdorch committed May 21, 2023
1 parent cc4d4c6 commit db5a802
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gdsfactory/components/bend_s.py
Expand Up @@ -65,6 +65,7 @@ def bend_s(
def get_min_sbend_size(
size: Float2 = (None, 10.0),
cross_section: CrossSectionSpec = "strip",
num_points: int = 100,
**kwargs,
):
"""
Expand All @@ -73,6 +74,7 @@ def get_min_sbend_size(
Args:
size: in x and y direction. One of them is None, which is the size we need to figure out.
cross_section: spec.
num_points: number of points to iterate over between max_size and 0.1 * max_size
kwargs: cross_section settings.
"""
Expand All @@ -99,7 +101,7 @@ def get_min_sbend_size(
# the max size corresponds to an ellipsoid
max_size = 2.5 * np.sqrt(np.abs(min_radius * known_s))

sizes = np.linspace(max_size, 0.1 * max_size, 100)
sizes = np.linspace(max_size, 0.1 * max_size, num_points)

for i, s in enumerate(sizes):
sz = copy.deepcopy(size)
Expand Down

0 comments on commit db5a802

Please sign in to comment.