Skip to content

Commit dd5995b

Browse files
docs: add more examples
1 parent da009de commit dd5995b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Diff for: src/diffpy/utils/diffraction_objects.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -540,11 +540,21 @@ def dump(self, filepath, xtype=None):
540540
541541
Examples
542542
--------
543-
To save a diffraction object to a file named "diffraction_data.chi" with
544-
the independent variable 'q':
543+
To save a diffraction object to a file named "diffraction_data.chi" in the current directory
544+
with the independent variable 'q':
545545
546546
>>> file = "diffraction_data.chi"
547547
>>> do.dump(file, xtype="q")
548+
549+
To save the diffraction data to a file in a subfolder `output`:
550+
551+
>>> file = "./output/diffraction_data.chi"
552+
>>> do.dump(file, xtype="q")
553+
554+
To save the diffraction data with a different independent variable, such as 'tth':
555+
556+
>>> file = "diffraction_data_tth.chi"
557+
>>> do.dump(file, xtype="tth")
548558
"""
549559
if xtype is None:
550560
xtype = "q"

0 commit comments

Comments
 (0)