mtzgroup / chemcloud-client

Python client for TeraChem Cloud
MIT License
11 stars 3 forks source link

.json() fails when wavefunction data is include #41

Closed coltonbh closed 1 year ago

coltonbh commented 1 year ago

When a result is returned containing binary wavefunction data (e.g., AtomicResult with a c0 file from TeraChem) and you try to save the result using the usual method:

result = AtomicResult(...)
with open("data.json" , "w) as f:
    f.write(result.json())

the serialization fails because there is no binary representation in json.

Perhaps leave the data in b64? This seems more problematic for end users because they'll have to know to serialize and deserialize the result... Or add in a serialization for binary data... Or something...

coltonbh commented 1 year ago

Closed with my switching to qcio which encodes binary data to b64 by default for json/yaml/toml objects.