summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2023-02-12 09:12:36 +0200
committerGitHub <noreply@github.com>2023-02-12 09:12:36 +0200
commit5c7fde654c7cc9d9f32f29f82f5cb034c3c3ccaa (patch)
tree9d21c3e3f62276dbd35303d49203ca4834ee1e09 /doc
parent9dde0a930aa568bbdd3ba176b12d1d46c72d3d4e (diff)
parent9d5eafe596e75e30a85c01ed62bb5bea9389adc8 (diff)
downloadnumpy-5c7fde654c7cc9d9f32f29f82f5cb034c3c3ccaa.tar.gz
Merge pull request #23089 from seberg/numpy2-flag
API: Add environment variable for behavior planned in a 2.0
Diffstat (limited to 'doc')
-rw-r--r--doc/release/numpy2_changes/23089.change.rst2
-rw-r--r--doc/release/numpy2_changes/README.md4
-rw-r--r--doc/source/reference/global_state.rst14
3 files changed, 20 insertions, 0 deletions
diff --git a/doc/release/numpy2_changes/23089.change.rst b/doc/release/numpy2_changes/23089.change.rst
new file mode 100644
index 000000000..fbd87e0aa
--- /dev/null
+++ b/doc/release/numpy2_changes/23089.change.rst
@@ -0,0 +1,2 @@
+* ``np.gradient()`` now returns a tuple rather than list making the
+ return value immutable.
diff --git a/doc/release/numpy2_changes/README.md b/doc/release/numpy2_changes/README.md
new file mode 100644
index 000000000..fb59749a9
--- /dev/null
+++ b/doc/release/numpy2_changes/README.md
@@ -0,0 +1,4 @@
+Same as ``../upcoming_changes`` but for changes that currently
+are opt-in behind ``NPY_NUMPY_2_BEHAVIOR=1``.
+
+This is to get a start on release notes for such changes.
diff --git a/doc/source/reference/global_state.rst b/doc/source/reference/global_state.rst
index f5c96c355..a110ce7c1 100644
--- a/doc/source/reference/global_state.rst
+++ b/doc/source/reference/global_state.rst
@@ -95,3 +95,17 @@ memory allocation policy, the default will be to call ``free``. If
``NUMPY_WARN_IF_NO_MEM_POLICY`` is set to ``"1"``, a ``RuntimeWarning`` will
be emitted. A better alternative is to use a ``PyCapsule`` with a deallocator
and set the ``ndarray.base``.
+
+
+Testing planned future behavior
+===============================
+
+NumPy has some code paths which are planned to be activated in the future
+but are not yet the default behavior.
+You can try testing some of these which may be shipped with a new "major"
+release (NumPy 2.0) by setting an environment before importing NumPy:
+
+ NPY_NUMPY_2_BEHAVIOR=1
+
+By default this will also activate the :ref:`NEP 50 <NEP50>` related setting
+``NPY_PROMOTION_STATE`` (please see the NEP for details on this).