| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | |
|
| | |
| | |
| | |
| | |
| | | |
The argument was renamed to `shape` and deprecated since NumPy 1.16,
so the deprecation can now be finalized.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Simplify logic for encoding kwarg in _decode_line.
* Remove unnecessary else branch from split_line.
* MAINT: rm else branch from loadtxt.
* MAINT: re-nest encoding parsing.
Co-Authored-By: mattip <matti.picus@gmail.com>
* condense return statement.
Co-authored-by: mattip <matti.picus@gmail.com>
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
At least for now, lets not import it to the main namespace, since there is
no agreement that this is a good idea.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* implement sliding_window_view #7753
Test cases are shown in the issue page.
* Add Example Cases
* Add step_size and N-dim support
* Add shape and step_size check. Remove warning.
* Remove shape default
Add step_size default's description.
* Give proper parameter name 'step'
* fix a parameter description mistake
* implement test function for sliding_window_view()
* implement test function for sliding_window_view()
* Fix according to @eric-wieser comments
* Change arange to ogrid in Examples
* remove np.squeeze on return line
* Clarify document to avoid parameter confusion.
* add `writable` and more explanation in docs
* resolve a write conflit
* fixes according to @seberg review
* resolve write hazard
* remove outdated docs.
* change referring according to @mattip.
change 'writeable' to 'readonly' as @seberg suggest.
remove 'step' as @eric-wieser request
* fix test minor error
* DOC: Grammar fixes
* STY: Add missing line break required by PEP8
* + Change readonly parameter to writeable.
+ Update writeable description.
+ Fix a few parameter checks.
+ Other minor improvements.
* Move to new api as proposed by @eric-wieser
- Change api to follow suggestion by Eric Wieser in
https://github.com/numpy/numpy/pull/10771#issuecomment-524715356
- Update docstring
- Add more tests
* Improve documentation
* Add sliding_window_view to documentation index
* Apply suggestions from code review
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* Fix window shape check
* Add `sliding_window_view` to __all__
* Add tests for error cases
* Add array_function dispatching
* Change dispatcher argument defaults to None
* Simplify array function dispatching
* Added "np." prefix to doctests
* Split tests
* Improved docstring
* Add release note
* Fix docstring formatting
* Fix doctest
* Remove namespacing in documentation indexing
* Improve docstring
* Improved docstring
* Simplified docstring
* Improve docstring to make pseudo code stand out
* Improve docstring
* Add simple application example
* Correct release note
* Improve link with as_strides
* Add note about performance
* Tidy up main doc string
* Make language on performance warning stronger
* Bugfix: pass subok and writeable to as_strided
* Add writeable test
* Add subok test
* Change subok test to use custom array subclass instead of unsupported MaskedArray
* Add version added information
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Fanjin <fjzeng@ucsd.edu>
Co-authored-by: Fanjin Zeng <Fnjn@users.noreply.github.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: fanjin <fjzeng@outlook.com>
Closes gh-7753
|
| | | |
|
| | | |
|
| | |
| | |
| | | |
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
|
| | |
| | |
| | |
| | |
| | | |
Fixes gh-16354. Previously np.poly1d(z).coeffs.dtype would always
be np.float64 for zero array z, regardless of z's dtype.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* ENH: add function to get broadcast shape from a given set of shapes.
Add new function numpy.broadcast_shape which takes tuples
for the shapes to be broadcast against each other.
Return the broadcasted shape as a tuple.
See #17217
* Perform array allocations of size 0 for provided shape tuples
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* Test for int as input shape
Also update docstring to include both ints and tuples of ints as input
* Remove unnecessary array_function_dispatch
* Add missing set_module
* Add release notes. Add versionadded to docstring.
Also fix up docstring details.
* follow convention for trailing comma
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
* Change name to broadcast_shapes. Also add test case, and type hint.
* follow convention
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* Update docstring
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* Add reference to numpy docs on broadcasting to docstring
Also move versionadded
* Fix spelling
Co-authored-by: Warren Weckesser <warren.weckesser@gmail.com>
* Add broadcast_shapes to reference docs and add See Also sections
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
Co-authored-by: Warren Weckesser <warren.weckesser@gmail.com>
|
| | |
| | |
| | |
| | |
| | | |
Fixes the incompatible type comparison found in #17490.
This also corrects the logic to not print the heading when only private/magic methods are present.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Adds a keyword-only dtype parameter to correlate and coerrcoef to allow
user to specify the dtype of the output.
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
|\ \ \
| | | |
| | | | |
MAINT: fix exception chaining in format.py
|
| | | | |
|
|/ / /
| | |
| | |
| | |
| | |
| | | |
Fixes the error message reported by ediff1d in the case of
an invalid to_begin and updates tests to assert validity.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| | |
| | |
| | |
| | |
| | |
| | | |
* Generate stub for module, fixes 7 broken links
* Modify arraysetops module docstring w/ rst formatting
* Remove listing of functions from module docstring.
|
| | |
| | |
| | | |
* DOC: Fix typos in versionchanged.
|
| | | |
|
|\ \ \
| | | |
| | | | |
DEP: Change the financial name access warning to DeprecationWarning
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Most end-users will probably not care about the warning in any case,
since they will not just import the function but also use it.
We can't just remove it, due to gh-17143: Astropy currently pulls
in these functions (but doesn't use them), so that plain removal
would lead to an unusable astropy if a new NumPy is installed.
Even more annoying, due to a (faulty?) astropy pytest plugin, this
affects all pytest runs (which do not use `PYTEST_DISABLE_PLUGIN_AUTOLOAD`).
Changing it to a DeprecationWarning seems to remove the issue from
pytest runs, this may make the warning less visible in rare cases
where it should be seen, but hopefully it will still be visible enough.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* ENH: Allow genfromtxt to unpack structured arrays
genfromtxt failed to transpose output when
unpack=True and `dtype` was structured (or None).
This patch resolves the issue by
returning a list of arrays, as in `loadtxt`.
Co-authored-by: Matti Picus <matti.picus@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
|\ \ \ \
| |/ / /
|/| | | |
DOC: Fix docstring cross-referencing
|
| | | | |
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
ENH: Add placeholder stubs for all sub-modules
|
| | | | | |
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
MAINT: Remove old PY_VERSION_HEX and sys.version_info code
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
MAINT: Remove some callers of functions in numpy.compat
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Some more Python 2 cleanup.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This edit is relation to issue gh-15986.
Chained exception in shape_base.py
|
|\ \ \ \ \ \ \
| |_|_|_|/ / /
|/| | | | | | |
DEP: Deprecated ndindex.ndincr
|
| | |/ / / /
| |/| | | |
| | | | | |
| | | | | | |
The "do not use" comment has been here since bb0e4f356cce2f199d9c08ffe572fbabadc846d1.
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
counterparts (#17222)
* DOC: redistribute docstring-only content from numpy/doc
* DOC: post-transition clean-up
* DOC, MAINT: reskip doctests, fix a few easy ones
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | | |
This relies on the fact that `cos` is exactly symmetric around zero, but not around the floating-point approximation of `pi`.
Closes gh-17169.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This PR adds the implementation of NEP-35's like= argument, allowing dispatch of array creation functions with __array_function__ based on a reference array.
* ENH: Add like= kwarg via __array_function__ dispatcher to asarray
* ENH: Add new function for __array_function__ dispatching from C
This new function allows dispatching from C directly, while also
implementing the new `like=` argument, requiring only minimal
changes to existing array creation functions that need to add
support for that argument.
* ENH: Add like= support to numpy.array
The implementation uses array_implement_c_array_function, thus
introducing minimal complexity to the original _array_fromobject
code.
* BUG: Fix like= dispatcher for np.full
* ENH: Remove np.asarray like= dispatcher via Python
np.asarray can rely on np.array's C dispatcher instead.
* TST: Add some tests for like= argument
Tests comprise some of the functions that have been implemented already:
* np.array (C dispatcher)
* np.asarray (indirect C dispatcher via np.array)
* np.full (Python dispatcher)
* np.ones (Python dispatcher)
* ENH: Remove like= argument during array_implement_array_function
* ENH: Add like= kwarg to ones and full
* BUG: prevent duplicate removal of `like=` argument
* ENH: Make `like=` a keyword-only argument
* ENH: Use PyUnicode_InternFromString in arrayfunction_override
Replace PyUnicode_FromString by PyUnicode_InternFromString to cache
"like" string.
* ENH: Check for arrayfunction_override import errors
Check and handle errors on importing NumPy's Python functions
* BUG: Fix array_implement_c_array_function error handling
* ENH: Handle exceptions with C implementation of `like=`
* ENH: Add `like=` dispatch for all asarray functions
Using Python dispatcher for all of them. Using the C dispatcher
directly on the `np.array` call can result in incorrect behavior.
Incorrect behavior may happen if the downstream library's
implementation is different or if not all keyword arguments are
supported.
* ENH: Simplify handling of exceptions with `like=`
* TST: Add test for exception handling with `like=`
* ENH: Add support for `like=` to `np.empty` and `np.zeros`
* TST: Add `like=` tests for `np.empty` and `np.zeros`
* ENH: Add `like=` to remaining multiarraymodule.c functions
Functions are:
* np.arange
* np.frombuffer
* np.fromfile
* np.fromiter
* np.fromstring
* TST: Add tests for multiarraymodule.c functions with like=
Functions are:
* np.arange
* np.frombuffer
* np.fromfile
* np.fromiter
* np.fromstring
* ENH: Add `like=` support to more creation functions
Support for the following functions is added:
* np.eye
* np.fromfunction
* np.genfromtxt
* np.identity
* np.loadtxt
* np.tri
* TST: Add `like=` tests for multiple functions
Tests for the following functions are added:
* np.eye
* np.fromfunction
* np.genfromtxt
* np.identity
* np.loadtxt
* np.tri
* TST: Reduce code duplication in `like=` tests
* DOC: Document `like=` in functions that support it
Add documentations for the following functions:
* np.array
* np.arange
* np.asarray
* np.asanyarray
* np.ascontiguousarray
* np.asfortranarray
* np.require
* np.empty
* np.full
* np.ones
* np.zeros
* np.identity
* np.eye
* np.tri
* np.frombuffer
* np.fromfile
* np.fromiter
* np.fromstring
* np.loadtxt
* np.genfromtxt
* ENH: Add `like=` to numpy/__init__.pyi stubs
* BUG: Remove duplicate `like=` dispatching in as*array
Functions `np.asanyarray`, `np.contiguousarray` and `np.fortranarray`
were dispatching both via their definitions and `np.array` calls,
the latter should be avoided.
* BUG: Fix missing check in array_implement_array_function
* BUG: Add missing keyword-only markers in stubs
* BUG: Fix duplicate keyword-only marker in array stub
* BUG: Fix syntax error in numpy/__init__.pyi
* BUG: Fix more syntax errors in numpy/__init__.pyi
* ENH: Intern arrayfunction_override strings in multiarraymodule
* STY: Add missing brackets to arrayfunction_override.c
* MAINT: Remove arrayfunction_override dict check for kwarg
* TST: Assert that 'like' is not in TestArrayLike kwargs
* MAINT: Rename array_implement_c_array_function(_creation)
This is done to be more explicit as to its usage being intended for
array creation functions only.
* MAINT: Use NotImplemented to indicate fallback to default
* TST: Test that results with `like=np.array` are correct
* TST: Avoid duplicating MyArray code in TestArrayLike
* TST: Don't delete temp file, it may cause issues with Windows
* TST: Don't rely on eval in TestArrayLike
* TST: Use lambda with StringIO in TestArrayLike
* ENH: Avoid unnecessary Py_XDECREF in arrayfunction_override
* TST: Make TestArrayLike more readable
* ENH: Cleaner error handling in arrayfunction_override
* ENH: Simplify array_implement_c_array_function_creation
* STY: Add missing spaces to multiarraymodule.c
* STY: C99 declaration style in arrayfunction_override.c
* ENH: Simplify arrayfunction_override.c further
Remove cleanup label from array_implementation_c_array_function,
simplifying the code. Fix unitialized variable warning in
array_implementation_array_function_internal.
* DOC: Use string replacement for `like=` documentation
Avoid repeating the full text for the `like=` argument by storing it as
a variable and using `replace` on each docstring.
* DOC: Update `like=` docstring
* TST: Test like= with array not implementing __array_function__
* TST: Add missing asanyarray to TestArrayLike
* ENH: Use helper function for like= dispatching
Avoid dispatching like= from Python implementation functions to improve
their performance. This is achieved by only calling a dispatcher
function when like is passed by the users.
* ENH: Rename array_function_dispatch kwarg to public_api
* BUG: Add accidentally removed decorator for np.eye back
* DOC: Add set_array_function_like_doc function
The function keeps Python files cleaner and resolve errors when __doc__
is not defined due to PYTHONOPTIMIZE or -OO .
* DOC: Add mention to like= kwarg being experimental
* TST: Test like= with not implemented downstream function
* DOC: Fix like= docstring reference to NEP 35.
* ENH: Prevent silent errors if public_api is not callable
* ENH: Make set_array_function_like_doc a decorator
* ENH: Simplify `_*_with_like` functions
* BUG: Fix multiple `like=` dispatching in `require`
* MAINT: Remove now unused public_api from array_function_dispatch
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
MAINT: Change handling of the expired financial functions.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
In a previous commit, the expired financial functions were removed
from NumPy, and code was added to __init__.py using the module
__getattr__ to raise a customized AttributeError on any attempt to
reference the expired names in the numpy namespace.
That change broke released versions astropy, which has code that
imports the financial functions. astropy never calls the functions,
so they never saw the deprecation warnings that have been in place
since numpy 1.18. This means that attempting to use a released
version of astropy with numpy 1.20 will cause astropy to crash
with the custom AttributeError.
In this commit, instead of raising an exception when one of the
expired names is referenced, a warning is generated. If the
function is *called*, an exception is raised.
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* MAINT: chain type error line 303 arraysetops.py
* MAINT: chain axis error line 281 arraysetops.py
* Revert "MAINT: chain axis error line 281 arraysetops.py"
This reverts commit f6e1f544bebb7e5346cb83bdac9756be6ee9f4f6.
* MAINT: chain axis error line 281 arraysetops.py to be from None
|
|/ / /
| | |
| | |
| | | |
Fix spacing that produced incorrect rendering
|
|\ \ \
| | | |
| | | | |
MAINT: Revert boolean casting back to elementwise comparisons in `trim_zeros`
|
| | | | |
|
| | | | |
|
| | | | |
|