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

DiffractionObject can now be instantiated directly #193

Merged
merged 3 commits into from
Dec 4, 2024

Conversation

sbillinge
Copy link
Contributor

closes #185
closes #181
closes #177

and basic data structure is a 2D array with everything in it

xarray = np.empty(0)
if yarray is None:
yarray = np.empty(0)
self.insert_scattering_quantity(
Copy link
Contributor

Choose a reason for hiding this comment

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

nice re-use of insert_scattering_quantity

self.name = name
self.wavelength = wavelength
self.all_arrays = np.empty(shape=(len(yarray), 4))
self.all_arrays[:, 0] = yarray
Copy link
Contributor

Choose a reason for hiding this comment

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

This is much much easier to read now!

"scat_quantity": "x-ray",
"wavelength": 0.71,
"xtype": "q",
"xarray": np.array([1.0, 2.0]),
Copy link
Contributor

Choose a reason for hiding this comment

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

Much nicer tests..

@bobleesj
Copy link
Contributor

bobleesj commented Dec 4, 2024

@sbillinge Also passes locally now. Just checked out your branch.

@sbillinge
Copy link
Contributor Author

thank for the review @bobleesj . I will merge this now so the team can push on.....

@sbillinge sbillinge merged commit ed9fb03 into diffpy:main Dec 4, 2024
3 checks passed
@sbillinge sbillinge deleted the constructor branch December 4, 2024 13:42
Copy link

codecov bot commented Dec 4, 2024

Codecov Report

Attention: Patch coverage is 92.50000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 96.53%. Comparing base (fdbefb3) to head (daa9c3f).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
tests/test_diffraction_objects.py 92.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #193      +/-   ##
==========================================
- Coverage   97.31%   96.53%   -0.78%     
==========================================
  Files           8        8              
  Lines         261      289      +28     
==========================================
+ Hits          254      279      +25     
- Misses          7       10       +3     
Files with missing lines Coverage Δ
tests/test_transforms.py 100.00% <ø> (ø)
tests/test_diffraction_objects.py 86.56% <92.50%> (+1.95%) ⬆️

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