Skip to content

Commit

Permalink
MNT #303 try the simpler solution first
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Dec 19, 2023
1 parent 914cea8 commit 217f767
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions hkl/diffract.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,12 @@ def forward(self, pseudo):
Return the default solution using the ``_decision_fcn()``.
"""
solutions = self.calc.forward_iter(
start=self.position, end=pseudo, max_iters=self.max_forward_iterations.get()
)
try:
solutions = self.calc.forward(list(pseudo))
except ValueError:
solutions = self.calc.forward_iter(
start=self.position, end=pseudo, max_iters=self.max_forward_iterations.get()
)
logger.debug("pseudo to real: %s", solutions)
return self._decision_fcn(pseudo, solutions)

Expand Down

0 comments on commit 217f767

Please sign in to comment.