Draft
Conversation
To keep the load small, we need to write files via generators, not simply via one big string. Using file.writelines() is buffered, and the dask array is buffered.
wpbonelli
reviewed
Mar 3, 2025
| promise.compute() | ||
| # we have to open the file again, | ||
| # because xarray_extras only allows paths and no file handlers. | ||
| with open(file_path, "a") as f: |
Member
There was a problem hiding this comment.
one option would be to just use pandas to_csv for internal arrays, and accept the performance hit, and advise that for fast IO people should use external arrays. pandas accepts a file handle not only a path. is dask lazy io the reason extras does not? I wonder if extras could support file handle for the numpy-backed array case, then we can still get a speedup.
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.
Based on discussion #49 , we are looking into ways to efficiently write lazy data arrays to disk in ascii format. Our main contestant would be
xarray-extras. A package that can handle large data arrays and writes them with a 10x speed increase compared to simple numpy data writing.