Skip to content

Followup to PR 8397 map_overlap default boundary kwarg#8743

Merged
jsignell merged 8 commits intodask:mainfrom
GenevieveBuckley:followup-to-8397
Feb 28, 2022
Merged

Followup to PR 8397 map_overlap default boundary kwarg#8743
jsignell merged 8 commits intodask:mainfrom
GenevieveBuckley:followup-to-8397

Conversation

@GenevieveBuckley
Copy link
Copy Markdown
Contributor

Followup to PR #8397

We've had a FutureWarning up for a few months about an upcoming change to the default 'boundary' kwarg value in map_overlap, so now is the time to change it. Previous default was "reflect", new default will be "None".

The reason for this change is that it makes the code run a lot faster, and for most people the overlap depth is sufficient and they should not require additional boundary handling. See #8391 for a full discussion.

@github-actions github-actions bot added the array label Feb 21, 2022
@GenevieveBuckley
Copy link
Copy Markdown
Contributor Author

Note: a lot of the overlap tests still assume "reflect" is used. I'm not sure if they should be updated or left as they are. I haven't touched them, it seemed like more work without a clear benefit, but other people might want to weigh in on this.

@jsignell
Copy link
Copy Markdown
Member

Note: a lot of the overlap tests still assume "reflect" is used. I'm not sure if they should be updated or left as they are. I haven't touched them, it seemed like more work without a clear benefit, but other people might want to weigh in on this.

It seems fine to me to just go through and explicitly add boundary="reflect" to any tests that need it to pass, and leave the rest alone.

@jsignell
Copy link
Copy Markdown
Member

Just let me know if you want me to finish up this PR @GenevieveBuckley :)

@GenevieveBuckley
Copy link
Copy Markdown
Contributor Author

It seems fine to me to just go through and explicitly add boundary="reflect" to any tests that need it to pass, and leave the rest alone.

I thought we already did this in the first PR. But there are still some failing tests, so I guess that didn't catch everything.

Just let me know if you want me to finish up this PR @GenevieveBuckley :)

Yes please, that would be very helpful. I can point you to the spot that's causing a problem, but I can't sink much more time into this today.

default = "reflect"
default = "none"
if boundary is None:
boundary = default
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's this if condition that is leading to assertion errors in the trim tests.

If we do a presumably nonsensical thing, and set boucndary here equal to any of "reflect", "constant", "nearest", or None then all the tests pass. But when we set it equal to the string value "none" (instead of the python None) then the assertions below fail. I'm not exactly sure what is going on here.

=========================== short test summary info ============================
FAILED dask/array/tests/test_overlap.py::test_trim_internal - assert ((9, 8, ...
FAILED dask/array/tests/test_overlap.py::test_nearest_overlap - AssertionError:
FAILED dask/array/tests/test_overlap.py::test_some_0_depth - AssertionError:
FAILED dask/array/tests/test_overlap.py::test_depth_equals_boundary_length - ...
FAILED dask/array/tests/test_overlap.py::test_depth_greater_than_boundary_length
======

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think we just need to add the boundary kwarg to all the trim_internal calls in the tests. I just pushed a commit that does that

@GenevieveBuckley
Copy link
Copy Markdown
Contributor Author

Additionally, it would be good to confirm this default choice results in fewer tasks, just with a quick check of visualize in a notebook.

@jsignell jsignell self-assigned this Feb 22, 2022
@jsignell
Copy link
Copy Markdown
Member

Planning to merge this once it's green since the next release will be 2022.03.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

array deprecation Something is being removed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants