-
Notifications
You must be signed in to change notification settings - Fork 21
d_to_q, q_to_d #197
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
d_to_q, q_to_d #197
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please see comments
src/diffpy/utils/transforms.py
Outdated
The units for the q-values are the inverse of the units of the provided wavelength. | ||
This is the correct format for loading into diffpy.utils.DiffractionOject.on_q | ||
This is the correct format for loading into diffpy.utils.DiffractionObject.on_q. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete, as discussed.
src/diffpy/utils/transforms.py
Outdated
The array of :math:`d` values np.array([ds]). | ||
""" | ||
if 0 in q: | ||
raise ValueError(invalid_input_emsg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just make this np.inf
but also give a warning message that the largest d is infinite and can't be plotted? Something like that?
@sbillinge updated. please review again. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #197 +/- ##
==========================================
- Coverage 96.53% 94.17% -2.37%
==========================================
Files 8 8
Lines 289 309 +20
==========================================
+ Hits 279 291 +12
- Misses 10 18 +8
|
src/diffpy/utils/transforms.py
Outdated
invalid_input_emsg = ( | ||
"Input values have resulted in an infinite output. Please ensure there are no zeros in the input." | ||
) | ||
inf_output_msg = "WARNING: The largest output is infinite and cannot be plotted." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbillinge out of curiosity,
for both error and warning messages, do we still want to maintain our convention of 1) reason for error, (2) what to do to fix it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tweaked this a bit and downgraded it to an INFO from a WARNING....don't want users to freak out....
closes #176
@sbillinge ready for review