Skip to content

Session.save fails when it contains 0d arrays #291

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

Closed
gdementen opened this issue May 31, 2017 · 4 comments
Closed

Session.save fails when it contains 0d arrays #291

gdementen opened this issue May 31, 2017 · 4 comments
Assignees
Labels
Milestone

Comments

@gdementen
Copy link
Contributor

because LArray(0).to_frame() fails

@gdementen gdementen added the bug label May 31, 2017
@gdementen
Copy link
Contributor Author

The easy workaround (before #153 is done) would be to exclude 0d LArray in Session.save

@alixdamman
Copy link
Collaborator

alixdamman commented Jun 8, 2017

Or we could reshape to (1,) and print a warning? (before #153)

@gdementen
Copy link
Contributor Author

I would rather just skip them (until #153) because 1d and 0d arrays behave quite differently (as they are meant to) in many situations.

>>> range(LArray(3))
range(0, 3)
>>> range(LArray([3]))
TypeError: only integer scalar arrays can be converted to a scalar index
>>> ndtest((2, 3)) * LArray(1)
a\b  b0  b1  b2
 a0   0   1   2
 a1   3   4   5
>>> ndtest((2, 3)) * LArray([1])
ValueError: number of axes (2) does not match number of dimensions of data (3)

@alixdamman
Copy link
Collaborator

OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants