Skip to content

Commit c340736

Browse files
authored
Merge pull request #175 from efiring/add_infunnel
Add infunnel wrapper, simplify code generation
2 parents 2cb7b28 + a38476f commit c340736

12 files changed

+4756
-1348
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*.kdev4
99
.project
1010
.pydevproject
11+
*.orig
1112

1213
# Compiled source #
1314
###################

gsw/_utilities.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,18 @@ def wrapper(*args, **kw):
4040
# Wrapped ufuncs are constructed with the "types" attribute from the
4141
# underlying ufunc.
4242
if hasattr(f, "types"):
43-
argtypes = f.types[0].split("->")[0]
43+
argtypes, ret_types = f.types[0].split("->")
4444
first_double = argtypes.index("d")
45+
int_return = ret_types[0] == 'i'
4546
else:
4647
first_double = 0
48+
int_return = False
4749

4850

4951
def fixup(ret):
5052
if hasduck:
5153
return ret
52-
if hasmasked:
54+
if hasmasked and not int_return:
5355
ret = np.ma.masked_invalid(ret)
5456
if not hasarray and isinstance(ret, np.ndarray) and ret.size == 1:
5557
try:

0 commit comments

Comments
 (0)