Skip to content

Commit 1b2eda8

Browse files
committed
use intersphinx crossrefs to numpy reference docs
Signed-off-by: oleg.hoefling <[email protected]>
1 parent ad1e856 commit 1b2eda8

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

‎hypothesis-python/docs/changes.rst‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ to :pep:`646` is released, hopefully in Python 3.11.
366366
--------------------
367367

368368
This patch teaches :doc:`the Ghostwriter <ghostwriter>` how to find
369-
:np-ref:`custom ufuncs <ufuncs.html>` from *any* module that defines them,
369+
:doc:`custom ufuncs <numpy:reference/ufuncs>` from *any* module that defines them,
370370
and that ``yaml.unsafe_load()`` does not undo ``yaml.safe_load()``.
371371

372372
.. _v6.13.12:
@@ -1685,8 +1685,8 @@ Thanks to Zac Hatfield-Dodds and Nikita Sobolev for this feature!
16851685

16861686
This patch adds two new :doc:`ghostwriters <ghostwriter>` to test
16871687
:wikipedia:`binary operations <Binary_operation>`, like :func:`python:operator.add`,
1688-
and Numpy :np-ref:`ufuncs <ufuncs.html>` and :np-ref:`gufuncs
1689-
<c-api/generalized-ufuncs.html>` like :obj:`np.matmul() <numpy:numpy.matmul>`.
1688+
and Numpy :doc:`ufuncs <reference/ufuncs>` and :doc:`gufuncs
1689+
<numpy:reference/c-api/generalized-ufuncs>` like :data:`np.matmul() <numpy:numpy.matmul>`.
16901690

16911691
.. _v5.26.1:
16921692

@@ -3330,7 +3330,7 @@ a ``__file__``, such as a :mod:`python:zipapp` (:issue:`2196`).
33303330
This release adds a ``signature`` argument to
33313331
:func:`~hypothesis.extra.numpy.mutually_broadcastable_shapes` (:issue:`2174`),
33323332
which allows us to generate shapes which are valid for functions like
3333-
:obj:`numpy:numpy.matmul` that require shapes which are not simply broadcastable.
3333+
:data:`np.matmul() <numpy:numpy.matmul>` that require shapes which are not simply broadcastable.
33343334

33353335
Thanks to everyone who has contributed to this feature over the last year,
33363336
and a particular shout-out to Zac Hatfield-Dodds and Ryan Soklaski for
@@ -8319,7 +8319,7 @@ unnoticeable. Previously it was large and became much larger in :ref:`3.30.4 <v3
83198319
-------------------
83208320

83218321
:func:`~hypothesis.strategies.from_type` failed with a very confusing error
8322-
if passed a :func:`~python:typing.NewType` (:issue:`901`). These psudeo-types
8322+
if passed a :obj:`~typing.NewType` (:issue:`901`). These pseudo-types
83238323
are now unwrapped correctly, and strategy inference works as expected.
83248324

83258325
.. _v3.31.3:

‎hypothesis-python/docs/conf.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ def setup(app):
114114
"pull": (_repo + "pull/%s", "pull request #"),
115115
"pypi": ("https://pypi.org/project/%s/", ""),
116116
"bpo": ("https://bugs.python.org/issue%s", "bpo-"),
117-
"np-ref": ("https://numpy.org/doc/stable/reference/%s", ""),
118117
"xp-ref": ("https://data-apis.org/array-api/latest/API_specification/%s", ""),
119118
"wikipedia": ("https://en.wikipedia.org/wiki/%s", ""),
120119
}

‎hypothesis-python/src/hypothesis/extra/ghostwriter.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,10 +1292,10 @@ def maker(
12921292

12931293

12941294
def ufunc(func: Callable, *, except_: Except = (), style: str = "pytest") -> str:
1295-
"""Write a property-based test for the :np-ref:`array unfunc <ufuncs.html>` ``func``.
1295+
"""Write a property-based test for the :doc:`array ufunc <numpy:reference/ufuncs>` ``func``.
12961296
1297-
The resulting test checks that your ufunc or :np-ref:`gufunc
1298-
<c-api/generalized-ufuncs.html>` has the expected broadcasting and dtype casting
1297+
The resulting test checks that your ufunc or :doc:`gufunc
1298+
<numpy:reference/c-api/generalized-ufuncs>` has the expected broadcasting and dtype casting
12991299
behaviour. You will probably want to add extra assertions, but as with the other
13001300
ghostwriters this gives you a great place to start.
13011301

‎hypothesis-python/src/hypothesis/extra/numpy.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -747,12 +747,13 @@ def mutually_broadcastable_shapes(*args, **kwargs):
747747
748748
**Use with Generalised Universal Function signatures**
749749
750-
A :np-ref:`universal function <ufuncs.html>` (or ufunc for short) is a function
750+
A :doc:`universal function <numpy:reference/ufuncs>` (or ufunc for short) is a function
751751
that operates on ndarrays in an element-by-element fashion, supporting array
752752
broadcasting, type casting, and several other standard features.
753-
A :np-ref:`generalised ufunc <c-api/generalized-ufuncs.html>` operates on
753+
A :doc:`generalised ufunc <numpy:reference/c-api/generalized-ufuncs>` operates on
754754
sub-arrays rather than elements, based on the "signature" of the function.
755-
Compare e.g. :obj:`numpy:numpy.add` (ufunc) to :obj:`numpy:numpy.matmul` (gufunc).
755+
Compare e.g. :obj:`numpy.add() <numpy:numpy.add>` (ufunc) to
756+
:obj:`numpy.matmul() <numpy:numpy.matmul>` (gufunc).
756757
757758
To generate shapes for a gufunc, you can pass the ``signature`` argument instead of
758759
``num_shapes``. This must be a gufunc signature string; which you can write by
@@ -791,7 +792,7 @@ def basic_indices(
791792
allow_newaxis: bool = False,
792793
allow_ellipsis: bool = True,
793794
) -> st.SearchStrategy[BasicIndex]:
794-
"""Return a strategy for :np-ref:`basic indexes <arrays.indexing.html>` of
795+
"""Return a strategy for :doc:`basic indexes <numpy:reference/arrays.indexing>` of
795796
arrays with the specified shape, which may include dimensions of size zero.
796797
797798
It generates tuples containing some mix of integers, :obj:`python:slice`

0 commit comments

Comments
 (0)