-
Notifications
You must be signed in to change notification settings - Fork 21
Add copy()
method for DiffractionObject
#204
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
Conversation
tests/test_diffraction_objects.py
Outdated
xtype="tth", | ||
) | ||
copy_of_DO = do.copy() | ||
assert do == copy_of_DO |
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.
Utilzing the object's __eq__
nice implementation
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.
To complete this test also assert id(actual) != Id(initial)
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.
Then the copy is not pointing to the same object
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.
yes done below.
@sbillinge ready for review |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #204 +/- ##
==========================================
+ Coverage 96.49% 96.54% +0.05%
==========================================
Files 8 8
Lines 342 347 +5
==========================================
+ Hits 330 335 +5
Misses 12 12
|
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.
Pls see inline
tests/test_diffraction_objects.py
Outdated
xtype="tth", | ||
) | ||
copy_of_DO = do.copy() | ||
assert do == copy_of_DO |
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.
To complete this test also assert id(actual) != Id(initial)
tests/test_diffraction_objects.py
Outdated
xtype="tth", | ||
) | ||
copy_of_DO = do.copy() | ||
assert do == copy_of_DO |
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.
Then the copy is not pointing to the same object
@sbillinge Right! Thank you. Additional test added. |
@sbillinge ready for review - just enhanced the variable name from |
@bobleesj not sure why codecov is complaining here...diffpy has a global org secret token. Maybe it is being flaky. I will just try and rerun it? after than an empty commit? |
![]() Codecov looks okay to me in fact 0.05% has gone up! @sbillinge |
it failed to upload so failed. I reran it and it uploaded and passed..... CC is officially flaky.... |
Closes #201 - add
copy()
forDiffracitonObject