Skip to content

Commit

Permalink
Merge pull request #595 from OP2/ReubenHill/complex-fixes
Browse files Browse the repository at this point in the history
Disallow MIN and MAX access on complex data
  • Loading branch information
wence- authored Sep 21, 2020
2 parents dac7202 + b27e8a0 commit d1955c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyop2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ def __init__(self, data=None, map=None, access=None, lgmaps=None, unroll_map=Fal
self.map_tuple = (map, )
else:
self.map_tuple = tuple(map)

if data is not None and hasattr(data, "dtype"):
if data.dtype.kind == "c" and (access == MIN or access == MAX):
raise ValueError("MIN and MAX access descriptors are undefined on complex data.")
self._access = access

self.unroll_map = unroll_map
Expand Down

0 comments on commit d1955c0

Please sign in to comment.