Skip to content

Commit 3be4091

Browse files
committed
DOC: Change NEP hardlinks to intersphinx mappings.
This pull request changes most explicit URL links to NEPs from NEPs to be intersphinx mappings. I believe this will complete my work on changes to address numpy#26707 except as needed to address review comments. [skip actions] [skip azp] [skip cirrus]
1 parent 735a477 commit 3be4091

8 files changed

+24
-31
lines changed

doc/neps/content.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ Roadmap
1616
Index <index>
1717
The Scope of NumPy <scope>
1818
Current roadmap <roadmap>
19-
Wishlist (opens new window) |wishlist_link|
19+
Wish list <https://github.com/numpy/numpy/issues?q=is%3Aopen+is%3Aissue+label%3A%2223+-+Wish+List%22>
2020

21-
.. |wishlist_link| raw:: html
22-
23-
<a href="https://github.com/numpy/numpy/issues?q=is%3Aopen+is%3Aissue+label%3A%2223+-+Wish+List%22" target=" blank">WishList</a>
2421

2522

doc/neps/nep-0018-array-function-protocol.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ The type of ``types`` is intentionally vague:
141141
instead for performance reasons. In any case, ``__array_function__``
142142
implementations should not rely on the iteration order of ``types``, which
143143
would violate a well-defined "Type casting hierarchy" (as described in
144-
`NEP-13 <https://www.numpy.org/neps/nep-0013-ufunc-overrides.html>`_).
144+
:ref:`NEP-13 <NEP13>`).
145145

146146
Example for a project implementing the NumPy API
147147
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -300,7 +300,7 @@ are valid then which has precedence?
300300

301301
For the most part, the rules for dispatch with ``__array_function__``
302302
match those for ``__array_ufunc__`` (see
303-
`NEP-13 <https://www.numpy.org/neps/nep-0013-ufunc-overrides.html>`_).
303+
:ref:`NEP-13 <NEP13>`).
304304
In particular:
305305

306306
- NumPy will gather implementations of ``__array_function__`` from all
@@ -819,7 +819,7 @@ don't think it makes sense to do so now, because code generation involves
819819
tradeoffs and NumPy's experience with type annotations is still
820820
`quite limited <https://github.com/numpy/numpy-stubs>`_. Even if NumPy
821821
was Python 3 only (which will happen
822-
`sometime in 2019 <http://www.numpy.org/neps/nep-0014-dropping-python2.7-proposal.html>`_),
822+
:ref:`sometime in 2019 <NEP14>`),
823823
we aren't ready to annotate NumPy's codebase directly yet.
824824

825825
Support for implementation-specific arguments

doc/neps/nep-0030-duck-array-protocol.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ Previous proposals and discussion
176176
---------------------------------
177177

178178
The duck typing protocol proposed here was described in a high level in
179-
`NEP 22 <https://numpy.org/neps/nep-0022-ndarray-duck-typing-overview.html>`_.
179+
:ref:`NEP 22 <NEP22>`.
180180

181181
Additionally, longer discussions about the protocol and related proposals
182182
took place in

doc/neps/nep-0031-uarray.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ It has been formally realized (at least in part) that a backend system is
319319
needed for this, in the `NumPy roadmap <https://numpy.org/neps/roadmap.html#other-functionality>`_.
320320

321321
For ``numpy.random``, it's still necessary to make the C-API fit the one
322-
proposed in `NEP-19 <https://numpy.org/neps/nep-0019-rng-policy.html>`_.
322+
proposed in :ref:`NEP-19 <NEP19>`.
323323
This is impossible for `mkl-random`, because then it would need to be
324324
rewritten to fit that framework. The guarantees on stream
325325
compatibility will be the same as before, but if there's a backend that affects
@@ -620,8 +620,8 @@ Discussion
620620
----------
621621

