-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
A suggestion:
In the basic_examples/001-open-raster-file.ipynb and basic_examples/003-combining-data-in-algorithm.ipynb notebooks, a SMAP h5 file is opened for reading. If one of these notebooks is run before the other, the user may run into problems opening the h5 dataset in the second notebook.
It appears that the h5 file becomes locked when it is first opened. This is the error I get when attempting to re-open the dataset a second time, without closing the first:
smap = SMAPH5(source='../../data/raster/SMAP_L4_SM_aup_20181027T090000_Vv4030_001.h5',
nan_vals=[-9999],
interpolation='bilinear')
smap.native_coordinates
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
~/miniconda3/envs/podpac/lib/python3.7/site-packages/traitlets/traitlets.py in get(self, obj, cls)
527 try:
--> 528 value = obj._trait_values[self.name]
529 except KeyError:
KeyError: 'dataset'
During handling of the above exception, another exception occurred:
OSError Traceback (most recent call last)
~/miniconda3/envs/podpac/lib/python3.7/site-packages/h5py/_hl/files.py in make_fid(name, mode, userblock_size, fapl, fcpl, swmr)
189 try:
--> 190 fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl)
191 except IOError:
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/h5f.pyx in h5py.h5f.open()
OSError: Unable to open file (unable to lock file, errno = 11, error message = 'Resource temporarily unavailable')
...
closing the first dataset resolves the problem:
smap.close_dataset()
It would be useful to add this close_dataset step at the end of each notebook that opens hdf5 files.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels