| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
This clears the error holding only to the type. Since in the other
path the errmessage seemed completely uninitialized, I opted to just
ignore it entirely and keep the old error.
I could fathom to use error chaining here, but overall, I am not even
sure that chaining makes even sense for these errors. This fix is
meant to be minimal (the second one, I just noticed randomly), it
does not make this code clean.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was giving many warnings like this one in the SciPy build:
```
scipy/special/_specfunmodule.c: In function 'complex_double_from_pyobj':
scipy/special/_specfunmodule.c:198:47: warning: passing argument 1 of 'PyArray_DATA' from incompatible pointer type [-Wincompatible-pointer-types]
198 | (*v).r = ((npy_cdouble *)PyArray_DATA(arr))->real;
| ^~~
| |
| PyObject * {aka struct _object *}
In file included from /home/rgommers/code/numpy/numpy/core/include/numpy/ndarrayobject.h:12,
from /home/rgommers/code/numpy/numpy/core/include/numpy/arrayobject.h:5,
from /home/rgommers/code/numpy/numpy/f2py/src/fortranobject.h:16,
from scipy/special/_specfunmodule.c:22:
/home/rgommers/code/numpy/numpy/core/include/numpy/ndarraytypes.h:1524:29: note: expected 'PyArrayObject *' {aka 'struct tagPyArrayObject *'} but argument is of type 'PyObject *' {aka 'struct _object *'}
1524 | PyArray_DATA(PyArrayObject *arr)
| ~~~~~~~~~~~~~~~^~~
```
Fixing pointer mismatches is important for Pyodide/Emscripten.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TST: added test for issue #18684
ENH: f2py opens files with correct encoding, fixes #635
TST: added test for issue #6308
TST: added test for issue #4519
TST: added test for issue #3425
ENH: Implement user-defined hooks support for post-processing f2py data structure. Implement character BC hook.
ENH: Add support for detecting utf-16 and utf-32 encodings.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Closes https://github.com/rgommers/scipy/issues/125
This is a follow-up of gh-18910 (included in 1.20.3 and 1.21.0), which
looks incorrect.
This fixes warnings like these when building SciPy with Mingw-w64:
```
[94/1557] Compiling C object scipy/linalg/_flapack.cp39-win_amd64.pyd.p/meson-generated_..__flapackmodule.c.obj
In file included from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:4,
from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/ndarrayobject.h:12,
from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/arrayobject.h:4,
from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\f2py\src/fortranobject.h:13,
from scipy/linalg/_flapackmodule.c:16:
scipy/linalg/_flapackmodule.c:1248:1: warning: 'thread' attribute directive ignored [-Wattributes]
1248 | static F2PY_THREAD_LOCAL_DECL cb_cselect_in_gees__user__routines_t *_active_cb_cselect_in_gees__user__routines = NULL;
| ^~~~~~
scipy/linalg/_flapackmodule.c:1410:1: warning: 'thread' attribute directive ignored [-Wattributes]
1410 | static F2PY_THREAD_LOCAL_DECL cb_zselect_in_gees__user__routines_t *_active_cb_zselect_in_gees__user__routines = NULL;
| ^~~~~~
scipy/linalg/_flapackmodule.c:1572:1: warning: 'thread' attribute directive ignored [-Wattributes]
1572 | static F2PY_THREAD_LOCAL_DECL cb_sselect_in_gees__user__routines_t *_active_cb_sselect_in_gees__user__routines = NULL;
| ^~~~~~
scipy/linalg/_flapackmodule.c:1738:1: warning: 'thread' attribute directive ignored [-Wattributes]
1738 | static F2PY_THREAD_LOCAL_DECL cb_dselect_in_gees__user__routines_t *_active_cb_dselect_in_gees__user__routines = NULL;
| ^~~~~~
...
```
Also fixes gh-19437, where `__STDC_NO_THREADS__` should be defined but
isn't (this seems to be more common, e.g. one can reports for ICC about
this).
|
|
|
|
| |
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
|
|
|
|
|
|
|
| |
* MAINT: More data type API for f2py
* MAINT: Less DeprecationWarnings for f2py
* MAINT: Fix casts for complex arrays in f2py
|
| |
|
|
|
|
|
|
|
| |
- Replace "Python.h" by <Python.h>
- Replace "structmember.h" by <structmember.h>
- Replace <npy_config> by "npy_config"
- Define PY_SSIZE_T_CLEAN before all Python.h includes in .c files.
|
|
|
|
| |
and copy (the second round)
|
|
|
|
| |
malloc and copy." (#19235)
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* defined(__STDC_NO_THREADS__) can be trusted only when using glibc > 2.12
* Add __GLIBC__ defined check.
|
|
|
|
|
|
|
|
|
|
| |
- Replace npy_3kcompat macro PyInt_AsLong by appropriate definition
- Replace npy_3kcompat macro PyInt_AS_LONG by appropriate definition.
- Reformat code for readability.
The code in extensively reformated in this PR which may hide the most
important parts of the diff, but I needed to do it to make the code
readable.
|
|\
| |
| | |
MAINT: Replace remaining PyString macros.
|
| |
| |
| |
| |
| |
| |
| | |
Replace remaining npy_3kcompat PyString macros with their definition.
- PyString_AS_STRING -> PyBytes_AS_STRING
- PyString_GET_SIZE -> PyBytes_GET_SIZE
|
| |
| |
| |
| | |
Replace the npy_3kcompat macro PyNumber_Int by its definition.
|
|/
|
|
| |
Replace the npy_3kcompat macro PyInt_FromLong by its definition.
|
|
|
|
| |
This replaces the npy_3kcompat macro PyStringObject with its definition.
|
|
|
|
| |
Replaces the npy_3kcompat PyString_Check macro with its definition.
|
|
|
|
|
|
|
|
| |
We no longer need to use the compatibility function after dropping
support for Python 2.7. In some cases unicode was the correct string
type rather than the bytes of the compatibility version and bugs in the
array `__complex__` and array `__array_interface__` methods have been
fixed by changing that.
|
|
|
|
|
| |
Move compiler thread-local declaration detection to a common macro.
Also support C11 thread_local declaration, if available.
|
|
|
| |
* BUG, TST: fix f2py for PyPy, skip one test for PyPy, xfail tests for s390x
|
|
|
|
|
|
|
| |
`global` is only needed if a variable appears on the left of an assignment.
These variables do not.
Most suffer from the misconception that `var[x] = y` requires `var` to be global, but it does not.
|
|
|
|
| |
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
|\
| |
| | |
MAINT: Cleaning up PY_MAJOR_VERSION/PY_VERSION_HEX
|
| | |
|
|/
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
| |
|
|
|
|
|
|
|
|
| |
Note that the extension module dict seems to be never dereferenced
(there is an additional reference to it kept around somewhere).
This reference seems to part of the C python module loading
(possibly intentionally), and I could not find how to remove it or
where it originates from.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Using \t here is just cryptic.
Done using a very basic find and replace.
|
| |
|
|
|
|
|
| |
Decided to bite the bullet on this one. The code is certainly more
readable, so should be easier to fix if we need to.
|
| |
|