frejanordsiek / hdf5storage

Python package to read and write a wide range of Python types to/from HDF5 formatted files. Can read/write data to the HDF5 based Matlab v7.3 MAT files.
BSD 2-Clause "Simplified" License
83 stars 24 forks source link

Savemat not converting Python types anymore? #124

Closed mandelkow closed 1 year ago

mandelkow commented 1 year ago

Greetings!

I am using hdf5storage 0.1.16 with Python 3.10 and I am surprised to discover that native Python types like int do not get converted and saved by savemat (anymore). (I am pretty sure this used to work in the past.) Numpy types like np.int32 get saved normally. No errors are thrown. Python variables are just missing when I use loadmat to retrieve.

Can anyone confirm this problem? Are there any known incompatibilities?

Cheers, Hendrik

frejanordsiek commented 1 year ago

This looks like it is the same as #122 .

This is fixed in the a06c749 commit on the 0.1.x branch. It is caused by the numpy.asscalar function being deprecated, which prevented reading the value (it was saved, though). I will be pushing a 0.1.19 bugfix release to PyPI shortly.

mandelkow commented 1 year ago

Much obliged. And thank you for providing this invaluable resource. -Hendrik

frejanordsiek commented 1 year ago

Is it fixed for you now?

mandelkow commented 1 year ago

Yes it works again. 1000x thanks! -Hendrik