Skip to content

Connections act like an identity when given a non-cl array

I ran into an issue with this line when I passed a numpy array to DirectDiscretizationConnection.__call__:

        if not isinstance(vec, cl.array.Array):
            return vec

It is not clear to me why this line is there.

It turned out to be a somewhat confusing issue to diagnose, because I wasn't sure why the shape of the result didn't match the shape of discretization.

Edited by Matt Wala