Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/diffpy/utils/diffraction_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def on_q(self):

Returns
-------
(xarray, yarray) : tuple of ndarray
(q-array, y-array) : tuple of ndarray
The tuple containing two 1D numpy arrays with q and y data
"""
return [self.all_arrays[:, 1], self.all_arrays[:, 0]]
Expand All @@ -432,7 +432,7 @@ def on_tth(self):

Returns
-------
(xarray, yarray) : tuple of ndarray
(tth-array, y-array) : tuple of ndarray
The tuple containing two 1D numpy arrays with tth and y data
"""
return [self.all_arrays[:, 2], self.all_arrays[:, 0]]
Expand All @@ -442,7 +442,7 @@ def on_d(self):

Returns
-------
(xarray, yarray) : tuple of ndarray
(d-array, y-array) : tuple of ndarray
The tuple containing two 1D numpy arrays with d and y data
"""
return [self.all_arrays[:, 3], self.all_arrays[:, 0]]
Expand Down Expand Up @@ -537,6 +537,14 @@ def dump(self, filepath, xtype=None):
The filepath where the diffraction object will be dumped
xtype : str, optional, default is q
The type of quantity for the independent variable chosen from {*XQUANTITIES, }

Examples
--------
To save a diffraction object to a file named "diffraction_data.chi" with
the independent variable 'q':

>>> file = "diffraction_data.chi"
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's also have another example, that shows a relative path. I think that should then be clear enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds great! I'll add that.

>>> do.dump(file, xtype="q")
"""
if xtype is None:
xtype = "q"
Expand Down
Loading