summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
* TST: Expand `TestNanFunctions_NumberTypes` with 0d arraysBas van Beek2021-09-091-12/+17
|
* TST: Make nanfunc test ignore overflow instead of xfailing testSebastian Berg2021-09-071-3/+1
| | | | | | This makes the test more precise, and I ran into having to broaden the xfails otherwise, because right now reduce-likes incorrectly faile to give floating point warnings (and I was fixing that).
* MAINT: Let `_remove_nan_1d` attempt to identify nan-containing object arraysBas van Beek2021-09-051-2/+4
| | | | Use the same approach as in numpy/numpy#9013
* MAINT: Copy the `_methods._std` code-path for handling `nanstd` object-arraysBas van Beek2021-09-041-6/+3
| | | | https://github.com/numpy/numpy/blob/410a89ef04a2d3c50dd2dba2ad403c872c3745ac/numpy/core/_methods.py#L265-L270
* TST: Add more tests for `nanmedian`, `nanquantile` and `nanpercentile`Bas van Beek2021-09-031-0/+17
|
* TST: Expand the old `TestNanFunctions_IntTypes` test with non-integer number ↵Bas van Beek2021-09-031-71/+52
| | | | types
* BUG: Fixed an issue wherein certain `nan<x>` functions could fail for object ↵Bas van Beek2021-09-031-3/+20
| | | | arrays
* Merge pull request #19815 from mwtoews/maint-ioerrorCharles Harris2021-09-024-11/+12
|\ | | | | MAINT: revise OSError aliases (IOError, EnvironmentError)
| * MAINT: revise OSError aliases (IOError, EnvironmentError)Mike Taves2021-09-024-11/+12
| |
* | MAINT: Make the `_SupportsGetItem` protocol positional-onlyBas van Beek2021-09-021-1/+1
| |
* | ENH: Use custom file-like protocols instead of `typing.IO`Bas van Beek2021-09-021-17/+32
|/
* Merge pull request #19781 from mwtoews/foreach-itemMatti Picus2021-09-015-33/+29
|\ | | | | MAINT: refactor "for ... in range(len(" statements
| * MAINT: refactor "for ... in range(len(" statementsMike Taves2021-09-015-33/+29
| |
* | STY: Use the PEP 457 positional-only syntax in the stub filesBas van Beek2021-08-314-13/+18
| |
* | MAINT: Drop .pyi code-paths specific to Python 3.7Bas van Beek2021-08-309-38/+12
|/
* Merge pull request #19725 from anntzer/loadtxt-fh-closingMatti Picus2021-08-261-14/+12
|\ | | | | MAINT: Use a contextmanager to ensure loadtxt closes the input file.
| * MAINT: Use a contextmanager to ensure loadtxt closes the input file.Antony Lee2021-08-221-14/+12
| | | | | | | | | | | | | | | | This seems easier to track that a giant try... finally. Also move the `fencoding` initialization to within the contextmanager, in the rather unlikely case an exception occurs during the call to `getpreferredencoding`.
* | MAINT: Avoid use of confusing compat aliases.Antony Lee2021-08-241-2/+2
| | | | | | | | | | | | | | | | | | As of Py3, np.compat.unicode == str, but that's not entirely obvious (it could correspond to some numpy dtype too), so just use plain str. Likewise for np.compat.int. tests are intentionally left unchanged, as they can be considered as implicitly testing the np.compat.py3k interface as well.
* | STY: Slight style changeCharles Harris2021-08-221-1/+1
| |
* | PERF: Optimize loadtxt usecols.Antony Lee2021-08-221-10/+15
|/ | | | | | 7-10% speedup in usecols benchmarks; it appears that even in the single-usecol case, avoiding the iteration over `usecols` more than compensates the cost of the extra function call to usecols_getter.
* Merge pull request #19693 from anntzer/loadtxtinlinereaddataCharles Harris2021-08-221-33/+18
|\ | | | | MAINT: In loadtxt, inline read_data.
| * MAINT: In loadtxt, inline read_data.Antony Lee2021-08-171-33/+18
| | | | | | | | | | | | No speed difference; the point is to avoid an unnecessary inner generator (which was previously defined quite far away from its point of use).
* | DOC: Fix typo in `unwrap` docstring.Ghiles Meddour2021-08-171-1/+1
|/
* Merge pull request #19627 from ankitdwivedi23/ankitd/vectorize-ignore-whitespaceCharles Harris2021-08-162-0/+17
|\ | | | | BUG: Ignore whitespaces while parsing gufunc signatures
| * replace whitespaces in the signature argumentAnkit Dwivedi2021-08-121-4/+5
| |
| * dummy change to kick off another buildAnkit Dwivedi2021-08-081-1/+1
| |
| * fix lint errorsAnkit Dwivedi2021-08-072-2/+4
| |
| * ignore whitespaces while parsing gufunc signaturesAnkit Dwivedi2021-08-071-3/+3
| |
| * add tests to check if whitespaces are ignored in gufunc signaturesAnkit Dwivedi2021-08-071-0/+14
| |
* | Merge pull request #19680 from BvB93/fromregexCharles Harris2021-08-163-5/+11
|\ \ | | | | | | ENH: Allow `np.fromregex` to accept `os.PathLike` implementations
| * | ENH: Allow `np.fromregex` to accept `os.PathLike` implementationsBas van Beek2021-08-163-5/+11
| | |
* | | ENH: Add annotations for `np.lib.stride_tricks`Bas van Beek2021-08-161-9/+75
|/ /
* | ENH: Add annotations for `np.lib.npyio`Bas van Beek2021-08-131-81/+232
| |
* | Merge pull request #19609 from anntzer/loadtxtstaticdecoderCharles Harris2021-08-111-26/+38
|\ \ | |/ |/| PERF: In loadtxt, decide once and for all whether decoding is needed.
| * Move loadtxt bytes/str detection much earlier.Antony Lee2021-08-061-14/+21
| |
| * loadtxt: Preconstruct a (lineno, words) iterator to pass to read_data.Antony Lee2021-08-061-21/+20
| | | | | | | | | | Mostly to help later speedups, but also slightly optimizes `len(vals) == 0` into a bool check (in `filter`).
| * PERF: In loadtxt, decide once and for all whether decoding is needed.Antony Lee2021-08-061-6/+12
| | | | | | | | | | | | | | ... and use a single decoder function instead of repeatedly checking the input type (in `_decode_line`). ~5-8% speedup.
* | Merge pull request #19615 from rossbar/rm-deprecated-npyio-fnsCharles Harris2021-08-064-96/+2
|\ \ | | | | | | MAINT: Proposal to expire three deprecated functions in numpy.lib.npyio
| * | Rm numpy.lib.npyio.mafromtxt.Ross Barnowski2021-08-053-43/+1
| | |
| * | Rm numpy.lib.npyio.ndfromtxt.Ross Barnowski2021-08-053-41/+1
| | |
| * | Rm numpy.lib.npyio.loads.Ross Barnowski2021-08-053-13/+1
| | |
* | | Merge pull request #19620 from anntzer/loadtxtconvstrCharles Harris2021-08-061-5/+5
|\ \ \ | | | | | | | | PERF: Simplify some of loadtxt's standard converters.
| * | | PERF: Simplify some of loadtxt's standard converters.Antony Lee2021-08-061-5/+5
| | |/ | |/| | | | | | | | | | | | | | | | Standard converters only ever get called with str inputs (loadtxt performs the required decoding); saving a bunch of runtime typechecks (in `asstr`) results in a 15-20% speedup when loadtxt()ing the corresponding types.
* | | MAINT: Skip a type check in loadtxt when using user converters.Antony Lee2021-08-061-6/+4
|/ / | | | | | | | | | | loadtxt only ever calls converters with strs now, so the type check is unneeded. Skipping the type check may have a tiny performance benefit, but the main point is just code clarity.
* | Merge pull request #19612 from BvB93/testCharles Harris2021-08-061-1/+5
|\ \ | | | | | | TST: Bump the python 3.10 test version from beta4 to rc1
| * | TST: Skip `test_lookfor` in 3.10rc1Bas van Beek2021-08-061-1/+5
| | | | | | | | | | | | Broken in rc1 as of bpo-44524
* | | PERF: Special-case single-converter in loadtxt.Antony Lee2021-08-061-42/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ~5-13% speedup: `[*map(conv, items)]` (single converter, which is quite common) is much faster than `[conv(val) for conv, val in zip(converters, vals)]`. `_loadtxt_floatconv` and `fencode` were lifted out so that every "instance" of them is the same, allowing checking for whether there's different converters in use (actually, it looks like two `floatconv`s returned by two separate calls to `_getconv` have the same identity, but we don't need to rely on that.
* | | MAINT: In loadtxt, refactor detection of the number of columns. (#19616)Antony Lee2021-08-051-15/+12
| |/ |/| | | | | | | `for... else...` seems more idiomatic than manual iteration and catching StopIteration. Also rename the slightly cryptic `N` to a clearer `ncols`.
* | PERF: Speed-up common case of loadtxt()ing non-hex floats. (#19598)Antony Lee2021-08-052-4/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | * PERF: Speed-up common case of loadtxt()ing non-hex floats. `python runtests.py --bench bench_io` reports a ~5-10% perf gain. * TST: Add tests to check fromhex not called unintentionally. Adds regression tests to check that the logic surrounding when the default floatconv applies the fromhex conversion does not change. Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* | Merge pull request #19608 from anntzer/loadtxtspecialpackerMatti Picus2021-08-041-11/+16
|\ \ | | | | | | PERF: Specialize loadtxt packer for uniform-dtype data.