From eda69722fff6ed8977a5052683a1779f5ca71ec7 Mon Sep 17 00:00:00 2001 From: Gregory Roberts Date: Tue, 14 Jan 2025 16:17:20 -0500 Subject: [PATCH] feat[frontend]: add angle validator to specify expected angle in radians --- tidy3d/components/geometry/base.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tidy3d/components/geometry/base.py b/tidy3d/components/geometry/base.py index 03470736d1..f3a480d413 100644 --- a/tidy3d/components/geometry/base.py +++ b/tidy3d/components/geometry/base.py @@ -1696,8 +1696,6 @@ class Planar(SimplePlaneIntersection, Geometry, ABC): "along the ``axis`` direction; " "and ``-np.pi/2 float: + lower_bound = -np.pi / 2 + upper_bound = np.pi / 2 + if (value <= lower_bound) or (value >= upper_bound): + # u03C0 is unicode for pi + raise ValidationError( + f"Sidewall angle ({value}) must be between -\u03c0/2 and \u03c0/2 rad." + ) + + return value + @property @abstractmethod def center_axis(self) -> float: