[Numpy-svn] r4996 - trunk/numpy/f2py

numpy-svn@scip... numpy-svn@scip...
Wed Apr 9 06:53:06 CDT 2008


Author: pearu
Date: 2008-04-09 06:53:02 -0500 (Wed, 09 Apr 2008)
New Revision: 4996

Modified:
   trunk/numpy/f2py/auxfuncs.py
   trunk/numpy/f2py/rules.py
Log:
Fix issue 587

Modified: trunk/numpy/f2py/auxfuncs.py
===================================================================
--- trunk/numpy/f2py/auxfuncs.py	2008-04-09 11:38:26 UTC (rev 4995)
+++ trunk/numpy/f2py/auxfuncs.py	2008-04-09 11:53:02 UTC (rev 4996)
@@ -148,17 +148,37 @@
     and get_kind(var)=='1'
 
 def isunsigned_chararray(var):
-    return isarray(var) and var.get('typespec')=='integer' and get_kind(var)=='-1'
+    return isarray(var) and var.get('typespec') in ['integer', 'logical']\
+           and get_kind(var)=='-1'
 
 def isunsigned_shortarray(var):
-    return isarray(var) and var.get('typespec')=='integer' and get_kind(var)=='-2'
+    return isarray(var) and var.get('typespec') in ['integer', 'logical']\
+           and get_kind(var)=='-2'
 
 def isunsignedarray(var):
-    return isarray(var) and var.get('typespec')=='integer' and get_kind(var)=='-4'
+    return isarray(var) and var.get('typespec') in ['integer', 'logical']\
+           and get_kind(var)=='-4'
 
 def isunsigned_long_longarray(var):
-    return isarray(var) and var.get('typespec')=='integer' and get_kind(var)=='-8'
+    return isarray(var) and var.get('typespec') in ['integer', 'logical']\
+           and get_kind(var)=='-8'
 
+def issigned_chararray(var):
+    return isarray(var) and var.get('typespec') in ['integer', 'logical']\
+           and get_kind(var)=='1'
+
+def issigned_shortarray(var):
+    return isarray(var) and var.get('typespec') in ['integer', 'logical']\
+           and get_kind(var)=='2'
+
+def issigned_array(var):
+    return isarray(var) and var.get('typespec') in ['integer', 'logical']\
+           and get_kind(var)=='4'
+
+def issigned_long_longarray(var):
+    return isarray(var) and var.get('typespec') in ['integer', 'logical']\
+           and get_kind(var)=='8'
+
 def isallocatable(var):
     return 'attrspec' in var and 'allocatable' in var['attrspec']
 

Modified: trunk/numpy/f2py/rules.py
===================================================================
--- trunk/numpy/f2py/rules.py	2008-04-09 11:38:26 UTC (rev 4995)
+++ trunk/numpy/f2py/rules.py	2008-04-09 11:53:02 UTC (rev 4996)
@@ -517,12 +517,17 @@
 ################ Rules for arguments ##################
 
 typedef_need_dict = {islong_long:'long_long',
-            islong_double:'long_double',
-            islong_complex:'complex_long_double',
-            isunsigned_char:'unsigned_char',
-            isunsigned_short:'unsigned_short',
-            isunsigned:'unsigned',
-            isunsigned_long_long:'unsigned_long_long'}
+                     islong_double:'long_double',
+                     islong_complex:'complex_long_double',
+                     isunsigned_char:'unsigned_char',
+                     isunsigned_short:'unsigned_short',
+                     isunsigned:'unsigned',
+                     isunsigned_long_long:'unsigned_long_long',
+                     isunsigned_chararray:'unsigned_char',
+                     isunsigned_shortarray:'unsigned_short',
+                     isunsigned_long_longarray:'unsigned_long_long',
+                     issigned_long_longarray:'long_long',
+                     }
 
 aux_rules=[
     {



More information about the Numpy-svn mailing list