|
9 | 9 | from .metadatastore import JSONMetadataStore
|
10 | 10 |
|
11 | 11 | from gufe.tokenization import (
|
12 |
| - get_all_gufe_objs, key_decode_dependencies, from_dict |
| 12 | + get_all_gufe_objs, key_decode_dependencies, from_dict, JSON_HANDLER, |
13 | 13 | )
|
14 | 14 |
|
15 | 15 |
|
@@ -138,6 +138,7 @@ def _store_gufe_tokenizable(self, prefix, obj):
|
138 | 138 | # we only store on keys that we don't already know
|
139 | 139 | if key not in self.result_server:
|
140 | 140 | data = json.dumps(o.to_keyed_dict(),
|
| 141 | + cls=JSON_HANDLER.encoder, |
141 | 142 | sort_keys=True).encode('utf-8')
|
142 | 143 | self.result_server.store_bytes(key, data)
|
143 | 144 |
|
@@ -175,7 +176,7 @@ def recursive_build_object_cache(gufe_key):
|
175 | 176 | with self.load_stream(storage_key) as f:
|
176 | 177 | keyencoded_json = f.read().decode('utf-8')
|
177 | 178 |
|
178 |
| - dct = json.loads(keyencoded_json) |
| 179 | + dct = json.loads(keyencoded_json, cls=JSON_HANDLER.decoder) |
179 | 180 | # this implementation may seem strange, but it will be a
|
180 | 181 | # faster than traversing the dict
|
181 | 182 | key_encoded = set(GUFEKEY_JSON_REGEX.findall(keyencoded_json))
|
|
0 commit comments