Skip to content

Commit 0cb0a04

Browse files
committed
docs: fix the example of using DiffractionObject.get_array_index in the documentation
1 parent 7eb9f5c commit 0cb0a04

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

docs/source/examples/diffraction_objects_example.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ For example, attempting to add a diffraction object and a string will raise an e
180180

181181
.. code-block:: python
182182
183-
tth_ninety_index = diff_object1.get_array_index(90, xtype="tth")
183+
tth_ninety_index = diff_object1.get_array_index(xvalue=90, xtype="tth")
184184
intensity_at_ninety = diff_object1.on_tth()[1][tth_ninety_index]
185185
186186
If you do not specify an ``xtype``, it will default to the ``xtype`` used when creating the ``DiffractionObject``.
@@ -190,8 +190,8 @@ you can find its closest index for ``q=0.25`` by typing either of the following:
190190
.. code-block:: python
191191
192192
print(do._input_xtype) # remind ourselves which array was input. prints "q" in this case.
193-
index = do.get_array_index(0.25) # no xtype passed, defaults to do._input_xtype, or in this example, q
194-
index = do.get_array_index(0.25, xtype="q") # explicitly choose an xtype to specify a value
193+
index = do.get_array_index(xvalue=0.25) # no xtype passed, defaults to do._input_xtype, or in this example, q
194+
index = do.get_array_index(xvalue=0.25, xtype="q") # explicitly choose an xtype to specify a value
195195
196196
5. The ``dump`` function saves the diffraction data and relevant information to an xy format file with headers
197197
(widely used chi format used, for example, by Fit2D and diffpy. These files can be read by ``LoadData()``

news/fix-docs-example.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* No news added: Fix the example of using ``DiffractionObject.get_array_index`` in the documentation.
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

0 commit comments

Comments
 (0)