| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
Caused all long longs to be required native only in memoryviews.
NPY_SIZEOF_LONG_LONG never existed, replace documentation with existing
NPY_SIZEOF_LONGLONG and code with a sizeof(npy_longlong).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Clearing is 50-100 times more expensive than checking on x86, so check if there
is anything needs to be cleared first. This speeds up scalar operations
by 10%-20%.
Based on Arink Verma code in #3739.
Implement the functions as new C-API functions npy_get_floatstatus and
npy_clear_floatstatus in npy_math.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a special case to the implementation of ndarray.__mul__ et al. that
refuses to work on other objects that are not ndarray subclasses and
implement both __numpy_ufunc__ and __r*__.
This way, execution passes first to the custom __r*__ method, which
makes it possible to have e.g. __mul__ and np.multiply do different
things.
Additionally, disable one __array_priority__ special case handling when
also __numpy_ufunc__ is defined.
|
| |
|
|
|
|
| |
Mention that they were removed in 1.9.0.
|
|
|
|
|
| |
Cross-reference it from Ufunc documentation and mention the version it
was added.
|
|\
| |
| | |
DOC: add isclose and partition to reference and link some docs
|
| |
| |
| |
| | |
also drop sometrue/alltrue link, its equivalent to any/all.
|
|/
|
|
| |
Closes #3708.
|
| |
|
|
|
|
| |
Now is as good a time as any with open PR's at a low.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
nanmax, nanmin
--------------
Add out and keepdims keywords.
nanargmin, nanargmax
--------------------
A NanWarning is raised if an all NaN slice detected. For all such
slices np.iingo(np.intp).min is returned as the index value.
nansum
------
The keywords dtype, out, and keepdims are added.
A FutureWarning is raised, as in the future the mean of an empty
slice after NaN replacement will be 0 instead of the current NaN.
nanmean, nanvar, nanstd
-----------------------
For all, if the input array is of inexact type then the dtype and out
parameters must be of inexact type if specified. That insures that NaNs
can be returned when appropriate.
The nanmean function detects empty slices after NaN replacement and
raises a NanWarning. NaN is returned as the value for all such slices.
The nanmean and nanstd functions detect degrees of freedom <= 0 after
NaN replacement and raise a NanWarning. NaN is returned as the value for
all such slices.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A partition sorts the kth element into its sorted order and moves all
smaller elements before the kth element and all equal or greater
elements behind it.
The ordering of all elements in the partitions is undefined.
It is implemented via the introselection algorithm which has worst case
linear complexity compared to a full sort that has linearithmic
complexity.
The introselect algorithm uses a quickselect with median of three pivot
and falls back to a quickselect with median of median of five pivot if
no sufficient progress is made.
The pivots used during the search for the wanted kth element can
optionally be stored and reused for further partitionings of the array.
This is used by the python interface if an array of kth is provided to
the partitions function. This improves the performance of median and
which need to select two elements if the size of the array is even. A
percentile function interpolating between values also profits from this.
String selection is implemented in terms of quicksort which has the same
properties as a selection for now.
|
|
|
|
| |
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* numpy-swig:
Added more mentions of the SuperTensor tests and corrected the number of typemaps and tests (currently 1427 unit tests passed with 'make test': 372+324+324+324+40+19+24)
Added mention of the SuperTensor tests in the README file
Removed 'static' keyword from pyfragments.swg altoghether. I've had the following errors In function ‘SWIG_AsVal_long’: error: initialiser element is not constant In function ‘SWIG_AsVal_unsigned_SS_long’: error: initialiser element is not constant, BOTH in Windows/MinGW and Linux when compiling with gcc
Added tests for 4D tensors. Now using a consistant cubes,slices,rows,columns index order everywhere.
cleaned-up loop indexes in Tensor.cxx
cosmetic changes to numpy.i
Fixed the capsule / cobject memory destructor. Added types to deal with lists of arrays and lists of tensors as input and inplace types.
removed the note about testResize1 failing in testArray.py
fixed the testResize1 test in testArray.py -- Changed order of the resize arguments in Array2.h and replaced len(XXXnumpyarray) with XXXnumpyarray.size
Minor adjustments to numpy.i
Updated numpy.i testing documentation
Updated the numpy.i documentation
Initialize all DATA_TYPE* data_temp variables to NULL
Added Egor's ARGOUTVIEWM_ARRAY3 typemaps
Re-instated a Python 3 fix
Removed doc from list of sub-directories
Upgrade numpy.i
Got rid of a unit test
Conflicts:
doc/sphinxext
doc/swig/test/testFortran.py
|
| |
| |
| |
| | |
typemaps and tests (currently 1427 unit tests passed with 'make test': 372+324+324+324+40+19+24)
|
| |
| |
| |
| |
| |
| | |
Simple updates to include proper statistics on the number of typemap
signatures supported and the number of individual unit tests
implemented.
|
| |
| |
| |
| |
| | |
The RST documentation file is now consistent with the C macros, C
functions, and list of typemap signatures of the latest numpy.i file.
|
| | |
|
| |
| |
| |
| | |
Signed-Off-By: Kumar Appaiah <a.kumar@alumni.iitm.ac.in>
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Fancy Indexing enhancements and bug fixes
|
| | |
| | |
| | |
| | |
| | | |
Mention in release notes and remove documentation which may
give the idea it cannot be used with advanced indexing.
|
| | | |
|
|\ \ \
| | | |
| | | | |
Add generalized ufunc linalg functions and make numpy.linalg use them
|
| |/ / |
|
|/ /
| |
| |
| |
| |
| | |
This includes documentation in the release notes, as well as the
reference guide and smaller corrections. Thanks to Nathaniel
for major rewriting this.
|
|\ \
| | |
| | | |
Make AdvancedNew iter more 0-d aware
|
| | | |
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In python3 range is an iterator and `xrange` has been removed. This has
two consequence for code:
1) Where a list is needed `list(range(...))` must be used.
2) `xrange` must be replaced by `range`
Both of these changes also work in python2 and this patch makes both.
There are three places fixed that do not need it, but I left them in
so that the result would be `xrange` clean.
Closes #3092
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In numpy 1.6 and earlier, if you do
np.add(int_arr, float_arr, out=int_arr)
or
int_arr += float_arr
then the result will be silently truncated to integer values. This
often produces bugs, because it's easy to accidentally end up with an
integer array and not realize it.
Therefore, there seems to be consensus that we should switch to using
same_kind casting by default for in-place ufunc operations. However,
just switching this (as was done initially during the 1.7 development
cycle) breaks a lot of code, which is rude and violates our
deprecation policy.
This commit instead adds a special temporary casting rule which acts
like "unsafe", but also checks whether each operation would be allowed
under "same_kind" rules and issues a DeprecationWarning if not.
It also moves NPY_DEFAULT_ASSIGN_CASTING into the formal API instead
of leaving it as a #define. This way we can change it later, and any
code which references it and is compiled against this version of numpy
will automatically switch to whatever we change it too. This avoids
the situation where we want to remove the temporary magic value we're
using to create DeprecationWarnings now, but can't because it would be
an ABI break.
|
|
|
|
| |
assert_array_max_ulp into the numpy testing reference documentation.
|
|\
| |
| | |
Add transition code for returning view when selecting subset of fields
|
| | |
|
| | |
|
|\ \
| |/
|/| |
Restore ability to not include semi-colons.
|
| | |
|
| | |
|
| | |
|
| | |
|