Skip to content

Commit

Permalink
Merge pull request #175 from efiring/add_infunnel
Browse files Browse the repository at this point in the history
Add infunnel wrapper, simplify code generation
ocefpaf authored Jul 23, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 2cb7b28 + a38476f commit c340736
Showing 12 changed files with 4,756 additions and 1,348 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
*.kdev4
.project
.pydevproject
*.orig

# Compiled source #
###################
6 changes: 4 additions & 2 deletions gsw/_utilities.py
Original file line number Diff line number Diff line change
@@ -40,16 +40,18 @@ def wrapper(*args, **kw):
# Wrapped ufuncs are constructed with the "types" attribute from the
# underlying ufunc.
if hasattr(f, "types"):
argtypes = f.types[0].split("->")[0]
argtypes, ret_types = f.types[0].split("->")
first_double = argtypes.index("d")
int_return = ret_types[0] == 'i'
else:
first_double = 0
int_return = False


def fixup(ret):
if hasduck:
return ret
if hasmasked:
if hasmasked and not int_return:
ret = np.ma.masked_invalid(ret)
if not hasarray and isinstance(ret, np.ndarray) and ret.size == 1:
try:
Loading

0 comments on commit c340736

Please sign in to comment.