Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC: add example to get_include #26489

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

Merged
merged 2 commits into from
May 21, 2024
Merged

Conversation

luxedo
Copy link
Contributor

@luxedo luxedo commented May 20, 2024

Add get_include examples for #22266

@luxedo
Copy link
Contributor Author

luxedo commented May 20, 2024

This test fails because of get_include doctests:

=====
numpy
=====

numpy.get_include
-----------------

File "venv/lib/python3.11/site-packages/numpy/__init__.py", line 104, in get_include
Failed example:
    np.get_include()
Expected:
    '/home/guido/.local/lib/python3.12/site-packages/numpy/core/include'
Got:
    '/home/circleci/repo/venv/lib/python3.11/site-packages/numpy/_core/include'


ERROR:  failed checking numpy

Exited with code exit status 1

I don't think that putting /home/circleci/repo/venv/lib/python3.11/site-packages/numpy/_core/include as the test output is a good solution. We could use # doctest: +SKIP. Is there any other alternative?

Examples
--------
>>> np.get_include()
'/home/guido/.local/lib/python3.12/site-packages/numpy/core/include'
Copy link
Contributor

Choose a reason for hiding this comment

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

There is # may vary, that might make sense here if the NumPy team wants this example. You can find plenty of examples of its usage in the source via git grep -E "may vary"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great tip! Thank you!

@mattip mattip merged commit ea02e84 into numpy:main May 21, 2024
65 checks passed
@mattip
Copy link
Member

mattip commented May 21, 2024

Thanks @luxedo. In the future, please add [skip actions][skip azp][skip cirrus] in doc PRs, see #26316

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants