Repository navigation
ENH: f2py: add --f2cmap option for specifying the name of .f2py_f2cmap - #15106
Conversation
|
I've gone ahead and marked all the 64 bit updates for backport. Is that safe? |
Previously, f2py loaded the type mappings from a file ``.f2py_f2cmap`` in current directory, at import time. Make the file name customizable by adding a ``--f2cmap`` command line option, and postpone loading the file to f2py.run_main(). Moreover, restore the default type mapping in f2py.run_main() before loading the customizations, so that multiple calls to f2py.run_main() do not interfere with each other. (For example, numpy.distutils calls f2py multiple times in the same process.)
Distutils code needs to run in different temporary directories, probably because they create `_configtest.c` files for compiler detection in the current directory.
|
@charris: I think those things are now converged, and I don't think the changes break other things (I've been able to build Scipy with some modules converted to 64-bit BLAS with passing test suite, running on the 64-bit numpy). Of course, it's not fully optimal that it's so close to release deadline, and 64-bit BLAS/LAPACK CIs are not up yet. |
|
Note that this PR doesn't need backport necessarily --- we can also just monkeypatch this in Scipy (to set f2py default integer sizes). |
|
If it's safe, I'd just as soon have everything in 1.18. |
|
AFAIK, this PR should be safe (e.g. --f2cmap in f2py_options works properly in scipy setup.py), and the change is fairly straightforward. |
|
Should get a mention in the 1.18 release note. |
|
Added release note fragment. |
|
Thanks Pauli. |
Previously, f2py loaded the type mappings from a file
.f2py_f2cmapin current directory, at import time.
Make the file name customizable by adding a
--f2cmapcommand lineoption, and postpone loading the file to f2py.run_main().
Restore the default type mapping in f2py.run_main() before
loading the customizations, so that multiple calls to f2py.run_main() do
not interfere with each other. (For example, numpy.distutils calls f2py
multiple times in the same process.)
Moreover, add documentation for the
.f2py_f2cmapfile (copypastedfrom the old f2py FAQ on archive.org), and fix a race condition bug in
the f2py test suite which caused the tests to sometimes not be run
when using pytest-xdist.
cc @pearu
Closes: gh-15096