-
Notifications
You must be signed in to change notification settings - Fork 33
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
Interrupting an h5netcdf process "corrupts" netCDF file #98
Comments
The essence of the code that produces this issue: import h5netcdf.legacyapi as netCDF4
import numpy as np
with netCDF4.Dataset(fort63) as ds: # fort63 is the output of an ADCIRC model
zeta = ds.variables['zeta']
for col in range(zeta.shape[1]):
k = np.ma.getdata(zeta[:, col])
|
This might be somewhat related (to the second part of this error). Note in this issue, I am using h5netcdf directly and not thru xarray. |
The reason that I'm using h5netcdf over netCDF4 is that with this particular ADCIRC output, netCDF4 is very slow accessing a column. Switching to h5netcdf cut my script's runtime from about 1.5hrs (estimated) to about 1min. It's a nice performance story for h5netcdf if I can figure out how to resolve this issue. |
@groutr Thanks for raising this. I've run into this behaviour occasionally. You do not have a reproducible example (or file to download)? You are running this from a console via a python script or by other means (jupyter)? |
@kmuehlbauer, unfortunately, I don't think I'm able to share the sample file that I have. I'm running this via a python script executed from the console. This script is designed to run as a directly executed utility. It's essential function is pull data out from a designated set of columns (of a variable) and write the data to a CSV file. Nothing fancy happening here. |
Does this occur even if you explicitly set |
@shoyer I only observed the behavior with |
@groutr That should be resolved by now. We can reopen otherwise. |
If a process using h5netcdf is interrupted, the netCDF file becomes "corrupted". Subsequent reads by h5netcdf produce the following exception when the file is closed.
h5netcdf 0.11.0
h5py 3.1.0
hdf5 1.10.6
netCDF4 appears to be able to still open and close the file without issue.
The text was updated successfully, but these errors were encountered: