Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ENH: lib: Allow usecols to be a callable in loadtxt(). #21800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 15 commits into
base: main
Choose a base branch
Loading
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TMP: Move code that checks sizes of integers
  • Loading branch information
WarrenWeckesser committed Jun 29, 2022
commit b28370900807bf14764cee0abb1e3071fb8c8df0
14 changes: 7 additions & 7 deletions 14 numpy/core/src/multiarray/textreading/readtext.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ _load_from_filelike(PyObject *NPY_UNUSED(mod),
};
bool filelike = true;

if (sizeof(npy_intp) != sizeof(Py_ssize_t)) {
PyErr_Format(PyExc_RuntimeError,
"sizeof(npy_intp) = %zu, sizeof(Py_ssize_t) = %zu\n",
sizeof(npy_intp), sizeof(Py_ssize_t));
return NULL;
}

NPY_PREPARE_ARGPARSER;
if (npy_parse_arguments("_load_from_filelike", args, len_args, kwnames,
"file", NULL, &file,
Expand All @@ -159,13 +166,6 @@ _load_from_filelike(PyObject *NPY_UNUSED(mod),
return NULL;
}

if (sizeof(npy_intp) != sizeof(Py_ssize_t)) {
PyErr_Format(PyExc_RuntimeError,
"sizeof(npy_intp) = %zu, sizeof(Py_ssize_t) = %zu\n",
sizeof(npy_intp), sizeof(Py_ssize_t));
return NULL;
}

/* Reject matching control characters, they just rarely make sense anyway */
if (error_if_matching_control_characters(
pc.delimiter, pc.quote, pc.comment) < 0) {
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.