Skip to content

operator.py: Raise not-implemented in matmul call

Gordian Edenhofer requested to merge nifty6_notimplemented into NIFTy_6

Contrary to other overloaded operators, the __matmul__ call apparently needs to raise an exception instead of returning NotImplemented. This behaviour can be seen for example in:

psp = ift.RGSpace(512)
m = ift.MaskOperator(ift.Field.from_raw(psp, np.random.randint(0, 2, 512)))
m(ift.from_random("normal", m.domain).val) is NotImplemented

which should be invalid and raise an exception but previously returned True instead.

Merge request reports