Skip to content

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

Merged
merged 7 commits into from
Dec 7, 2024
Merged

d_to_q, q_to_d #197

merged 7 commits into from
Dec 7, 2024

Conversation

yucongalicechen
Copy link
Contributor

closes #176
@sbillinge ready for review

Copy link
Contributor

@sbillinge sbillinge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see comments

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete, as discussed.

The array of :math:`d` values np.array([ds]).
"""
if 0 in q:
raise ValueError(invalid_input_emsg)
Copy link
Contributor

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?

@yucongalicechen
Copy link
Contributor Author

@sbillinge updated. please review again.

Copy link

codecov bot commented Dec 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.17%. Comparing base (ed9fb03) to head (39f1c54).
Report is 18 commits behind head on main.

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     
Files with missing lines Coverage Δ
tests/test_transforms.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

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."
Copy link
Contributor

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 ?

Copy link
Contributor

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....

@sbillinge sbillinge merged commit e6827a6 into diffpy:main Dec 7, 2024
4 of 5 checks passed
@yucongalicechen yucongalicechen deleted the qd branch December 7, 2024 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

diffraction objects implement d_to_q, q_to_d
3 participants