Skip to content

Commit 209a194

Browse files
committed
Add separate docstring for @Property methods
1 parent 1a2214f commit 209a194

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

src/diffpy/utils/diffraction_objects.py

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,6 @@ class DiffractionObject:
4646
4747
Attributes
4848
----------
49-
all_arrays : ndarray
50-
The array containing the quantity of q, tth, d values.
51-
input_xtype : str
52-
The type of the independent variable in `xarray`. Must be one of {*XQUANTITIES}
53-
_uuid : uuid
54-
The unique identifier for the diffraction object.
5549
scat_quantity : str
5650
The type of scattering experiment (e.g., "x-ray", "neutron"). Default is an empty string "".
5751
wavelength : float
@@ -284,6 +278,20 @@ def __rtruediv__(self, other):
284278

285279
@property
286280
def all_arrays(self):
281+
"""The array containing `xarray` values in q, d, tth, and `yarray`.
282+
283+
Returns
284+
-------
285+
ndarray
286+
The 2D matrix containing the `xarray` objects values and `yarray`.
287+
288+
Examples
289+
--------
290+
>>> my_do.all_arrays[:, 0] # yarray
291+
>>> my_do.all_arrays[:, 1] # `xarray` in q
292+
>>> my_do.all_arrays[:, 2] # `xarray` in tth
293+
>>> my_do.all_arrays[:, 3] # `xarray` in d
294+
"""
287295
return self._all_arrays
288296

289297
@all_arrays.setter
@@ -292,6 +300,13 @@ def all_arrays(self, _):
292300

293301
@property
294302
def input_xtype(self):
303+
"""The type of the independent variable in `xarray`.
304+
305+
Returns
306+
-------
307+
str
308+
The type of `xarray`, which must be one of {*XQUANTITIES}.
309+
"""
295310
return self._input_xtype
296311

297312
@input_xtype.setter
@@ -300,6 +315,13 @@ def input_xtype(self, _):
300315

301316
@property
302317
def uuid(self):
318+
"""The unique identifier for the DiffractionObject instance.
319+
320+
Returns
321+
-------
322+
uuid
323+
The unique identifier of the DiffractionObject instance.
324+
"""
303325
return self._uuid
304326

305327
@uuid.setter
@@ -319,7 +341,8 @@ def get_array_index(self, value, xtype=None):
319341
320342
Returns
321343
-------
322-
the index of the value in the array
344+
list
345+
The list containing the index of the closest value in the array.
323346
"""
324347

325348
xtype = self._input_xtype

0 commit comments

Comments
 (0)