-
Notifications
You must be signed in to change notification settings - Fork 4
Xarray io tests #66
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
base: develop
Are you sure you want to change the base?
Xarray io tests #66
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.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.