Skip to content

Commit

Permalink
change DeprecationWarning to FutureWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvius committed Jul 17, 2012
1 parent 2eb9610 commit a03e8b4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/release/1.7.0-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ such an array. See the documentation for np.diagonal for details.
Similar to np.diagonal above, in a future version of numpy, indexing
a record array by a list of field names will return a view onto the
original array, instead of producing a copy as they do now. As with
np.diagonal, numpy 1.7 produces a DeprecationWarning if it detects
np.diagonal, numpy 1.7 produces a FutureWarning if it detects
that you may be attemping to write to such an array. See the documentation
for array indexing for details.

Expand Down
2 changes: 1 addition & 1 deletion doc/source/reference/arrays.indexing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ Indexing into a record array can also be done with a list of field names,
*e.g.* ``x[['field-name1','field-name2']]``. Currently this returns a new
array containing a copy of the values in the fields specified in the list.
As of NumPy 1.7, returning a copy is being deprecated in favor of returning
a view. A copy will continue to be returned for now, but a DeprecationWarning
a view. A copy will continue to be returned for now, but a FutureWarning
will be issued when writing to the copy. If you depend on the current
behavior, then we suggest copying the returned array explicitly, i.e. use
x[['field-name1','field-name2']].copy(). This will work with both past and
Expand Down
4 changes: 2 additions & 2 deletions numpy/core/tests/test_multiarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -1983,13 +1983,13 @@ def collect_warning_types(f, *args, **kwargs):
# All the different functions raise a warning, but not an error, and
# 'a' is not modified:
assert_equal(collect_warning_types(a[['f1','f2']].__setitem__, 0, (10,20)),
[DeprecationWarning])
[FutureWarning])
assert_equal(a, b)
# Views also warn
subset = a[['f1','f2']]
subset_view = subset.view()
assert_equal(collect_warning_types(subset_view['f1'].__setitem__, 0, 10),
[DeprecationWarning])
[FutureWarning])
# But the write goes through:
assert_equal(subset['f1'][0], 10)
# Only one warning per multiple field indexing, though (even if there are
Expand Down

0 comments on commit a03e8b4

Please sign in to comment.