Skip to content

Commit

Permalink
Add performance comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Schubert authored and Martin Schubert committed Mar 28, 2024
1 parent 20fafdb commit 62e5a1c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/imageruler/imageruler.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def minimum_length_scale(
Returns:
The detected minimum length scales `(length_scale_solid, length_scale_void)`.
"""
# Note that when the minimum of solid and void length scale is desired,
# a faster implementation involving comparison between binary opening and
# closing of designs is possible. This could improve performance by a factor
# of two or greater.
if x.ndim != 2:
raise ValueError(f"`x` must be 2-dimensional, but got shape {x.shape}.")
if not isinstance(x, onp.ndarray):
Expand Down

0 comments on commit 62e5a1c

Please sign in to comment.