2

I am working with a structure within the HDF5 file that has names with '/' in them. When I load said file, I get this warning:

 ⓔ  develop  In [1]  import pandas as pd

 ⓔ  develop  In [2]  store = pd.HDFStore('data/XXX-20150423-071618.h5')       

 ⓔ  develop  In [3]  store
/home/XXX/virt/env/develop/lib/python2.7/site-packages/tables/group.
py:1156: UserWarning: problems loading leaf ``/log``::

  the ``/`` character is not allowed in object names: 'XXX/align/aft_port_end/extend_pressure'

The leaf will become an ``UnImplemented`` node.
  % (self._g_join(childname), exc))

We could change those but it would be a major PITA and would involve hacking existing critical files. So, while possible we would like not to do that.

Is there any way we can have '/' in names or is it just not supported?

>>> pd.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 2.7.5.final.0
python-bits: 64
OS: Linux
OS-release: 3.10.0-229.1.2.el7.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8

pandas: 0.16.0
nose: 1.3.6
Cython: 0.22
numpy: 1.9.2
scipy: 0.15.1
statsmodels: None
IPython: 3.0.0
sphinx: 1.2.3
patsy: None
dateutil: 2.4.2
pytz: 2015.2
bottleneck: None
tables: 3.1.1
numexpr: 2.2.2
matplotlib: 1.4.3
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 0.9.7
pymysql: None
psycopg2: None
Sardathrion - against SE abuse
  • 17,269
  • 27
  • 101
  • 156

1 Answers1

2

Technically the file is illegal HDF5 - the official spec in 5.2. HDF5 Path Names and Navigation clearly defines Names to be strings of non-slash characters. So, PyTables isn't wrong to reject your input here (and it's being rather gracious by simply falling back to an UnImplemented node).

That said, if you're not afraid of just hacking PyTables, you could disable the offending check from tables/path.py. As far as I can tell, the only side-effect of this will be that the objects will not be usable using natural naming, but that's not likely to be a big deal.

(Caveat: I have not used PyTables before, so this is based solely on my reading of the code.)

Sardathrion - against SE abuse
  • 17,269
  • 27
  • 101
  • 156
nneonneo
  • 171,345
  • 36
  • 312
  • 383