diff options
author | Travis Oliphant <oliphant@enthought.com> | 2005-12-16 22:31:40 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2005-12-16 22:31:40 +0000 |
commit | 2eb04a7259d196361a5a4a888778cef49d7879db (patch) | |
tree | eb4f464e32686ad7cde235805503fcb0755ff0be /scipy/base/convertcode.py | |
parent | 654d4d5a2d6c548d6bfffe48b784d05d8226968d (diff) | |
download | numpy-2eb04a7259d196361a5a4a888778cef49d7879db.tar.gz |
Updated convertcode. Added NOTSWAPPED flag as a possible input to PyArray_FromAny to simplify forcing a machine byte-order array.
Diffstat (limited to 'scipy/base/convertcode.py')
-rw-r--r-- | scipy/base/convertcode.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/scipy/base/convertcode.py b/scipy/base/convertcode.py index 4040ded59..cf1e9e7a0 100644 --- a/scipy/base/convertcode.py +++ b/scipy/base/convertcode.py @@ -28,11 +28,6 @@ import warnings import glob flatindex_re = re.compile('([.]flat(\s*?[[=]))') -int_re = re.compile('int\s*[(][^)]*[)]') -bool_re = re.compile('bool\s*[(][^)]*[)]') -float_re = re.compile('float\s*[(][^)]*[)]') -complex_re = re.compile('complex\s*[(][^)]*[)]') -unicode_re = re.compile('unicode\s*[(][^)]*[)]') def replacetypechars(astr): # astr = astr.replace("'s'","'h'") @@ -47,15 +42,10 @@ def changeimports(fstr, name, newname): importstr = 'import %s' % name importasstr = 'import %s as ' % name fromstr = 'from %s import ' % name - fromallstr = 'from %s import *' % name fromall=0 fstr = fstr.replace(importasstr, 'import %s as ' % newname) fstr = fstr.replace(importstr, 'import %s as %s' % (newname,name)) - if (fstr.find(fromallstr) >= 0): - warnings.warn('Usage of %s found.' % fromallstr) - fstr = fstr.replace(fromallstr, 'from %s import *' % newname) - fromall=1 ind = 0 Nlen = len(fromstr) @@ -98,18 +88,6 @@ def replaceother(astr): #astr = shpe.sub('\\1=\\1.reshape(\\2)', astr) return astr -def warnofnewtypes(filestr): - if int_re.search(filestr) or \ - float_re.search(filestr) or \ - complex_re.search(filestr) or \ - unicode_re.search(filestr) or \ - bool_re.search(filestr): - warnings.warn("Use of builtin bool, int, float, complex, or unicode\n" \ - "found when import * used -- these will be handled by\n" \ - "new array scalars under scipy") - - return - import datetime def fromstr(filestr): filestr = replacetypechars(filestr) @@ -130,8 +108,6 @@ def fromstr(filestr): fromall = fromall1 or fromall2 or fromall3 filestr = replaceattr(filestr) filestr = replaceother(filestr) - if fromall: - warnofnewtypes(filestr) today = datetime.date.today().strftime('%b %d, %Y') name = os.path.split(sys.argv[0])[-1] filestr = '## Automatically adapted for '\ |