10000 more backports for 1.9.2 by juliantaylor · Pull Request #5616 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

more backports for 1.9.2 #5616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 1, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions doc/release/1.9.2-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@ This is a bugfix only release in the 1.9.x series.
Issues fixed
============

* `#5316 <https://github.com/scipy/scipy/issues/5316>`__: fix too large dtype alignment of strings and complex types
* `#5424 <https://github.com/scipy/scipy/issues/5424>`__: fix ma.median when used on ndarrays
* `#5481 <https://github.com/scipy/scipy/issues/5481>`__: Fix astype for structured array fields of different byte order
* `#5155 <https://github.com/scipy/scipy/issues/5155>`__: Fix loadtxt with comments=None and a string None data
* `#4476 <https://github.com/scipy/scipy/issues/4476>`__: Masked array view fails if structured dtype has datetime component
* `#5388 <https://github.com/scipy/scipy/issues/5388>`__: Make RandomState.set_state and RandomState.get_state threadsafe
* `#5390 <https://github.com/scipy/scipy/issues/5390>`__: make seed, randint and shuffle threadsafe
* `#5374 <https://github.com/scipy/scipy/issues/5374>`__: Fixed incorrect assert_array_almost_equal_nulp documentation
* `#5393 <https://github.com/scipy/scipy/issues/5393>`__: Add support for ATLAS > 3.9.33.
* `#5313 <https://github.com/scipy/scipy/issues/5313>`__: PyArray_AsCArray caused segfault for 3d arrays
* `#5492 <https://github.com/scipy/scipy/issues/5492>`__: handle out of memory in rfftf
* `#4181 <https://github.com/scipy/scipy/issues/4181>`__: fix a few bugs in the random.pareto docstring
* `#5359 <https://github.com/scipy/scipy/issues/5359>`__: minor changes to linspace docstring
* `#4723 <https://github.com/scipy/scipy/issues/4723>`__: fix a compile issues on AIX
* `#5316 <https://github.com/numpy/numpy/issues/5316>`__: fix too large dtype alignment of strings and complex types
* `#5424 <https://github.com/numpy/numpy/issues/5424>`__: fix ma.median when used on ndarrays
* `#5481 <https://github.com/numpy/numpy/issues/5481>`__: Fix astype for structured array fields of different byte order
* `#5354 <https://github.com/numpy/numpy/issues/5354>`__: fix segfault when clipping complex arrays
* `#5524 <https://github.com/numpy/numpy/issues/5524>`__: allow np.argpartition on non ndarrays
* `#5612 <https://github.com/numpy/numpy/issues/5612>`__: Fixes ndarray.fill to accept full range of uint64
* `#5155 <https://github.com/numpy/numpy/issues/5155>`__: Fix loadtxt with comments=None and a string None data
* `#4476 <https://github.com/numpy/numpy/issues/4476>`__: Masked array view fails if structured dtype has datetime component
* `#5388 <https://github.com/numpy/numpy/issues/5388>`__: Make RandomState.set_state and RandomState.get_state threadsafe
* `#5390 <https://github.com/numpy/numpy/issues/5390>`__: make seed, randint and shuffle threadsafe
* `#5374 <https://github.com/numpy/numpy/issues/5374>`__: Fixed incorrect assert_array_almost_equal_nulp documentation
* `#5393 <https://github.com/numpy/numpy/issues/5393>`__: Add support for ATLAS > 3.9.33.
* `#5313 <https://github.com/numpy/numpy/issues/5313>`__: PyArray_AsCArray caused segfault for 3d arrays
* `#5492 <https://github.com/numpy/numpy/issues/5492>`__: handle out of memory in rfftf
* `#4181 <https://github.com/numpy/numpy/issues/4181>`__: fix a few bugs in the random.pareto docstring
* `#5359 <https://github.com/numpy/numpy/issues/5359>`__: minor changes to linspace docstring
* `#4723 <https://github.com/numpy/numpy/issues/4723>`__: fix a compile issues on AIX
10 changes: 9 additions & 1 deletion numpy/core/fromnumeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,16 @@ def argpartition(a, kth, axis=-1, kind='introselect', order=None):
>>> x[np.argpartition(x, (1, 3))]
array([1, 2, 3, 4])

>>> x = [3, 4, 2, 1]
>>> np.array(x)[np.argpartition(x, 3)]
array([2, 1, 3, 4])

"""
return a.argpartition(kth, axis, kind=kind, order=order)
try:
argpartition = a.argpartition
except AttributeError:
return _wrapit(a, 'argpartition',kth, axis, kind, order)
return argpartition(kth, axis, kind=kind, order=order)


def sort(a, axis=-1, kind='quicksort', order=None):
Expand Down
2 changes: 0 additions & 2 deletions numpy/core/src/multiarray/arraytypes.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -3467,8 +3467,6 @@ static void
npy_intp i;
@type@ max_val, min_val;

min_val = *min;
max_val = *max;
if (max != NULL) {
max_val = *max;
}
Expand Down
6 changes: 6 additions & 0 deletions numpy/core/tests/test_multiarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,12 @@ def test_partition_fuzz(self):
assert_array_equal(np.partition(d, kth)[kth], tgt,
err_msg="data: %r\n kth: %r" % (d, kth))

def test_argpartition_gh5524(self):
# A test for functionality of argpartition on lists.
d = [6,7,3,2,9,0]
p = np.argpartition(d,1)
self.assert_partitioned(np.array(d)[p],[1])

def test_flatten(self):
x0 = np.array([[1, 2, 3], [4, 5, 6]], np.int32)
x1 = np.array([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], np.int32)
Expand Down
12 changes: 12 additions & 0 deletions numpy/core/tests/test_numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -1176,6 +1176,18 @@ def test_simple_complex(self):
act = self.clip(a, m, M)
assert_array_strict_equal(ac, act)

def test_clip_complex(self):
# Address Issue gh-5354 for clipping complex arrays
# Test native complex input without explicit min/max
# ie, either min=None or max=None
a = np.ones(10, dtype=np.complex)
m = a.min()
M = a.max()
am = self.fastclip(a, m, None)
aM = self.fastclip(a, None, M)
assert_array_strict_equal(am, a)
assert_array_strict_equal(aM, a)

def test_clip_non_contig(self):
#Test clip for non contiguous native input and native scalar min/max.
a = self._generate_data(self.nr * 2, self.nc * 3)
Expand Down
0