622622
* ``uarray`` blogpost: https://labs.quansight.org/blog/2019/07/uarray-update-api-changes-overhead-and-comparison-to-__array_function__/
623-
* The discussion section of NEP-18: https://numpy.org/neps/nep-0018-array-function-protocol.html#discussion
624-
* NEP-22: https://numpy.org/neps/nep-0022-ndarray-duck-typing-overview.html
623+
* The discussion section of :ref:`NEP18`
624+
* :ref:`NEP22`
625625
* Dask issue #4462: https://github.com/dask/dask/issues/4462
626626
* PR #13046: https://github.com/numpy/numpy/pull/13046
627627
* Dask issue #4883: https://github.com/dask/dask/issues/4883
@@ -636,11 +636,11 @@ References and footnotes
636636

637637
.. [1] uarray, A general dispatch mechanism for Python: https://uarray.readthedocs.io
638638
639-
.. [2] NEP 18 — A dispatch mechanism for NumPy’s high level array functions: https://numpy.org/neps/nep-0018-array-function-protocol.html
639+
.. [2] :ref:`NEP18`
640640
641-
.. [3] NEP 22 — Duck typing for NumPy arrays – high level overview: https://numpy.org/neps/nep-0022-ndarray-duck-typing-overview.html
641+
.. [3] :ref:`NEP22`
642642
643-
.. [4] NEP 13 — A Mechanism for Overriding Ufuncs: https://numpy.org/neps/nep-0013-ufunc-overrides.html
643+
.. [4] :ref:`NEP13`
644644
645645
.. [5] Reply to Adding to the non-dispatched implementation of NumPy methods: https://mail.python.org/archives/list/[email protected]/thread/5GUDMALWDIRHITG5YUOCV343J66QSX3U/#5GUDMALWDIRHITG5YUOCV343J66QSX3U
646646
@@ -650,7 +650,7 @@ References and footnotes
650650
651651
.. [8] unumpy: NumPy, but implementation-independent: https://unumpy.readthedocs.io
652652
653-
.. [9] NEP 30 — Duck Typing for NumPy Arrays - Implementation: https://www.numpy.org/neps/nep-0030-duck-array-protocol.html
653+
.. [9] :ref:`NEP30`
654654
655655
.. [10] http://scipy.github.io/devdocs/fft.html#backend-control
656656

doc/neps/nep-0035-array-creation-dispatch-with-array-function.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,17 +430,17 @@ Discussion
430430
References
431431
----------
432432

433-
.. [1] `NEP 18 - A dispatch mechanism for NumPy's high level array functions <https://numpy.org/neps/nep-0018-array-function-protocol.html>`_.
433+
.. [1] :ref:`NEP18`.
434434
435435
.. [2] `PEP 3102 — Keyword-Only Arguments <https://www.python.org/dev/peps/pep-3102/>`_.
436436
437-
.. [3] `NEP 30 — Duck Typing for NumPy Arrays - Implementation <https://numpy.org/neps/nep-0030-duck-array-protocol.html>`_.
437+
.. [3] :ref:`NEP30`.
438438
439-
.. [4] `NEP 31 — Context-local and global overrides of the NumPy API <https://github.com/numpy/numpy/pull/14389>`_.
439+
.. [4] :ref:`NEP31`.
440440
441441
.. [5] `Array creation routines <https://docs.scipy.org/doc/numpy-1.17.0/reference/routines.array-creation.html>`_.
442442
443-
.. [6] `NEP 37 — A dispatch protocol for NumPy-like modules <https://numpy.org/neps/nep-0037-array-module.html>`_.
443+
.. [6] :ref:`NEP37`.
444444
445445
.. [7] `Implementation's pull request on GitHub <https://github.com/numpy/numpy/pull/16935>`_
446446

doc/neps/nep-0036-fair-play.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,8 @@ Fair play rules
121121

122122
4. *DO* use official mechanism to engage with the API.
123123

