New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__repr__ method of BaseRepresentation can fail #5889
Comments
Note that I have a fix in place for this by replacing this line with # for complex shapes and structures, this may require a copy
try:
return np.concatenate([coo.reshape(sh).value for coo in coordinates],
axis=-1).view(dtype).squeeze()
except:
return np.concatenate([coo.reshape(sh).value for coo in coordinates],
axis=-1).astype(dtype).squeeze() however, I'm struggling to add a regression test, since the example above runs into the exception reported in #5890 , which is thornier issue. I cannot think of another way to create an N-D representation which cannot be accessed using a view like the one above. |
Hmm, not good, that! Here is a simpler test:
|
My own sense would be to rewrite the code to something more robust, along the lines of
I'll make a quick PR... |
See #5896 for a fix. |
The
__repr__
method of theBaseRepresentation
class uses anumpy
view to access the values. It is possible to create objects for which this view cannot be taken, i.e (using v1.3.1):produces
The text was updated successfully, but these errors were encountered: