summaryrefslogtreecommitdiff
path: root/numpy/f2py/auxfuncs.py
Commit message (Collapse)AuthorAgeFilesLines
* ENH: Generate wrappers for scalars with valueRohit Goswami2022-06-211-2/+6
|
* ENH: Support character string arraysPearu Peterson2022-06-051-21/+50
| | | | | | | | | | | | | | | | 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.
* MAINT,DOC: f2py cleanupRohit Goswami2021-09-201-3/+3
|
* Add test for gh17797.Pearu Peterson2021-01-181-0/+5
|
* convert shebang from python to python3 (#15687)Changqing Li2020-03-041-1/+1
| | | | Signed-off-by: Changqing Li <changqing.li@windriver.com>
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-051-1/+1
| | | | | | | 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.
* MAINT: Remove unnecessary 'from __future__ import ...' statementsJon Dufresne2020-01-031-2/+0
| | | | | As numpy is Python 3 only, these import statements are now unnecessary and don't alter runtime behavior.
* MAINT: Use new-style classes on 2.7Eric Wieser2017-07-241-1/+1
| | | | Deliberately avoids tests, to prevent introducing a failure on old-style classes later.
* MAINT: Remove commented out code blocksgfyoung2015-12-201-4/+0
|
* DOC: Use print only as function when print_function is imported from __future__gfyoung2015-12-191-1/+1
| | | | Closes gh-6863.
* STY: Break some long lines in numpy/f2py/*.py.Charles Harris2015-07-291-22/+23
| | | | | | | The fixes are generated by autopep8, which uses line continuation. There are 441 cases that it is unable to handle, involving strings, and that is more, and more delicate, work than I want to do at this time. The line continuation characters at least mark some of the long lines.
* STY: Make PEP8 fixes in numpy/f2pyCharles Harris2015-07-251-123/+244
| | | | | Decided to bite the bullet on this one. The code is certainly more readable, so should be easier to fix if we need to.
* STY: Make pyflakes fixes in numpy/f2pyCharles Harris2015-07-251-3/+28
|
* STY: Giant comma spacing fixup.Charles Harris2013-08-181-68/+68
| | | | | | | 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-21/+21
| | | | | | | | | | | | | | | | | | | 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-21/+20
| | | | | | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | | | | | | | | | | | | | 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-3/+3
| | | | | | | | | | | | 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.
* Merge pull request #3205 from charris/2to3-apply-dict-fixerCharles Harris2013-04-071-1/+1
|\ | | | | 2to3: apply `dict` fixer.
| * 2to3: apply `dict` fixer.Charles Harris2013-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Python3 `dict.items()`, `dict.keys()`, and `dict.values()` are iterators. This causes problems when a list is needed so the 2to3 fixer explicitly constructs a list when is finds on of those functions. However, that is usually not necessary, so a lot of the work here has been cleaning up those places where the fix is not needed. The big exception to that is the `numpy/f2py/crackfortran.py` file. The code there makes extensive use of loops that modify the contents of the dictionary being looped through, which raises an error. That together with the obscurity of the code in that file made it safest to let the `dict` fixer do its worst. Closes #3050.
* | Merge pull request #3202 from charris/2to3-reduce-fixupsnjsmith2013-04-071-2/+1
|\ \ | |/ |/| MAINT: Cleanup some imports involving reduce.
| * MAINT: Cleanup some imports involving reduce.Charles Harris2013-04-061-2/+1
| | | | | | | | | | | | | | | | | | | | Because reduce has been available in functools since Python 2.6 we can get rid of the version checks we currently have before we import it. Also removes some reduce related skips in tools/py3tool.py. We were already skipping the reduce fixer so this has no effect other than cleaning up the code.
* | 2to3: Apply `print` fixer.Charles Harris2013-04-061-1/+1
|/ | | | | | | 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-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+3
| | | | | | | | 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.
* 2to3: Apply `raise` fixes. Closes #3077.Charles Harris2013-03-011-1/+1
| | | | | | | | | | Replaces the raise Exception, msg: form with raise Exception(msg):
* WIP: implemented assumed shape support for Fortran subroutines.Pearu Peterson2011-02-261-0/+15
|
* 3K: f2py: make f2py run far enough to produce output files (they don't ↵Pauli Virtanen2010-03-061-21/+21
| | | | compile yet, though, as the C code is not Py3 compatible)
* 3K: BUG: work around bugs in Python 3.1.1 2to3 by not using fixes_reducePauli Virtanen2010-02-201-0/+3
| | | | Instead, manually import reduce where necessary.
* 3K: f2py: use integer division to avoid problems with string multiplicationPauli Virtanen2010-02-201-1/+1
|
* Introduced intent(align4|align8|align16) attributes. Fixes scipy ticket 794 ↵Pearu Peterson2009-10-251-1/+11
| | | | after using intent(align8) in the corresponding scipy pyf files.
* Removed unused/redundant imports.Alan McIntyre2008-09-181-2/+0
| | | | PEP8 conformance (only one import per line).
* Fix issue 587Pearu Peterson2008-04-091-4/+24
|
* use 'in' keyword to test dictionary membershipJarrod Millman2007-11-281-116/+290
|
* using faster string methods rather than deprecated string moduleJarrod Millman2007-10-291-6/+9
|
* clean up unused imports and bad whitespaceTim Leslie2007-01-091-1/+0
|
* Run reindent.py (script distributed with Python) over the source to remove ↵cookedm2006-03-101-4/+2
| | | | extraneous whitespace
* Change License text to NumPy License (permission granted by Pearu)Travis Oliphant2006-01-201-1/+2
|
* Moved scipy directory to numpyTravis Oliphant2006-01-041-0/+489