Skip to content

Commit 5d0ebcc

Browse files
committed
Add example to __eq__
1 parent 3d4841b commit 5d0ebcc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/diffpy/utils/diffraction_objects.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,16 @@ def __add__(self, other):
196196
Raised when the length of the xarrays of the two DiffractionObject instances do not match.
197197
TypeError
198198
Raised when the type of `other` is not an instance of DiffractionObject, int, or float.
199+
200+
Examples
201+
--------
202+
Add a scalar value to the xarrays of the DiffractionObject instance:
203+
>>> new_do = my_do + 10.1
204+
205+
Add the xarrays of two DiffractionObject instances:
206+
>>> new_do = my_do_1 + my_do_2
199207
"""
208+
200209
summed_do = deepcopy(self)
201210
# Add scalar value to all xarrays by broadcasting
202211
if isinstance(other, (int, float)):

0 commit comments

Comments
 (0)