Skip to content

Improve reshape test when limiting max chunk size - #8494

Closed
GenevieveBuckley wants to merge 4 commits into
dask:mainfrom
GenevieveBuckley:reshape-test-update
Closed

GenevieveBuckley wants to merge 4 commits into
dask:mainfrom
GenevieveBuckley:reshape-test-update

Conversation

@GenevieveBuckley

@GenevieveBuckley GenevieveBuckley commented Dec 16, 2021 •

Copy link
Copy Markdown
Contributor

Follow up work from PR 8124, to address James' suggestions made here.

This PR:

  • Adds a limit keyword argument to the reshape method (in addition to the reshape function)
  • improves the test cases when testing whether a reshaped Dask array will respect a chunk size limit.

Checklist:

@GenevieveBuckley

Copy link
Copy Markdown
Contributor Author

FYI @jrbourbeau, since these were originally your suggestions 😄

@jsignell jsignell left a comment

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.

Thanks for opening this PR! It looks like a nice improvement.

There is one more piece that @jrbourbeau and I talked about last week but I can't find where we wrote it up. It seems like in other places (namely slicing.py) split-large-chunks raises a warning if it is None. In your first PR, when split-large-chunks is None it allows chunk splitting.

dask/dask/array/reshape.py

Lines 236 to 237 in 1f30a14

if limit is None and config.get("array.slicing.split-large-chunks") is not False:
limit = parse_bytes(config.get("array.chunk-size"))

Instead it should probably throw a warning, or be treated as Falsey like:

    if limit is None and config.get("array.slicing.split-large-chunks"):
        limit = parse_bytes(config.get("array.chunk-size"))

@GenevieveBuckley

Copy link
Copy Markdown
Contributor Author

I missed that conversation.

Lines 236-237 in reshape.py have been updated with your suggested change:

    if limit is None and config.get("array.slicing.split-large-chunks"):
        limit = parse_bytes(config.get("array.chunk-size"))

@jsignell

Copy link
Copy Markdown
Member

I just merged main to see if we can get tests running a bit better here.

@jsignell jsignell left a comment

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.

I was trying to figure out what was going on with the tests and ended up coming up with a slightly different approach. See what you think of #8511

@github-actions github-actions Bot added the needs attention It's been a while since this was pushed on. Needs attention from the owner or a maintainer. label Jan 31, 2022
@jsignell

jsignell commented Feb 1, 2022

Copy link
Copy Markdown
Member

I'm going to close this since we merged #8511 instead

@jsignell jsignell closed this Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

array needs attention It's been a while since this was pushed on. Needs attention from the owner or a maintainer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants