-
Notifications
You must be signed in to change notification settings - Fork 21
docs: fix the example of using DiffractionObject.get_array_index
in the documentation
#354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… the documentation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #354 +/- ##
========================================
Coverage ? 100.00%
========================================
Files ? 9
Lines ? 516
Branches ? 0
========================================
Hits ? 516
Misses ? 0
Partials ? 0 🚀 New features to boost your workflow:
|
@sbillinge, it's ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's start by writing tests for get_array_index
@sbillinge , this PR only fixes the documentation. I will handle the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will merge, but let's not forget to double check the docs for get_array_index
@@ -180,7 +180,7 @@ For example, attempting to add a diffraction object and a string will raise an e | |||
|
|||
.. code-block:: python | |||
|
|||
tth_ninety_index = diff_object1.get_array_index(90, xtype="tth") | |||
tth_ninety_index = diff_object1.get_array_index(xvalue=90, xtype="tth") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will have to be fixed later when we finalize the signature. Let's just remember to do it....
@@ -190,8 +190,8 @@ you can find its closest index for ``q=0.25`` by typing either of the following: | |||
.. code-block:: python | |||
|
|||
print(do._input_xtype) # remind ourselves which array was input. prints "q" in this case. | |||
index = do.get_array_index(0.25) # no xtype passed, defaults to do._input_xtype, or in this example, q | |||
index = do.get_array_index(0.25, xtype="q") # explicitly choose an xtype to specify a value | |||
index = do.get_array_index(xvalue=0.25) # no xtype passed, defaults to do._input_xtype, or in this example, q |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
What problem does this PR address
Fix the examples as mentioned in #352
DiffractionObject.get_array_index
diffpy.utils.transform.d_to_tth
Fix the documentation examples.
What should reviewer(s) do
Please check the modified documentation.
example for

DiffractionObject.get_array_index
Duplicate code block is removed

Markup is now rendered correctly
