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

ValueError: buffer size must be a multiple of element size #9831

Closed
mgalusha4 opened this issue Nov 27, 2024 · 3 comments
Closed

ValueError: buffer size must be a multiple of element size #9831

mgalusha4 opened this issue Nov 27, 2024 · 3 comments
Labels
needs triage Issue that has not been reviewed by xarray team member

Comments

@mgalusha4
Copy link

What is your issue?

Using xr.open_dataset to read .nc files that I am looping through. The loop works for for first 20 or so files and then I get the error "ValueError: buffer size must be a multiple of element size". I already have a check to see if the .nc is an empty file and I am opening the file with "dataset = xr.open_dataset(fsspec.open(filename).open(), chunks={})"

@mgalusha4 mgalusha4 added the needs triage Issue that has not been reviewed by xarray team member label Nov 27, 2024
Copy link

welcome bot commented Nov 27, 2024

Thanks for opening your first issue here at xarray! Be sure to follow the issue template!
If you have an idea for a solution, we would really welcome a Pull Request with proposed changes.
See the Contributing Guide for more.
It may take us a while to respond here, but we really value your contribution. Contributors like you help make xarray better.
Thank you!

@mgalusha4
Copy link
Author

sample code:
xr.set_options(file_cache_maxsize=10)
for gcm_folder in GCM_files:
filename = glob.glob('ClimateProjections/LOCA/LOCA2_downloads/' + gcm_folder + '/*')[0]
if os.path.getsize(filename) == 0:
print(gcm_folder, 'is an empty file')
continue
dataset = xr.open_dataset(fsspec.open(filename).open(), chunks={})

@max-sixty
Copy link
Collaborator

Please fill out a bug report, including an MCVE

@max-sixty max-sixty closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue that has not been reviewed by xarray team member
Projects
None yet
Development

No branches or pull requests

2 participants