From e271223c86b2443bb789f87d59df3d7cc9a7d36e Mon Sep 17 00:00:00 2001 From: John Lapeyre Date: Wed, 6 Aug 2025 12:04:56 -0400 Subject: [PATCH] Convert epsilon to mpf on constructing EpsilonRegion This allow the caller of the functions gridsynth and gridsynth_gates to pass epsilon of type `float`, rather than requiring an mpf. One expects that epsilon may be a `float`. This will help avoid bugs due to this expectation. --- pygridsynth/gridsynth.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pygridsynth/gridsynth.py b/pygridsynth/gridsynth.py index 8ea87d5..53e3841 100644 --- a/pygridsynth/gridsynth.py +++ b/pygridsynth/gridsynth.py @@ -13,6 +13,7 @@ class EpsilonRegion(ConvexSet): def __init__(self, theta, epsilon): + epsilon = mpmath.mpf(epsilon) self._theta = theta self._epsilon = epsilon self._d = 1 - epsilon ** 2 / 2