| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \ \
| | | |
| | | | |
ENH: Avoiding NPY_BEGIN_THREADS for small arrays can speed-up trivial_three_operand_loop by 5%
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
ndarraytypes.h
Avoiding NPY_BEGIN_THREADS for small arrays, can speed-up trivial_three_operand_loop by 5%.
As releases of GIL, then quickly restoring just after small operation doesn't benefit.
|
|\ \ \ \
| | | | |
| | | | | |
BUG: Boolean assignment allowed writing to 0-sized array
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This was because of the assumption that broadcasting works
if the dimension is not > 1, but correct is != 1.
Adepted from a patch provided by prossahl.
Closes gh-3458.
|
|/ / / / |
|
| | | |
| | | |
| | | |
| | | | |
Also add test for IndexError exception when axis is out of bounds.
|
| | | | |
|
| | | | |
|
|\ \ \ \
| |_|/ /
|/| | | |
Fix for the NumPy C-API deprecation mechanism.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Avoid conversion to NumPy Scalar
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
After profiling I noticed that a bottleneck for NumPy scalar operations
occurs when trying to extract the underlying C value from a Python float
because it first converts the Python scalar into its matching NumPy
scalar (e.g. PyFloat -> float64) and then it extracts the C value from
the NumPy scalar.
For some types, it is a lot faster to just extract the value directly
from the Python scalar.
I only did for PyFloat in this modified code but the code is laid out
such that it can be easily extended to other types such as Integers. I
did not do them because I was unsure if there was a special scenario to
handle across OS and/or between 32 and 64 bit platforms. The ratio of
speed to do different operations are listed below (Old time / New time
with modifications). In other words, the bigger the number, the bigger
the speed up we get.
Tested in Python 2.6 Windows
RATIO TEST
1.1 Array * Array
1.1 PyFloat * Array
1.1 Float64 * Array
1.0 PyFloat + Array
1.3 Float64 + Array
1.1 PyFloat * PyFloat
1.0 Float64 * Float64
4.0 PyFloat * Float64
2.9 PyFloat * vector1[1]
3.9 PyFloat + Float64
9.8 PyFloat < Float64
9.9 PyFloat < Float64
1.0 Create array from list
1.0 Assign PyFloat to all
1.0 Assign Float64 to all
4.2 Float64 * pyFloat * pyFloat * pyFloat * pyFloat
1.0 pyFloat * pyFloat * pyFloat * pyFloat * pyFloat
1.0 Float64 * Float64 * Float64 * Float64 * Float64
1.0 Float64 ** 2
1.0 pyFloat ** 2
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Update structured_arrays.py
|
| | | | | |
| | | | | |
| | | | | | |
The behaviour documented did not match the actual behaviour of numpy. Explanation changed and the code example updated.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In numpy/core/src/npymath/npy_math_private.h the /* my machine */
comment is not informative.
|
| | | | | | |
|
| | | | | | |
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | | |
The logging message in numpy.distutils.log.set_threshold
mispelled threshold.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
BUG: make preprocessor tests consistent in halffloat.c
|
| | |_|_|/
| |/| | |
| | | | | |
Corrected preprocessor form.
|
| | | | | |
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Docstring: point to correct equivalent function (one word change)
|
| | | | |
| | | | |
| | | | | |
I overlooked that np.compress and ndarray.compress are different things and wrongly assumed that it was a typo. I corrected that and added np.extract for equivalency for 1-D arrays.
|
| | | | |
| | | | |
| | | | | |
np.compress' "See also" pointed to itself instead to equivalent np.extract
|
| | | | | |
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
Updated documentation for histogram2d() in twodim_base.py according to discussion
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Replace use of WarningManager by warnings.catch_warnings and then deprecate it.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
WarningManager was a workaround for the lack of the with statement
in Python versions < 2.6. As those versions are no longer supported
it can be removed.
Deprecation notes are added to WarningManager and WarningMessage, but
to avoid a cascade of messages in third party apps, no warnings are
raised at this time, that can be done later.
Closes #3519.
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The buffer test in numpy/core/tests/test_api.py was apparently
testing for incorrect behavior that was corrected in Python 2.7.5.
This PR changes the test to check for the correct results and makes
running it depend on Python version.
Closes #3512.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
MAINT: Use np.errstate context manager.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Now that Python < 2.6 is no longer supported we can use the errstate
context manager in places where constructs like
```
old = seterr(invalid='ignore')
try:
blah
finally:
seterr(**old)
```
were used.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
MAINT: Remove outdated version checks.
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Because Numpy 1.8.0 will no longer supports Python versions < 2.6 we
no longer need to check for that and can also remove the code that is
specific to those earlier versions.
To make this a bit safer, the toplevel setup.py file now contains a
check of the Python version number and raises an error when run by an
unsupported version.
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | /
| | |_|_|/
| |/| | | |
ENH: added short path scalar array in get_ufunc_arguments from ufunc_object.c
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Check if two dtypes references to the same object in can_cast_scalar_to from convert_datatype.c,
then the result is always OK
|
| | | | |
| | | | |
| | | | |
| | | | | |
Check if object is of array with newtype is NULL. If so return it directly instead of checking for casting.
|
| | | | |
| | | | |
| | | | |
| | | | | |
Check if object is of array with newtype is NULL. If so return it directly instead of checking for casting.
|
| | | | |
| | | | |
| | | | |
| | | | | |
Check if object is of array dimension zero with newtype is NULL. If so return it directly instead of checking for casting.
|