Skip to content
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

SampleContainer can not save metadata correctly into h5 backend #213

Closed
qchempku2017 opened this issue Jun 1, 2022 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@qchempku2017
Copy link
Collaborator

When saving samplercontainer in h5py mode, function _init_backed failed to run becase in container.py line 410, json.dump(self.metadata) returns error. This happens because keys of Ensemble thermo_boundaries are not serialized into string, and their keys still include Species type object.

image

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce

Context

Detailed Description

Possible Implementation

@qchempku2017 qchempku2017 added the bug Something isn't working label Jun 1, 2022
@lbluque
Copy link
Collaborator

lbluque commented Jun 1, 2022

Good catch @qchempku2017 ! I'll try to fix it asap

@qchempku2017
Copy link
Collaborator Author

It's caused by lack of serialization for Species as the key to chemical potentials. One suggested fix is to serialize species into strings, then use serialized chemical potentials to write.

And we definitely need a test for h5py backend dumping functionalities in container.

@qchempku2017
Copy link
Collaborator Author

So we do have a test on hdf5 save and load, but the container was constructed ad-hoc for that particular test, and it did not have metadata. We should add a proper metadata into the container and make sure the tests are passed with metadata.

@lbluque lbluque closed this as completed in dab0bce Jun 2, 2022
lbluque added a commit that referenced this issue Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants