| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to the docs, the list can be of lengths 1, 2, or 3, but only
length 3 appears to work:
```
>>> import numpy as np
>>> np.sin(1, extobj=[16, 1, lambda: None])
0.8414709848078965
>>> np.sin(1, extobj=[16, 1])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: UFUNC_PYVALS must be a length 3 list.
>>> np.sin(1, extobj=[16])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: UFUNC_PYVALS must be a length 3 list.
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(gh-15463)
xref gh-14778
As pointed out in the comment by @jamesthomasgriffin, we did not include a pxd file to expose the distribution functions documented in the random c-api. This PR adds a c_distributions.pxd file that exposes them.
Squashed commits:
* BUG: add missing c_distributions.pxd to enable cython use of random C-API
* ENH, TST: add npyrandom library like npymath, test cython use of it
* BUG: actually prefix f-string with f
* MAINT: fixes from review, add _bit_generato_bit_generator.pxd
* STY: fixes from review
* BLD: don't use nprandom library for mtrand legacy build
* TST: WindowsPath cannot be used in subprocess's list2cmdline
* MAINT, API: move _bit_generator to bit_generator
* DOC: add release note about moving bit_generator
* DOC, MAINT: fixes from review
* MAINT: redo dtype determination from review
|
|
|
| |
* DOC: Refactor polynomial docs using automodule.
|
|
|
|
|
| |
* DOC: fix coremath.rst to fix refguide_check
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
|
|\
| |
| | |
DOC: update datetime reference to pass refguide
|
| |
| |
| | |
Co-Authored-By: Eric Wieser <wieser.eric@gmail.com>
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
Remove example with timezone
Remove section on changes in NumPy 1.11
|
|\ \
| |/
|/| |
DEP: Do not allow "abstract" dtype conversion/creation
|
| |
| |
| |
| |
| | |
Add a comment that we can think about only allowing it for `dtype=...`
though...
|
| |
| |
| |
| | |
* DOC: Add missing imports, np prefix, fix printing, fix examples
Co-Authored-By: Eric Wieser <wieser.eric@gmail.com>
|
| |
| |
| |
| |
| | |
* DOC: fix imports and defs to pass refguide checks
Add empty file foo.c at runtime to run distutils config.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Deprecation fixes:
- Change Float64 example to float64.
- Remove shape=(1,) example for type strings.
Add missing np prefix.
Fix output to match current NumPy printing.
|
|/
|
|
|
|
|
|
|
|
| |
Fix missing np prefix.
Fix missing definitions.
Use print function instead of the statement.
Add seed to make output repeatable.
|
|\
| |
| | |
DEP: Schedule unused C-API functions for removal/disabling
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This function provides mainly the same API as PyObject_Call()
with the exception of skipping ufunc overrides and output array
wraps.
It is fairly unwieldy to use, since ownership of all inputs and
outputs is transferred, but otherwise it still uses args and kwargs
as inputs.
As such, no known usage exists and PyObject_Call seems a reasonable
replacement for possible usage. Keeping it around means that we would
may have to add tests or risk breaking this function when ufunc
code is refactored.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The function has no known usage outside of NumPy. It is fairly
complex to use due to how it behaves with scalars, and, at least
with a given "flexible" dtype would require additional access
to the private PyArray_AdaptFlexibleDType function.
Removing the function from public API will simplify refactor work
of the dtype and dimension recovery.
|
|\ \
| | |
| | | |
DOC: document site.cfg.example
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Thanks to Sergey Kojoian for the original patch to create
the docstring.
Closes gh-9258.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The old code examples did not actually run correctly and had a bug. They were
also never updated to use SeedSequence correctly. This fixes both.
* DOC, BUG: Fixes Multithreaded Generation docs
Working on #15365
The code runs now, but I get quite different runtimes than
in the example. May need some more work
* DOC: changes after PR review
* DOC: Changing input/output lines to sphinx standard
For ipython example: Adding `Out[i]` where i is the input cell number
and correcting vissual multiline inputs
* MAINT: Replace `jumped` by `SeedSequence` in multithreading snippet
After PR review, decided to replace `jumped` by `SeedSequence` as it is a more general method. Adopted the introduction to reflect this.
Also added a section on the reproducibility for different machines and number of threads + an example.
* MAINT: Changes after PR review
- Switch back to default_rng() instead of the Generator(BitGenerator)) syntax pursuant @rkern 's explanation in #15391
- small fixes
* MAINT: Delete unneccesary reference to PCG64
* MAINT: Added newline finxing codeblock error in docs
Trying to see whether this fixes circleci error
* MAINT: Clean up in imports of code snippet
|
| |/
|/|
| |
| |
| | |
This PR const qualifies the dimension and strides arguments of PyUFuncGenericFunction. Const qualified arguments make it simpler to reason about the behaviour of these ufuncs and prevents accidental mutation. As the const is now required this PR also const qualifies calls to PyUFuncGenericFunction inside the NumPy source code.
This closes #15252
|
| |
| |
| |
| |
| |
| |
| | |
This absolute beginners tutorial is the output of Anne's Google
Season of Docs project. An intermediate version was also published at
https://towardsdatascience.com/the-ultimate-beginners-guide-to-numpy-f5a2f99aef54
|
|\ \
| |/
|/| |
API: remove undocumented use of __array__(dtype, context)
|
| | |
|
| |
| |
| |
| |
| | |
This adds the additional deprecation of fastclip if it is set at
registration time instead of only testing that it is never used.
|
|\ \
| | |
| | | |
MAINT,API: ignore and NULL fasttake/fastputmask ArrFuncs slots
|
| | | |
|
| |/
|/| |
|
|\ \
| |/
|/| |
DOC: Add some missing functions in the list of available ufuncs.
|
| |
| |
| |
| | |
See #15214
|
| |
| |
| |
| |
| |
| | |
Marking these arguments as const makes it easier to reason about these functions, and prevent accidental mutation.
The C99 standard (6.2.5/26 "Types") guarantees that ABI compatibility is preserved here.
|
| |
| |
| |
| |
| |
| |
| | |
Inheriting from object was necessary for Python 2 compatibility to use
new-style classes. In Python 3, this is unnecessary as there are no
old-style classes.
Dropping the object is more idiomatic Python.
|
|/
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
|\
| |
| | |
DOC: Fix typos, via a Levenshtein-style corrector
|
| | |
|
|/
|
| |
* DOC: Add links to scipy linalg fuctions and compare numpy.linalg vs scipy.linalg.
|
|\
| |
| | |
API: Use `ResultType` in `PyArray_ConvertToCommonType`
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This slightly modifies the behaviour of `np.choose` (practically a
bug fix) and the public function itself. The function is not used within
e.g. SciPy, so the small performance hit of this implementation
is probably insignificant.
The change should help clean up dtypes a bit, since the whole "scalar
cast" logic is brittle and should be deprecated/removed, and this is
probably one of the few places actually using it.
The choose change means that:
```
np.choose([0], (1000, np.array([1], dtype=np.uint8)))
```
will actually return a value of 1000 (the dtype not being uint8).
|
| |
| |
| |
| | |
Remove reference to outdated basic RNG
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| | |
[skip ci]
|
| |
| |
| |
| |
| |
| |
| | |
See publication by O'Neill (reference 2):
"The name for the family, PCG, stands for permuted congruential
generator [...]"
|