Skip to content
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

implement larray_equiv and larray_nan_equiv #237

Closed
gdementen opened this issue May 3, 2017 · 3 comments
Closed

implement larray_equiv and larray_nan_equiv #237

gdementen opened this issue May 3, 2017 · 3 comments

Comments

@gdementen
Copy link
Contributor

larray_equal is very picky (axes in same order and no broadcasting)

@gdementen
Copy link
Contributor Author

Maybe more arguments to LArray.equals? See #488

@alixdamman
Copy link
Collaborator

@gdementen In which context that would be useful?

@gdementen
Copy link
Contributor Author

gdementen commented Mar 20, 2018

In most contexts. Users usually do not care that axes are ordered differently when comparing two arrays. So we might want to make this the default. Also, currently, you cannot compare an array with a scalar, or to another array with less axes:

>>> arr1 = ndtest(2)
>>> arr2 = full('a=a0,a1;b=b0..b2', arr1)
>>> arr2
a\b  b0  b1  b2
 a0   0   0   0
 a1   1   1   1
>>> arr2['a0'].equals(0)
False
>>> arr2.equals(arr1)
False
>>> arr2.equals(arr2.T)
False

but...

>>> arr2 == arr1
a\b    b0    b1    b2
 a0  True  True  True
 a1  True  True  True
>>> (arr2 == arr1).all()
True
>>> arr2 == arr2.T
a\b    b0    b1    b2
 a0  True  True  True
 a1  True  True  True

@alixdamman alixdamman modified the milestones: 0.29, 0.30 Apr 20, 2018
@alixdamman alixdamman modified the milestones: 0.30, 0.31 Jul 18, 2018
gdementen added a commit to gdementen/larray that referenced this issue Sep 18, 2018
I still wonder if LArray.equiv wouldn't be better... or if check_axes=True isn't the better default value.
@gdementen gdementen modified the milestones: 0.31, 0.30 Sep 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants