Closed bstabler closed 7 years ago
The quick fix is to ensure TITLE really is just '' or something that won't cause problems
It looks like the problem opening files with an empty TITLE attribute is caused by a bug in pytables 3.0.0 that is fixed in 3.1.0
Given that this is caused by a bug, which is now fixed, it might make more sense just to be careful to always assign a TITLE attribute in the meantime. And then maybe somebody could rebuild OMX Viewer with an up-to-date version of pytables?
Thoughts?
The TITLE attribute is optional so can we just not create it in the first place?
It's just the viewer that is expecting it, I think. We'd have to update the viewer to fix the problem, and I don't even remember where that code is! Hmm.
The viewer doesn't require a title since I've used it for lots of other OMX files with matrices without TITLE
The issue is that the pytables code is creating the bad TITLE - not the OMX code. So we'll try the update to pytables 3.1.0
Yep. Bumping pytables requirement to >= 3.1.0 to see if that fixes the problem.
uploaded openmatrix version 0.2.4 to pip.
pip install --upgrade openmatrix
should pull in the new pytables dependency. Happy testing!
The default matrix TITLE attribute is some funny character that is causing problems. In order to read our matrices into the OMX Viewer and VISUM, we had to override the TITLE after the matrix was created. We added the following bold line:
import openmatrix as omx outfile = omx.openFile(os.path.join(dir_data, 'transit_od_demandnew' + per + '.omx'), 'w') outfile['metro'] = od_matrix[i+1][0] outfile.createMapping('taz', taz_labels) outfile['metro'].attrs.TITLE = 'metro' outfile.close()