Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG diffract.forward does not return a list #343

Closed
prjemian opened this issue Nov 12, 2024 · 3 comments · Fixed by #346
Closed

BUG diffract.forward does not return a list #343

prjemian opened this issue Nov 12, 2024 · 3 comments · Fixed by #346
Assignees
Milestone

Comments

@prjemian
Copy link
Contributor

prjemian commented Nov 12, 2024

In demo notebook https://blueskyproject.io/hklpy/examples/notebooks/geo_e4cv.html,
image

That's not a list. After the forward() computation, the list is available: diffract.calc.engine.solutions.

@apsIEX, @hao247 Thanks for the report.

@prjemian prjemian self-assigned this Jan 31, 2025
@prjemian prjemian added this to the v1.1.2 milestone Jan 31, 2025
@prjemian prjemian changed the title BUG diffract.calc.forward does not return a list BUG diffract.forward does not return a list Jan 31, 2025
@prjemian
Copy link
Contributor Author

Note the difference between fourc.forward() (the default position solution) and fourc.calc.forward() (the list of possible position solutions).

@prjemian
Copy link
Contributor Author

hklpy/hkl/diffract.py

Lines 308 to 312 in 9206e67

if decision_fcn is None:
# the default decision function is to just grab solution #1:
decision_fcn = calc.default_decision_function
self._decision_fcn = decision_fcn

hklpy/hkl/calc.py

Lines 82 to 84 in 9206e67

def default_decision_function(position, solutions):
"""The default decision function - returns the first solution."""
return solutions[0]

@prjemian
Copy link
Contributor Author

As written, the notebook is correct, but the initial report does not show the full table. Here's the larger context:

Image

The notebook could state clearly which of the two methods will be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant