summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | DOC: disambiguate :: in rst. (#21037)Matthias Bussonnier2022-02-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having the `::` on new line can be ambiguous for RST parsers, as `:` is a valid character for header underlines. And as underlines do not have to be as long as the title for some rst parser this appears to be a title. Workaround is to have either a blank line, or put the `::` at the end of previous one.
* | | | DOC: Include special case in `hsplit` doc (#20974)Bharat Raghunathan2022-02-091-1/+7
| | | |
* | | | Merge pull request #20580 from seberg/add-npreadtextMatti Picus2022-02-083-341/+1490
|\ \ \ \ | | | | | | | | | | ENH: Move `loadtxt` to C for much better speed
| * | | | Add two new examples of converters to docstring examplesRoss Barnowski2022-02-071-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | - Floats with underscores - Floats + hex floats.
| * | | | TST: Skip error test using on PyPy (test uses %.100R)Sebastian Berg2022-01-301-0/+2
| | | | |
| * | | | TST: Fix exception msg matching in tests.Ross Barnowski2022-01-281-5/+5
| | | | |
| * | | | Linting.Ross Barnowski2022-01-281-3/+4
| | | | |
| * | | | Handle delimiter as bytes.Ross Barnowski2022-01-282-1/+9
| | | | |
| * | | | Add test for str dtype len discovery with converters.Ross Barnowski2022-01-281-1/+23
| | | | | | | | | | | | | | | | | | | | nrows gt chunksize.
| * | | | Add test for empty string as control characters.Ross Barnowski2022-01-282-0/+16
| | | | | | | | | | | | | | | | | | | | Includes comments param, which is handled on the Python side.
| * | | | Add test for unicode, parametrize for chunksize.Ross Barnowski2022-01-281-5/+15
| | | | |
| * | | | Add test for datetime parametric unit discovery.Ross Barnowski2022-01-281-1/+23
| | | | |
| * | | | TST: Some tests for control character collisions.Ross Barnowski2022-01-282-6/+57
| | | | | | | | | | | | | | | Adds some tests for the behavior of control characters, e.g. comments, delimiter and quotechar, when they have the same value. At this stage, these tests are more to frame the discussion about what the behavior should be, not to test what it currently is. I personally think raising an exception is correct for most of these situations, though it's worth noting that np.loadtxt currently doesn't for most of these corner cases (and seems to randomly assign precedence to delimiter over comments or vice versa depending on the values).
| * | | | TST: Use repr in byteswapping testsSebastian Berg2022-01-191-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `str` values for those weird values used for longdouble are truncated by PyPy's complex `str` output. Which seems fine probably since PyPy's `repr` does the right thing and will not truncate.
| * | | | TST: Catch two more errors that runs into the PyPy issueSebastian Berg2022-01-191-0/+4
| | | | |
| * | | | TST: Use hand-picked values for byte-swapping testsSebastian Berg2022-01-191-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Longdouble is a source of problems here especially (mainly due to it sometimes using double in the background, or maybe just buggy implementations). Together with strings that correctly parsed do not roundtrip (if printed using less precision), things just do not work out... This fixes it, and is simpler/clearer anyway.
| * | | | TST: Skip unparsable field error tests on PyPySebastian Berg2022-01-192-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PyPy has a small bug with error formatting, so these cause it to crash. Simply skip the tests on old PyPy versions for now. (Matti fixed the issue long ago, just waiting for a new PyPy release :))
| * | | | Add quotechar to examples.Ross Barnowski2022-01-181-1/+21
| | | | |
| * | | | Update and add converters examples.Ross Barnowski2022-01-181-1/+33
| | | | |
| * | | | TST,BUG: Fortify byteswapping tests and make a small fixSebastian Berg2022-01-151-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I had a lingering feeling I should double check this, turns out that feeling was right ;). (Fixes up the tokenizer doc a bit.)
| * | | | BUG: Fix loadtxt no data warning stacklevelSebastian Berg2022-01-141-1/+1
| | | | |
| * | | | DOC: Remove outdated loadtxt TODOs from codeSebastian Berg2022-01-141-3/+5
| | | | |
| * | | | TST,STY: Add small additional tests for converters/usecolsSebastian Berg2022-01-142-20/+27
| | | | | | | | | | | | | | | | | | | | | | | | | Also fix style a bit to silence linter (hopefully), removes some black style, but I am not too opinionated about that :)
| * | | | TST: Move most new loadtxt tests to its own fileSebastian Berg2022-01-142-767/+836
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also adds two basic new tests around files/strings containing the \0 character (prooving that we handle that gracefully). Also adds tests for: * the `_` thousands delimiter (should fail, but doesn't for float128 right now) * Failure modes when the number of rows changes (negative specifically) Many of these tests came originally from Warren Weckesser and others were added by Ross Barnowsky: Co-authored-by: Warren Weckesser <warren.weckesser@gmail.com> Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
| * | | | MAINT: Use skiplines rather than skiprows internally throughoutSebastian Berg2022-01-141-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Skiplines is just the more clear names since "rows" make a lot of sense for output rows (which implies that a line is not empty for example)
| * | | | TST: Add test for hard/impossible to reach universal-newline support pathsSebastian Berg2022-01-141-0/+15
| | | | |
| * | | | TST: Improve test coverage, replace impossible error with assertSebastian Berg2022-01-141-0/+49
| | | | |
| * | | | TST,MAINT: New tests, byteswap cleanups and fixed assertSebastian Berg2022-01-141-6/+25
| | | | |
| * | | | TST,BUG: Additional bad-file-like test, add missing error path freeSebastian Berg2022-01-141-0/+14
| | | | | | | | | | | | | | | | | | | | And remove one silly leftover struct member that was unused
| * | | | MAINT,TST,BUG: Simplify streamer init, fix issues, and add testsSebastian Berg2022-01-141-0/+45
| | | | |
| * | | | ENH: Give warning for empty-lines not counting towards max-rowsSebastian Berg2022-01-141-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also slightly cleans up the empty-line handling: previously we sometimes just had some extra empty-lines that just effectively never mattered
| * | | | MAINT: Move usecol handling to C and support more than integer colsSebastian Berg2022-01-142-19/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Of course to actually use that many columns you need A LOT of memory right now. Each field stores at least a UCS4 NUL character, but the field is padded enough to require 16 bytes. We always parse a full row, so that requires 20 bytes per field... (i.e. 32 GiB RAM is not enough to test this :)).
| * | | | TST: Add test to cover copyswap (byte-swap and unaligned)Sebastian Berg2022-01-141-0/+13
| | | | |
| * | | | BUG,TST: Add test for huge-float buffer path and ensure error returnSebastian Berg2022-01-141-0/+9
| | | | | | | | | | | | | | | | | | | | If a memory error happens, we should at least not crash the interpreter
| * | | | BUG: Fix complex parser and add tests for whitespace and failure pathsSebastian Berg2022-01-141-0/+27
| | | | |
| * | | | Add warning on empty file + tests.Ross Barnowski2022-01-142-10/+9
| | | | |
| * | | | Add UserWarning when reading no data.Ross Barnowski2022-01-142-0/+30
| | | | |
| * | | | rm incorrect comment.Ross Barnowski2022-01-141-1/+0
| | | | |
| * | | | Add tests for empty quotes and escaped quotechars.Ross Barnowski2022-01-141-0/+14
| | | | |
| * | | | TST: structured dtype w/ quotes.Ross Barnowski2022-01-141-0/+29
| | | | |
| * | | | Add tests for quote+multichar comments.Ross Barnowski2022-01-142-2/+25
| | | | | | | | | | | | | | | | | | | | Also correct exception message.
| * | | | Add test to check quoting support disabled by default.Ross Barnowski2022-01-141-0/+16
| | | | |
| * | | | TST: Add tests for quote character support.Ross Barnowski2022-01-141-0/+15
| | | | |
| * | | | Rename quotechar param and update docstring.Ross Barnowski2022-01-141-6/+13
| | | | |
| * | | | TST: Fix test to align with stricter integer parsingSebastian Berg2022-01-141-24/+4
| | | | |
| * | | | TST: Small fixups for tests to make sure they pass againSebastian Berg2022-01-141-3/+3
| | | | |
| * | | | Port over tests from npreadtext test suiteRoss Barnowski2022-01-141-0/+484
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add test for parsing scientific notation. - Add multiple-char comment test. - Port over tests for structured dtypes. - Add tests for exceptions on skiprows/max_rows. - port over ndmin tests. - Make structured data reusable, add unpack tests. - Port over delimiter tests. - Port over maxrows test w/ various dtypes. - Port over test of exception msg on parse failure. - Port over test for converters w/neg indices. - Port over usecols tests - Port over unicode tests. - Port over more converter tests. - Port over test for large rows. - Port over test for string-len discovery. - Port over float conversion accuracy test. - Port over bool test. - Add test for implicit float->int conversion. - Port over complex parsing tests. - Port over tests for reading from generator. - Port over object cleanup test. - Port over bytes incompat test. - Port over converters tests. Co-authored-by: Warren Weckesser <warren.weckesser@gmail.com> Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
| * | | | ENH: Reject empty string as control characterSebastian Berg2022-01-141-25/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `None` is forced instead in all cases (mainly applies to comments). This is not really a change in behaviour: It was always utterly broken. The one weird thing about it is that `delimiter=None` means "any whitespace", while `quote=None` and `comments=None` means that no quote/comment character exists at all.
| * | | | ENH: Raise an error for (most) stray newline charactersSebastian Berg2022-01-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it strict that newline characters _within_ a single line (which is only possible if the user passes in a manual iterator of strings), is considered weird and rejected. An example is: `np.loadtxt(['1\n1', "2 2"], dtype=np.int64)`
| * | | | MAINT: Address Tylers review commentsSebastian Berg2022-01-141-3/+0
| | | | | | | | | | | | | | | | | | | | (Mainly revising the doc strings)