124-
Protocols such as `__array_ufunc__
125-
<https://numpy.org/neps/nep-0013-ufunc-overrides.html>`__ and
126-
`__array_function__
127-
<https://numpy.org/neps/nep-0018-array-function-protocol.html>`__
124+
Protocols such as :ref:`__array_ufunc__ <NEP13>` and
125+
:ref:`__array_function__ <NEP18>`
128126
were designed to help external packages interact more easily with
129127
NumPy. E.g., the latter allows objects from foreign libraries to
130128
pass through NumPy. We actively encourage using any of

doc/neps/nep-0037-array-module.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ expect will make it easier to adopt.
2929
Why ``__array_function__`` hasn't been enough
3030
---------------------------------------------
3131

32-
There are two broad ways in which NEP-18 has fallen short of its goals:
32+
There are two broad ways in which :ref:`NEP-18 <NEP18>` has fallen short of its goals:
3333

3434
1. **Backwards compatibility concerns**. `__array_function__` has significant
3535
implications for libraries that use it:
@@ -64,16 +64,15 @@ There are two broad ways in which NEP-18 has fallen short of its goals:
6464

6565
- **Array creation** routines (e.g., ``np.arange`` and those in
6666
``np.random``) need some other mechanism for indicating what type of
67-
arrays to create. `NEP 35 <https://numpy.org/neps/nep-0035-array-creation-dispatch-with-array-function.html>`_
67+
arrays to create. :ref:`NEP 35 <NEP35>`
6868
proposed adding optional ``like=`` arguments to functions without
6969
existing array arguments. However, we still lack any mechanism to
7070
override methods on objects, such as those needed by
7171
``np.random.RandomState``.
7272
- **Array conversion** can't reuse the existing coercion functions like
7373
``np.asarray``, because ``np.asarray`` sometimes means "convert to an
7474
exact ``np.ndarray``" and other times means "convert to something _like_
75-
a NumPy array." This led to the `NEP 30
76-
<https://numpy.org/neps/nep-0030-duck-array-protocol.html>`_ proposal for
75+
a NumPy array." This led to the :ref:`NEP 30 <NEP30>` proposal for
7776
a separate ``np.duckarray`` function, but this still does not resolve how
7877
to cast one duck array into a type matching another duck array.
7978

@@ -144,8 +143,8 @@ we can simply pull out the appropriate submodule:
144143
noise = module.random.randn(*array.shape)
145144
return array + noise
146145
147-
We can also write the duck-array ``stack`` function from `NEP 30
148-
<https://numpy.org/neps/nep-0030-duck-array-protocol.html>`_, without the need
146+
We can also write the duck-array ``stack`` function from
147+
:ref:`NEP 30 <NEP30>`, without the need
149148
for a new ``np.duckarray`` function:
150149

151150
.. code:: python

doc/neps/nep-0054-simd-cpp-highway.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Abstract
1717
We are moving the SIMD intrinsic framework, Universal Intrinsics, from C to
1818
C++. We have also moved to Meson as the build system. The Google Highway
1919
intrinsics project is proposing we use Highway instead of our Universal
20-
Intrinsics as described in `NEP 38`_. This is a complex and multi-faceted
20+
Intrinsics as described in :ref:`NEP 38 <NEP38>`. This is a complex and multi-faceted
2121
decision - this NEP is an attempt to describe the trade-offs involved and
2222
what would need to be done.
2323

@@ -350,7 +350,6 @@ References and Footnotes
350350
this NEP as an example) or licensed under the `Open Publication License`_.
351351
352352
.. _Open Publication License: https://www.opencontent.org/openpub/
353-
.. _`NEP 38`: https://numpy.org/neps/nep-0038-SIMD-optimizations.html
354353
.. _`gh-20866`: https://github.com/numpy/numpy/pull/20866
355354
.. _`gh-21057`: https://github.com/numpy/numpy/pull/21057
356355
.. _`gh-23096`: https://github.com/numpy/numpy/pull/23096

0 commit comments

Comments
 (0)