From 1dd15992f4b319a322e2c59c916c6e0e20d66be8 Mon Sep 17 00:00:00 2001 From: Laurent Farvacque Date: Sat, 11 Jan 2025 21:51:05 +0100 Subject: [PATCH] added 'check' in matching --- pyat/at/latticetools/matching.py | 1 + pyat/at/latticetools/observables.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pyat/at/latticetools/matching.py b/pyat/at/latticetools/matching.py index a0621d584..04b10852e 100644 --- a/pyat/at/latticetools/matching.py +++ b/pyat/at/latticetools/matching.py @@ -36,6 +36,7 @@ def fun(vals): bounds = np.array([var.bounds for var in variables]) constraints.evaluate(ring, initial=True, dp=dp, dct=dct, df=df) + constraints.check() ntargets = constraints.flat_values.size if method is None: diff --git a/pyat/at/latticetools/observables.py b/pyat/at/latticetools/observables.py index a87bc2dc5..bbc8feb15 100644 --- a/pyat/at/latticetools/observables.py +++ b/pyat/at/latticetools/observables.py @@ -527,7 +527,7 @@ def check(self): ok = super().check() shp = self._shape if ok and shp and shp[0] <= 0: - raise AtError(f"{self.name}: No location selected in the lattice.") + raise AtError(f"Observable {self.name!r}: No location selected in the lattice.") return ok def _all_lines(self):