8000 Merge pull request #26641 from mtsokol/migration-guide-update · numpy/numpy@977a765 · GitHub
[go: up one dir, main page]

Skip to content

Commit 977a765

Browse files
authored
Merge pull request #26641 from mtsokol/migration-guide-update
DOC: Update 2.0 migration guide
2 parents 8d23615 + f5d8ada commit 977a765

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

doc/source/numpy_2_0_migration_guide.rst

Lines changed: 9 additions & 10 deletions
< 6E98 td data-grid-cell-id="diff-a0a6c96d06c18d0d7b39d5c94173a386fbe4eb06eef5b386cf6c688dd7fe32f6-213-213-1" data-selected="false" role="gridcell" style="background-color:var(--bgColor-default);text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative diff-line-number-neutral left-side">213
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ guide can be automatically adapted in downstream code with a dedicated
2323
`Ruff <https://docs.astral.sh/ruff/>`__ rule, namely rule
2424
`NPY201 <https://docs.astral.sh/ruff/rules/numpy2-deprecation/>`__.
2525

26-
You should install ``ruff>=0.2.0`` and add the ``NPY201`` rule to your
26+
You should install ``ruff>=0.4.8`` and add the ``NPY201`` rule to your
2727
``pyproject.toml``::
2828

2929
[tool.ruff.lint]
@@ -149,8 +149,8 @@ Please do not hesitate to open a NumPy issue, if you require assistance or
149149
the provided functions are not sufficient.
150150

151151
**Custom User DTypes:**
152-
Existing user dtypes must now use ``PyArray_DescrProto`` to define their
153-
dtype and slightly modify the code. See note in `PyArray_RegisterDataType`.
152+
Existing user dtypes must now use :c:type:`PyArray_DescrProto` to define
153+
their dtype and slightly modify the code. See note in :c:func:`PyArray_RegisterDataType`.
154154

155155
Functionality moved to headers requiring ``import_array()``
156156
-----------------------------------------------------------
@@ -202,13 +202,13 @@ native C99 types. While the memory layout of those types remains identical
202202
to the types used in NumPy 1.x, the API is slightly different, since direct
203203
field access (like ``c.real`` or ``c.imag``) is no longer possible.
204204

205-
It is recommended to use the functions `npy_creal` and `npy_cimag` (and the
206-
corresponding float and long double variants) to retrieve
205+
It is recommended to use the functions ``npy_creal`` and ``npy_cimag``
206+
(and the corresponding float and long double variants) to retrieve
207207
the real or imaginary part of a complex number, as these will work with both
208-
NumPy 1.x and with NumPy 2.x. New functions `npy_csetreal` and `npy_csetimag`,
209-
along with compatibility macros `NPY_CSETREAL` and `NPY_CSETIMAG` (and the
210-
corresponding float and long double variants), have been
211-
added for setting the real or imaginary part.
208+
NumPy 1.x and with NumPy 2.x. New functions ``npy_csetreal`` and
209+
``npy_csetimag``, along with compatibility macros ``NPY_CSETREAL`` and
210+
``NPY_CSETIMAG`` (and the corresponding float and long double variants),
211+
have been added for setting the real or imaginary part.
212212

213
The underlying type remains a struct under C++ (all of the above still remains
214214
valid).
@@ -382,7 +382,6 @@ expired member migration guideline
382382
newbyteorder Use ``arr.view(arr.dtype.newbyteorder(order))`` instead.
383383
ptp Use ``np.ptp(arr, ...)`` instead.
384384
setitem Use ``arr[index] = value`` instead.
385-
... ...
386385
====================== ========================================================
387386

388387

0 commit comments

Comments
 (0)
0