You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if we picked up on this in #368 (sorry if it's a known issue!).
I just realised that calling to_json on an explicit molecule component (SmallMoleculeComponent) actually is a different behaviour than the GufeTokenizable to_json.
The former takes no arguments and only returns a json string whilst the latter can take a filepath and write the string directly there.
I know we rely a lot on the "to/from_json" utility for Components, but my understanding is that we could just directly remove the class method in explicit molecule and it should just give us the same behaviour?
A more immediate / short term concern
I noticed that the explicit molecule component to_json and from_json have no docstring 🙀 ! So they just inherit it from GufeTokenizable which has teh different behaviour.
The text was updated successfully, but these errors were encountered:
Ah, this was certainly an oversight on our part in #368! As you suggest, I believe we could drop these methods from ExplicitMoleculeComponent and add in the ability to read previously-generated to_dict JSON dumps to the GufeTokenizable.from_json implementation as a fallback on failure.
Although, it looks like the ExplicitMoleculeComponent methods don't use our JSON_HANDLER encoder/decoder, which may mean they never worked right in the first place. 😅
…itMoleculeComponent.to_json/from_json
Closes#375, #458.
Also allows us to read `GufeTokenizable`s serialized previously in
`dict` representation via `.from_json`.
I'm not sure if we picked up on this in #368 (sorry if it's a known issue!).
I just realised that calling
to_json
on an explicit molecule component (SmallMoleculeComponent) actually is a different behaviour than the GufeTokenizableto_json
.The former takes no arguments and only returns a json string whilst the latter can take a filepath and write the string directly there.
I know we rely a lot on the "to/from_json" utility for Components, but my understanding is that we could just directly remove the class method in explicit molecule and it should just give us the same behaviour?
A more immediate / short term concern
I noticed that the explicit molecule component
to_json
andfrom_json
have no docstring 🙀 ! So they just inherit it from GufeTokenizable which has teh different behaviour.The text was updated successfully, but these errors were encountered: