@@ -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- id : 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
@@ -127,7 +121,7 @@ def __init__(
127121 >>> print(do.metadata)
128122 """
129123
130- self ._id = uuid .uuid4 ()
124+ self ._uuid = uuid .uuid4 ()
131125 self ._input_data (xarray , yarray , xtype , wavelength , scat_quantity , name , metadata )
132126
133127 def _input_data (self , xarray , yarray , xtype , wavelength , scat_quantity , name , metadata ):
@@ -284,6 +278,23 @@ def __rtruediv__(self, other):
284278
285279 @property
286280 def all_arrays (self ):
281+ """The 2D array containing `xarray` and `yarray` values.
282+
283+ Returns
284+ -------
285+ ndarray
286+ The shape (len(data), 4) 2D array with columns containing the `yarray` (intensity)
287+ and the `xarray` values in q, tth, and d.
288+
289+ Examples
290+ --------
291+ To access specific arrays individually, use these slices:
292+
293+ >>> my_do.all_arrays[:, 0] # yarray
294+ >>> my_do.all_arrays[:, 1] # xarray in q
295+ >>> my_do.all_arrays[:, 2] # xarray in tth
296+ >>> my_do.all_arrays[:, 3] # xarray in d
297+ """
287298 return self ._all_arrays
288299
289300 @all_arrays .setter
@@ -292,19 +303,33 @@ def all_arrays(self, _):
292303
293304 @property
294305 def input_xtype (self ):
306+ """The type of the independent variable in `xarray`.
307+
308+ Returns
309+ -------
310+ str
311+ The type of `xarray`, which must be one of {*XQUANTITIES}.
312+ """
295313 return self ._input_xtype
296314
297315 @input_xtype .setter
298316 def input_xtype (self , _ ):
299317 raise AttributeError (_setter_wmsg ("input_xtype" ))
300318
301319 @property
302- def id (self ):
303- return self ._id
320+ def uuid (self ):
321+ """The unique identifier for the DiffractionObject instance.
322+
323+ Returns
324+ -------
325+ uuid
326+ The unique identifier of the DiffractionObject instance.
327+ """
328+ return self ._uuid
304329
305- @id .setter
306- def id (self , _ ):
307- raise AttributeError (_setter_wmsg ("id " ))
330+ @uuid .setter
331+ def uuid (self , _ ):
332+ raise AttributeError (_setter_wmsg ("uuid " ))
308333
309334 def get_array_index (self , value , xtype = None ):
310335 """Return the index of the closest value in the array associated with
@@ -319,7 +344,8 @@ def get_array_index(self, value, xtype=None):
319344
320345 Returns
321346 -------
322- the index of the value in the array
347+ list
348+ The list containing the index of the closest value in the array.
323349 """
324350
325351 xtype = self ._input_xtype
0 commit comments