| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
This should be harmless, as we already are division clean. However,
placement of this import takes some care. In the future a script
can be used to append new features without worry, at least until
such time as it exceeds a single line. Having that ability will
make it easier to deal with absolute imports and printing updates.
|
| |
|
| |
|
| |
|
|\
| |
| | |
Devguide update
|
| |
| |
| |
| | |
This commit address comments from Charles on PR #455.
|
| |
| |
| |
| |
| | |
Recommend to update master before creating your feature branch.
Thanks to Nicky van Foreest for feedback on the dev-guide.
|
| |
| |
| |
| |
| | |
This section is outdated, and following it pretty much ensures that your
patches will languish in Trac.
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
See https://github.com/scipy/scipy/pull/279
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Add doc for PyArray_FILLWBYTE to tell the ndarray must be c contiguous.
|
| | | |
|
| |/ |
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original masked-NA-NEP branch contained a large number of changes
in addition to the core NA support. For example:
- ufunc.__call__ support for where= argument
- nditer support for arbitrary masks (in support of where=)
- ufunc.reduce support for simultaneous reduction over multiple axes
- a new "array assignment API"
- ndarray.diagonal() returning a view in all cases
- bug-fixes in __array_priority__ handling
- datetime test changes
etc. There's no consensus yet on what should be done with the
maskna-related part of this branch, but the rest is generally useful
and uncontroversial, so the goal of this branch is to identify exactly
which code changes are involved in maskna support.
The basic strategy used to create this patch was:
- Remove the new masking-related fields from ndarray, so no arrays
are masked
- Go through and remove all the code that this makes
dead/inaccessible/irrelevant, in a largely mechanical fashion. So
for example, if I saw 'if (PyArray_HASMASK(a)) { ... }' then that
whole block was obviously just dead code if no arrays have masks,
and I removed it. Likewise for function arguments like skipna that
are useless if there aren't any NAs to skip.
This changed the signature of a number of functions that were newly
exposed in the numpy public API. I've removed all such functions from
the public API, since releasing them with the NA-less signature in 1.7
would create pointless compatibility hassles later if and when we add
back the NA-related functionality. Most such functions are removed by
this commit; the exception is PyArray_ReduceWrapper, which requires
more extensive surgery, and will be handled in followup commits.
I also removed the new ndarray.setasflat method. Reason: a comment
noted that the only reason this was added was to allow easier testing
of one branch of PyArray_CopyAsFlat. That branch is now the main
branch, so that isn't an issue. Nonetheless this function is arguably
useful, so perhaps it should have remained, but I judged that since
numpy's API is already hairier than we would like, it's not a good
idea to add extra hair "just in case". (Also AFAICT the test for this
method in test_maskna was actually incorrect, as noted here:
https://github.com/njsmith/numpyNEP/blob/master/numpyNEP.py
so I'm not confident that it ever worked in master, though I haven't
had a chance to follow-up on this.)
I also removed numpy.count_reduce_items, since without skipna it
became trivial.
I believe that these are the only exceptions to the "remove dead code"
strategy.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The various padding functions are exposed as options to a public 'pad'
function. Example:
pad(a, 5, mode='mean')
Current modes are 'constant', 'edge', 'linear_ramp', 'maximum', 'mean',
'median', 'minimum', 'reflect', 'symmetric', 'wrap', and <function>
This commit includes unit tests and doctests and is based on feature
request ticket #655.
|
| |
|
|
|
|
| |
This has been extensively discussed on the mailing list. See #2072.
|
| |
|
| |
|
|
|
|
|
| |
Also remove swig support for numpy < 1 from numpy.i since it expects
the old macros.
|
|
|
|
|
| |
Add more explanation of what happens in polynomial substitution and also of
its use in casting between types. Clean up some rst glitches.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The Sphinx markup was incorrect the documentation to the polynomial
convenience classes wasn't being generated.
|
|
|
|
|
| |
This is the first step in cleaning up the polynomial documentation
and writing an instructional section on the convenience classes.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
for legacy code
These functions now reject inputs with NA, and there are alternative
functions PyArray_AllowNAConverter and PyArray_OutputAllowNAConverter
that functions should use when they intend to support NA.
|
| |
|
|
|
|
| |
From Chris Jordan-Squire
|
|
|
|
| |
From github users xscript and 87.
|
|
|
|
| |
Thanks to chebee7i for the feedback
|