| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
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 :))
|
|
|
|
|
| |
Also fix style a bit to silence linter (hopefully), removes some
black style, but I am not too opinionated about that :)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
| |
|
| |
|
|
|
|
| |
And remove one silly leftover struct member that was unused
|
| |
|
|
|
|
|
|
| |
This also slightly cleans up the empty-line handling: previously
we sometimes just had some extra empty-lines that just effectively
never mattered
|
|
|
|
|
|
|
|
| |
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 :)).
|
| |
|
|
|
|
| |
If a memory error happens, we should at least not crash the interpreter
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Also correct exception message.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
|
|
|
| |
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)`
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
In fromregex, add a check that verifies that the given dtype is
a structured datatype. This avoids confusing error messages that
can occur when the given data type is not structured.
Also tweaked the code in the Examples section.
Closes gh-8891.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
| |
Some more Python 2 cleanup.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since #15893, test_large_zip's actual test is run in a child process,
so when this test raises a MemoryError exception, the exception is
lost and the @requires_memory decorator can't catch it to return
an xfail.
This commit uses a boolean variable in shared memory to flag if
the exception was raised, and in that case, re-raise it in the
parent process.
Fixes #16889
|
| |
|
|
|
|
|
|
|
|
|
| |
This affected (for example?) if the `dtype=object` was used
without a converter, meaning that the default one is used.
And this is currently the last one, which is `string_` (and thus
bytes).
Closes gh-16189
|
| |
|
|
|
| |
* Run test_large_zip in a child process
|
|
|
| |
* BUG, TST: fix f2py for PyPy, skip one test for PyPy, xfail tests for s390x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These dtypes do not really make sense as instances. We can (somewhat)
reasonably define np.dtype(np.int64) as the default (machine endianess)
int64. (Arguably, it is unclear that `np.array(arr_of_>f8, dtype="f")`
should return arr_of_<f8, but that would be very noisy!)
However, `np.integer` as equivalent to long, is not well defined.
Similarly, `dtype=Decimal` may be neat to spell `dtype=object` when you
intend to put Decimal objects into the array. But it is misleading,
since there is no special meaning to it at this time.
The biggest issue with it, is that `arr.astype(np.floating)` looks
like it will let float32 or float128 pass, but it will force a
float64 output! Arguably downcasting is a bug in this case.
A related issue is `np.dtype("S")` and especially "S0". The dtype "S"
does make sense for most or all places where `dtype=...` can be
passed. However, it is conceptionally different from other dtypes, since
it will not end up being attached to the array (unlike "S2" which
would be). The dtype "S" really means the type number/DType class
of String, and not a specific dtype instance.
|
| |
|
|
|
|
| |
This implements NEP 34.
|
| |
|
|
|
|
|
|
|
| |
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.
|