You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During the new hire software orientation, we attempted to run some VBA notebooks. I encountered errors in functions that call pandas.read_hdf() and pass format='fixed' as a kwarg.
This is with h5py==2.9.0, pandas==0.24.2
Here is the traceback I am getting:
ValueErrorTraceback (mostrecentcalllast)
<ipython-input-20-3164b7df868e>in<module>()
---->1dataset=visual_behavior_ophys_dataset.VisualBehaviorOphysDataset(experiment_id, cache_dir=cache_dir)
/home/nick.ponvert/src/visual_behavior_analysis/visual_behavior/ophys/dataset/visual_behavior_ophys_dataset.pyin__init__(self, experiment_id, cache_dir, **kwargs)
57self.cache_dir=cache_dir58self.cache_dir=self.get_cache_dir()
--->59self.roi_metrics=self.get_roi_metrics()
60ifself.roi_metrics.cell_specimen_id.values[0] isNone:
61self.cell_matching=False/home/nick.ponvert/src/visual_behavior_analysis/visual_behavior/ophys/dataset/visual_behavior_ophys_dataset.pyinget_roi_metrics(self)
256257defget_roi_metrics(self):
-->258self._roi_metrics=pd.read_hdf(os.path.join(self.analysis_dir, 'roi_metrics.h5'), key='df', format='fixed')
259returnself._roi_metrics260/home/nick.ponvert/.conda/envs/python2/lib/python2.7/site-packages/pandas/io/pytables.pycinread_hdf(path_or_buf, key, mode, **kwargs)
366'File {path} does not exist'.format(path=path_or_buf))
367-->368store=HDFStore(path_or_buf, mode=mode, **kwargs)
369# can't auto open/close if we are using an iterator370# so delegate to the iterator/home/nick.ponvert/.conda/envs/python2/lib/python2.7/site-packages/pandas/io/pytables.pycin__init__(self, path, mode, complevel, complib, fletcher32, **kwargs)
461462if'format'inkwargs:
-->463raiseValueError('format is not a defined argument for HDFStore')
464465try:
ValueError: formatisnotadefinedargumentforHDFStore
After doing some digging, it look like there was a recent change to pandas that introduced this particular exception. See: pandas-dev/pandas#13291
It looks like pandas was allowing the 'format' kwarg to be passed to HDFStore.open, which ignored it because it isn't a defined parameter for that method. So, the recent change causes pandas to complain if you try to pass 'format' as a kwarg in read_hdf().
Proposed fix: We should change all the lines that pass format as a kwarg to pandas.read_hdf() to be compatible with the latest version of pandas. This shouldn't change what is actually loaded, since the format kwarg was being ignored before.
The text was updated successfully, but these errors were encountered:
This addresses issue #513 and makes PR #514 unnecessary. For future reference, here's the explanation for the #513 fix:
This PR addresses issue #513 by changing all of the calls to pandas.read_hdf() to no longer pass 'format' as a kwarg. We used to do this, and the passed kwarg was ignored by HDFStore.open because it wasn't a defined keyword arg for that method, but no alarms were raised.
See: pandas-dev/pandas#13291
In newer versions of pandas there is an exception raised if you try to pass 'format' to the read_hdf() method. Removing this kwarg:
- Won't change the output of read_hdf, as the kwarg was being ignored before, and
- Allows me to run Marina's old notebooks with VBA analysis code and pandas==0.24.2
During the new hire software orientation, we attempted to run some VBA notebooks. I encountered errors in functions that call pandas.read_hdf() and pass format='fixed' as a kwarg.
This is with h5py==2.9.0, pandas==0.24.2
Here is the traceback I am getting:
After doing some digging, it look like there was a recent change to
pandas
that introduced this particular exception. See: pandas-dev/pandas#13291It looks like
pandas
was allowing the 'format' kwarg to be passed toHDFStore.open
, which ignored it because it isn't a defined parameter for that method. So, the recent change causespandas
to complain if you try to pass 'format' as a kwarg inread_hdf()
.Proposed fix: We should change all the lines that pass format as a kwarg to
pandas.read_hdf()
to be compatible with the latest version of pandas. This shouldn't change what is actually loaded, since the format kwarg was being ignored before.The text was updated successfully, but these errors were encountered: