NREL / Solar-for-Industry-Process-Heat

3 stars 1 forks source link

String formatting with HDF5 file attributes #17

Open carriescho opened 3 years ago

carriescho commented 3 years ago

Error came up ("No conversion path for dtype('<U5')") when creating attributes in tech_opph5.py. I'm using version 2.9.0 of h5py and 3.7.3 of python. I added np.string() to the second string in the lines that included f.attrs.create(str1, str2), so it became f.attrs.create(str1, np.string_(str2) ), and this worked.

tech_opp_h5.py: https://github.com/NREL/Solar-for-Industry-Process-Heat/blob/master/tech_opportunity_analysis/tech_opp_h5.py

similar issue: https://github.com/h5py/h5py/issues/892