-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDF5Archive mangles (silently) all keys in python dictionaries to strings #17
Comments
Hi Hugo, |
Dear Igor, Thanks for pointing this out. Even so, I really think that HDFArchive should complain when the keys are not strings and throw an error. In the current state one easily spends a couple of hours debugging, since the conversion is silent. Best, H |
I agree, there is an issue that should be addressed. The actual problem is that either of the potential solutions has its downside. |
Fair enough, so a deprecation warning printout would be the middle ground solution? |
Yes, this is probably the most reasonable thing we can do at the moment. |
I was surprised to find that
pytriqs.archive.HDF5Archive
silently converts all keys in python dictionaries to strings, which of course break things expecting other python objects. See below for a small example.I would strongly recommend that conversion of dictionaries either are fully supported, or that one gets an error when trying to store a dictionary with non-string keys. Silent conversion is very bad practice.
Best, Hugo
Here is a small example:
resulting in
The text was updated successfully, but these errors were encountered: