diff options
author | Darren Dale <dsdale24@gmail.com> | 2009-08-25 18:04:01 +0000 |
---|---|---|
committer | Darren Dale <dsdale24@gmail.com> | 2009-08-25 18:04:01 +0000 |
commit | ae6aa8d4d2527cc6810cc1e430269719f81e821b (patch) | |
tree | 716eaf1e16df7e2c21698b085f84332c211c16bc /doc/release | |
parent | 17828c6ede1982ffab11e7277c80c7f21a907a75 (diff) | |
download | numpy-ae6aa8d4d2527cc6810cc1e430269719f81e821b.tar.gz |
add comment about __array_prepare__ to 1.4 release notes
Diffstat (limited to 'doc/release')
-rw-r--r-- | doc/release/1.4.0-notes.rst | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/release/1.4.0-notes.rst b/doc/release/1.4.0-notes.rst index e2df0322d..849b429cb 100644 --- a/doc/release/1.4.0-notes.rst +++ b/doc/release/1.4.0-notes.rst @@ -10,6 +10,19 @@ Highlights New features ============ +Extended array wrapping mechanism for ufuncs +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +An __array_prepare__ method has been added to ndarray to provide subclasses +greater flexibility to interact with ufuncs and ufunc-like functions. ndarray +already provided __array_wrap__, which allowed subclasses to set the array type +for the result and populate metadata on the way out of the ufunc (as seen in +the implementation of MaskedArray). For some applications it is necessary to +provide checks and populate metadata *on the way in*. __array_prepare__ is +therefore called just after the ufunc has initialized the output array but +before computing the results and populating it. This way, checks can be made +and errors raised before operations which may modify data in place. + Automatic detection of forward incompatibilities ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |