@@ -170,13 +170,14 @@ Cython users may use the NumPy C-API via ``cimport numpy as cnp``. |
170 | 170 | Due to the uncertainty of Cython development, there are two scenarios for |
171 | 171 | impact on Cython users. |
172 | 172 |
|
173 | | -If Cython 3 can be relied on, Cython users would be impacted *less* then C-API |
| 173 | +If Cython 3 can be relied on, Cython users would be impacted *less* than C-API |
174 | 174 | users, because Cython 3 allows us to hide struct layout changes (i.e. changes |
175 | 175 | to ``PyArray_Descr``). |
176 | | -If this is not the case and we must support Cython 2.x, then Cython users |
177 | | -will also have to use a function/macro like ``PyDataType_ITEMSIZE()`` (or |
178 | | -use the Python object). This is unfortunately less typical in Cython code, |
179 | | -but also unlikely to be a common pattern for dtype struct fields/attributes. |
| 176 | +If this is not the case and we must support Cython 0.29.x (which is the historic branch |
| 177 | +before Cython 3), then Cython users will also have to use a function/macro like |
| 178 | +``PyDataType_ITEMSIZE()`` (or use the Python object). This is unfortunately less |
| 179 | +typical in Cython code, but also unlikely to be a common pattern for dtype struct |
| 180 | +fields/attributes. |
180 | 181 |
|
181 | 182 | A further impact is that some future API additions such as new classes may |
182 | 183 | need to placed in a distinct ``.pyd`` file to avoid Cython generating code |
@@ -199,7 +200,7 @@ is missing. |
199 | 200 |
|
200 | 201 | Some new API can be backported |
201 | 202 | ------------------------------- |
202 | | -One large advantage of allowing users to compile with the newst version of |
| 203 | +One large advantage of allowing users to compile with the newest version of |
203 | 204 | NumPy is that in some cases we will be able to backport new API. |
204 | 205 | Some new API functions can be written in terms of old ones or included |
205 | 206 | directly. |
@@ -229,7 +230,7 @@ An implementation can be found in the `PR 23528`_. |
229 | 230 | The second part is mainly about identifying and implementing the desired |
230 | 231 | changes in a way that backwards compatibility will not be broken and API |
231 | 232 | breaks remain manageable for downstream libraries. |
232 | | -Everyone change we do must have a brief note on how to adapt to the |
| 233 | +Every change we do must have a brief note on how to adapt to the |
233 | 234 | API change (i.e. alternative functions). |
234 | 235 |
|
235 | 236 | NumPy 2 compatibility and API table changes |
@@ -239,12 +240,13 @@ NumPy 1.x (a table is a list of functions and symbols). |
239 | 240 |
|
240 | 241 | For compatibility we would need to translate the 1.x table to the 2.0 table. |
241 | 242 | This could be done in headers only in theory, but this seems unwieldy. |
242 | | -We thus propose to add a ``numpy2_compat`` package. This packages main |
| 243 | +We thus propose to add a ``numpy2_compat`` package. This package's main |
243 | 244 | purpose would be to provide a translation of the 1.x table to the 2.x one |
244 | 245 | in a single place (filling in any necessary blanks). |
245 | 246 |
|
246 | 247 | Introducing this package solves the "transition" issue because it allows |
247 | 248 | a user to: |
| 249 | + |
248 | 250 | * Install a SciPy version that is compatible with 2.0 and 1.x |
249 | 251 | * and keep using NumPy 1.x because of other packages they are using are not |
250 | 252 | yet compatible. |
@@ -278,6 +280,7 @@ Backward compatibility |
278 | 280 | ====================== |
279 | 281 |
|
280 | 282 | As mentioned above backwards compatibility is achieved by: |
| 283 | + |
281 | 284 | 1. Forcing downstream to recompile with NumPy 2.0 |
282 | 285 | 2. Providing a ``numpy2_compat`` library. |
283 | 286 |
|
|