summaryrefslogtreecommitdiff
path: root/numpy/f2py/cfuncs.py
Commit message (Collapse)AuthorAgeFilesLines
...
* DEP: Using PyArray_SIZE and PyArray_TYPE instead of PyArray_DESCR()->elsize etcChris Kerr2014-11-101-5/+5
|
* DEP: Replaced arr->descr, arr->flags and arr->base with the PyArray_* functionsChris Kerr2014-11-101-16/+16
|
* DEP: replaced arr->dimensions with PyArray_DIMS(arr) or PyArray_DIM(arr,i)Chris Kerr2014-11-101-3/+3
|
* DEP: replaced arr->data with PyArray_DATAChris Kerr2014-11-101-49/+49
|
* DEP: replaced arr->nd with PyArray_NDIM in C code generation scriptsChris Kerr2014-11-101-5/+5
|
* Merge pull request #4305 from charris/fix-gh-4256Charles Harris2014-02-201-1/+1
|\ | | | | BUG: #4256: f2py, PyString_FromStringAndSize is undefined in Python3.
| * BUG: #4256: f2py, PyString_FromStringAndSize is undefined in Python3.Charles Harris2014-02-161-1/+1
| | | | | | | | | | | | | | | | | | Use PyUString_FromStringAndSize defined in npy_3kcompat instead. Not using bytes may cause some problems, but strings seem like a better choice. As modules generated with current f2py error out, this particular use is not common and we are free to choose. Closes #4256.
* | BUG: Fix typo in f2py/cfuncs.py.Charles Harris2014-02-161-1/+1
|/ | | | | | | Replace "insinged_long_long" by "unsigned_long_long". Patch due to trac user pepijndevos. Closes #636.
* BUG: f2py, fix decref on wrong objectJulian Taylor2013-09-121-2/+3
| | | | | | missing brackets causes decref on an wrong object. shows itself as abort with negative refcount in test_callback using python-dbg.
* STY: Giant comma spacing fixup.Charles Harris2013-08-181-32/+32
| | | | | | | Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long and will need to be broken at some point. OTOH, some lines were already too long and need to be broken at some point. Now seems as good a time as any to do this with open PRs at a minimum.
* MAINT: Apply 2to3 idioms fixer.Charles Harris2013-05-021-4/+4
| | | | | | | | | | | | | | | | | | | The idioms fixer makes the following replacements. 1) int <- bool 2) comparison or identity of types <- isinstance 3) a.sort() <- sorted(a) There were two problems that needed to be dealt with after the application of the fixer. First, the replacement of comparison or identity of types by isinstance was not always correct. The isinstance function returns true for subtypes whereas many of the places where the fixer made a substitution needed to check for exact type equality. Second, the sorted function was applied to arrays, but because it treats them as iterators and constructs a sorted list from the result, that is the wrong thing to do. Closes #3062.
* 2to3: Apply types fixer.Charles Harris2013-04-141-9/+7
| | | | | | | | | | | | | | | | | | | | Python 3 removes the builtin types from the types module. The types fixer replaces such references with the builtin types where possible and also takes care of some special cases: types.TypeNone <- type(None) types.NotImplementedType <- type(NotImplemented) types.EllipsisType <- type(Ellipsis) The only two tricky substitutions are types.StringType <- bytes types.LongType <- int These are fixed up to support both Python 3 and Python 2 code by importing the long and bytes types from numpy.compat. Closes #3240.
* 2to3: Apply `map` fixer.Charles Harris2013-04-101-1/+1
| | | | | | | | | | | | | | | | | | | In Python 3 `map` is an iterator while in Python 2 it returns a list. The simple fix applied by the fixer is to inclose all instances of map with `list(...)`. This is not needed in all cases, and even where appropriate list comprehensions may be preferred for their clarity. Consequently, this patch attempts to use list comprehensions where it makes sense. When the mapped function has two arguments there is another problem that can arise. In Python 3 map stops execution when the shortest argument list is exhausted, while in Python 2 it stops when the longest argument list is exhausted. Consequently the two argument case might need special care. However, we have been running Python3 converted versions of numpy since 1.5 without problems, so it is probably not something that affects us. Closes #3068
* 2to3: Apply `repr` fixer.Charles Harris2013-04-081-2/+2
| | | | | | | | | | | | This replaces python backtics with repr(...). The backtics were mostly used to generate strings for printing with a string format and it is tempting to replace `'%s' % repr(x)` with `'%r' % x`. That would work except where `x` happened to be a tuple or a dictionary but, because it would be significant work to guarantee that and because there are not many places where backtics are used, the safe path is to let the repr replacements stand. Closes #3083.
* 2to3: Apply `print` fixer.Charles Harris2013-04-061-2/+2
| | | | | | | Add `print_function` to all `from __future__ import ...` statements and use the python3 print function syntax everywhere. Closes #3078.
* 2to3: Use absolute imports.Charles Harris2013-03-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new import `absolute_import` is added the `from __future__ import` statement and The 2to3 `import` fixer is run to make the imports compatible. There are several things that need to be dealt with to make this work. 1) Files meant to be run as scripts run in a different environment than files imported as part of a package, and so changes to those files need to be skipped. The affected script files are: * all setup.py files * numpy/core/code_generators/generate_umath.py * numpy/core/code_generators/generate_numpy_api.py * numpy/core/code_generators/generate_ufunc_api.py 2) Some imported modules are not available as they are created during the build process and consequently 2to3 is unable to handle them correctly. Files that import those modules need a bit of extra work. The affected files are: * core/__init__.py, * core/numeric.py, * core/_internal.py, * core/arrayprint.py, * core/fromnumeric.py, * numpy/__init__.py, * lib/npyio.py, * lib/function_base.py, * fft/fftpack.py, * random/__init__.py Closes #3172
* 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-011-0/+2
| | | | | | | | This should be harmless, as we already are division clean. However, placement of this import takes some care. In the future a script can be used to append new features without worry, at least until such time as it exceeds a single line. Having that ability will make it easier to deal with absolute imports and printing updates.
* BUG: Exported f2py_size symbol prevents linking multiple f2py modules.Bradley M. Froehle2012-07-301-1/+1
|
* STY: f2py - replace macros in old_defines.h with new.Charles Harris2012-02-041-47/+47
|
* BUG: fix f2py size variadic macro for Visual C++ 2008 compiler. Also be ↵Pearu Peterson2011-05-181-1/+1
| | | | verbose on unspecified use modules.
* BUG: Fix two argument size support for Fortran module routines. Reverted ↵Pearu Peterson2011-05-061-1/+30
| | | | size-to-shape mapping patch and implemented two argument size function in C.
* BUG: f2py: fix creating string object from callback function using string size.Pearu Peterson2010-10-161-0/+2
|
* f2py: fixed typos in TRYCOMPLEXPYARRAYTEMPLATE.Pearu Peterson2010-07-111-4/+1
|
* 3K: f2py: make create_cb_arglist work with Py3 functionsPauli Virtanen2010-03-061-0/+10
|
* BUG: f2py: fix infinite loops in *_from_pyobj with unicode inputPauli Virtanen2010-03-061-5/+5
|
* 3K: f2py: port much of f2py C code to Py3Pauli Virtanen2010-03-061-11/+20
|
* 3K: f2py: map PyString -> PyBytes and PyInt -> PyLong on Py3Pauli Virtanen2010-03-061-0/+9
|
* 3K: f2py: address a semantic difference between Py2 and Py3Pauli Virtanen2010-03-061-1/+2
|
* 3K: f2py: make f2py run far enough to produce output files (they don't ↵Pauli Virtanen2010-03-061-1/+1
| | | | compile yet, though, as the C code is not Py3 compatible)
* ENH: Add support for PyCapsule.Charles Harris2010-02-251-1/+1
|
* BUG Fix ticket #1285. Problem located by cgranade.Charles Harris2009-11-061-1/+1
|
* BUG: fix f2py generated code for MSVC 9.David Cournapeau2009-09-211-0/+4
| | | | | MSVC already define min/max macros in standard headers, which causes trouble when f2py redefines them.
* Avoid putting things into stderr when errors occurs in f2py wrappers; put ↵David Cournapeau2009-01-081-4/+6
| | | | all the info in the python error string instead.
* Removed unused/redundant imports.Alan McIntyre2008-09-181-1/+3
| | | | PEP8 conformance (only one import per line).
* f2py: Allow expressions that contain max/min calls, be used as dimension ↵Pearu Peterson2008-05-191-0/+2
| | | | specifications. Defined macros min/max that are needed when --lower is used. Typical usage case: real a(min(1,n)).
* use 'in' keyword to test dictionary membershipJarrod Millman2007-11-281-18/+33
|
* Fix f2py and docTravis Oliphant2006-07-081-1/+1
|
* Fix f2py to use new namesTravis Oliphant2006-07-081-25/+25
|
* Do replacing nulls with ' ' after strncpy correctly in f2py.cfuncs.cookedm2006-05-201-23/+30
| | | | Also corrects some problems with buffer sizes
* Run reindent.py (script distributed with Python) over the source to remove ↵cookedm2006-03-101-57/+57
| | | | extraneous whitespace
* Change License text to NumPy License (permission granted by Pearu)Travis Oliphant2006-01-201-1/+1
|
* Moved scipy directory to numpyTravis Oliphant2006-01-041-0/+1134