-
Notifications
You must be signed in to change notification settings - Fork 51
Swap dims test and value test in == #1111
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
base: main
Are you sure you want to change the base?
Changes from all commits
a57e19e
6eea1a3
f30aa01
b5124ca
19d8573
0331787
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -384,4 +384,15 @@ end | |
| @test ds[Z = 1] == (a = da1, b = da1) | ||
| @test ds[Z = 1:2] == ds | ||
|
|
||
| end | ||
|
|
||
| @testset "isequal and == with missing" begin | ||
| a = [missing 1; 1 1] | ||
| da1 = DimArray(a, (X(1:2), Y(1:2))) | ||
| da2 = DimArray(a, (X(2:3), Y(2:3))) | ||
| ds1 = DimStack(da1) | ||
| ds2 = DimStack(da2) | ||
| @test (ds1 == ds2) == false | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know that this follows directly from the evaluation order, but somehow it feels a bit strange that this should return There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this makes only sense to return false since this should also return false if the parent array is the same. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea on second thought this is analogous to the changes to broadcast that I proposed where we should do dims checking before doing any calculations so I think this is the right way to go |
||
| @test ismissing(ds1 == ds1) | ||
| @test isequal(ds1, ds1) | ||
| end | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure we don't hit any
===fallbacksThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, should we use deepcopy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think copy would be sufficient since
ais just an array