Skip to content

Conversation

@coroa
Copy link
Member

@coroa coroa commented Jan 29, 2025

Fixes #395 and #381 .

@lkstrp
We stumbled over your changes in #395 today starting from some custom code.

If ds has an unchunked time dimension you get

chunks = "auto"

and then

chunks[0]

retrieves the letter "a", which breaks n.chunk(...).

I think you meant to check for whether there are chunks (which are always given as a tuple) and then use the leading chunksize in that case.

@geiges Thanks for the report.

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • Unit tests for new features were added (if applicable).
  • Newly introduced dependencies are added to environment.yaml, environment_docs.yaml and setup.py (if applicable).
  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

@coroa coroa requested a review from lkstrp January 29, 2025 23:34
@lkstrp lkstrp merged commit 91e6e7c into master Jan 30, 2025
17 of 20 checks passed
@lkstrp lkstrp deleted the fix-chunks-take2 branch January 30, 2025 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants