Skip to content

Commit

Permalink
added 'check' in matching
Browse files Browse the repository at this point in the history
  • Loading branch information
lfarv committed Jan 11, 2025
1 parent ad97362 commit 1dd1599
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions pyat/at/latticetools/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pyat/at/latticetools/observables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 1dd1599

Please sign in to comment.