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

Added optional parameter open_array_kwargs to build_pyramid #895

Conversation

m-albert
Copy link
Contributor

… to be passed as kwargs to zarr.open when creating the pyramid level arrays.

Useful e.g. for passing write_empty_chunks=True.

Fixes #894.

Checklist before merging

  • I added an appropriate entry to CHANGELOG.md

…ssed as kwargs to zarr.open when creating the pyramid level arrays.
@jluethi
Copy link
Collaborator

jluethi commented Jan 13, 2025

Thanks for the PR @m-albert , this change makes sense!

The only potential issue is whether the overwrite functionality would break with this. I realize that our current test suite doesn't cover this case, so I'll add a small test for it

@jluethi
Copy link
Collaborator

jluethi commented Jan 13, 2025

Indeed, the old version raised zarr.errors.ContainsArrayError if overwrite was set to false and the pyramid levels already existed. The new version with the explicit zarr.open just always overwrites. I'll add an extra check for that and then I think it's good to go :)

@jluethi
Copy link
Collaborator

jluethi commented Jan 13, 2025

@m-albert Can you have a look whether this version is fine for you? I now added explicit handling to make sure we fail if a pyramid level already exists, but overwrite is set to False. Besides that, it's just a bit of minor reformatting :)

If you're happy with this, I'll merge this and make a fractal-tasks-core patch release out of it, so you can use it in the stitching task.

@m-albert
Copy link
Contributor Author

Thanks a lot for looking into this so quickly @jluethi !

The only potential issue is whether the overwrite functionality would break with this.

Oh right, I had completely missed this.

@m-albert Can you have a look whether this version is fine for you? I now added explicit handling to make sure we fail if a pyramid level already exists, but overwrite is set to False. Besides that, it's just a bit of minor reformatting :)

Thanks a lot for this, which looks good to me. And I just learned about the f"{var_name=}" syntax 😁.

If you're happy with this, I'll merge this and make a fractal-tasks-core patch release out of it, so you can use it in the stitching task.

Great, I'm very happy with this and will make use of the new functionality in the stitching task as soon as the patch release is out!

@jluethi jluethi merged commit 4fb7463 into fractal-analytics-platform:main Jan 14, 2025
20 checks passed
@jluethi
Copy link
Collaborator

jluethi commented Jan 14, 2025

@m-albert Great! I'll work on another small chunking-related fix, then I'll make a new release :)

Thanks a lot for the PR!

@jluethi
Copy link
Collaborator

jluethi commented Jan 14, 2025

@m-albert fractal-tasks-core 1.4.1 with this change is now released :)

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.

Writing empty chunks in build_pyramid
2 participants