summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSebastian Berg <sebastianb@nvidia.com>2023-01-24 22:28:35 +0100
committerSebastian Berg <sebastianb@nvidia.com>2023-02-10 14:49:16 +0100
commit624b18090ae567f3cfd528a8ae156b2ae7db6d82 (patch)
treeed3a82d2c8ae7f6a1ccee872b55c96b276f4ff8b /doc
parent6dadb8c40451e934075904f6acdfe341d3b8762e (diff)
downloadnumpy-624b18090ae567f3cfd528a8ae156b2ae7db6d82.tar.gz
API: Add environment variable for behavior planned in a 2.0
The idea of the flag is not to allow to change it right now, since there may be some things where that is hard to do in general, and it doesn't seem relevant: nobody is supposed to use it besides for testing.
Diffstat (limited to 'doc')
-rw-r--r--doc/release/numpy2_changes/README.md4
-rw-r--r--doc/source/reference/global_state.rst14
2 files changed, 18 insertions, 0 deletions
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).