Add --dask-graph and fix prt bp graph#41
Merged
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
Factor out of get_animation so the upcoming --dask-graph path can reuse it. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Optional dependency on the graphviz Python package, needed by dask.visualize for --dask-graph. Co-Authored-By: Claude <noreply@anthropic.com>
The old approach (xr.open_dataset(chunks=...).to_dask_dataframe() with a map_partitions lambda to add the t column) had two problems: 1. to_dask_dataframe creates a separate dask Array per variable, so every file was read once per column regardless of downstream projection. 2. The opaque map_partitions(lambda) blocked dask-expr's column-projection optimizer from pushing the downstream Projection through to the reads, so even columns that were projected away were still read. dd.from_map supplies a `columns=` kwarg to the partition function when the optimizer wants to project, so unused variables are never read from disk. Chunking is preserved by iterating (path, time, particle_dim, slice) tuples sized by CONFIG.dask_chunk_size. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the
--dask-graphoption, which constructs a pipeline and shows its dask graph instead of running it. Useful for diagnostics, and revealed a bug in the prt.bp files wherein time-stacking was opaque to the optimizer and reads of every component couldn't be ruled out.