FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs: fix the example of using `DiffractionObject.get_array_index` in the documentation by ycexiao · Pull Request #354 · diffpy/diffpy.utils · GitHub

Repository navigation

docs: fix the example of using DiffractionObject.get_array_index in the documentation - #354

Merged
sbillinge merged 4 commits into
diffpy:mainfrom
ycexiao:fix-docs-example
Jul 25, 2025
Merged

sbillinge merged 4 commits into
diffpy:mainfrom
ycexiao:fix-docs-example

Conversation

ycexiao commented Jul 24, 2025 •
edited
Loading

Copy link
Copy Markdown
Contributor

What problem does this PR address

Fix the examples as mentioned in #352

  • Failed example for DiffractionObject.get_array_index
  • Duplicate code block
  • Failed example for diffpy.utils.transform.d_to_tth
  • Markup not rendered correctlly

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

codecov Bot commented Jul 24, 2025 •
edited
Loading

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@7eb9f5c). Learn more about missing BASE report.
Report is 5 commits behind head on main.

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ycexiao marked this pull request as ready for review July 24, 2025 17:57

ycexiao commented Jul 24, 2025

Copy link
Copy Markdown
Contributor Author

@sbillinge, it's ready for review.

sbillinge left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

let's start by writing tests for get_array_index

ycexiao commented Jul 25, 2025

Copy link
Copy Markdown
Contributor Author

@sbillinge , this PR only fixes the documentation. I will handle the get_array_index source code in a separate PR.

sbillinge left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I will merge, but let's not forget to double check the docs for get_array_index

.. 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")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This will have to be fixed later when we finalize the signature. Let's just remember to do it....

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

same here.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL