Serialization and de-serialization #40
Locked
damskii9992
announced in
ADRs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Serialization to dictionary
To save/load a project it is necessary to be able to serialize objects into a format that can be saved on disk which can later again be de-serialized into the proper object. What format should be serialized into is very technique-dependent as different scientific fields use different formats (CIF for crystallography, ORSO for reflectometry, etc.).
To accommodate all the various needs of different techniques we have standardized the approach to serialization:
to_dictandfrom_dictmethodseasyscienceis JSON, as such its re-serializer is implemented in the core libraryThe core
easysciencelibraryIn the core library base classes (see easyscience/corelib#168) which all technique-library classes should inherit from, we have implemented generic
to_dictandfrom_dictmethods. These methods are responsible for serializing any easyscience object to a dictionary which can then be de-serialized from. The methods can be overwritten in technique-specific libraries to provide additional serialization functionality.Link to the ADR suggestions:
easyscience/corelib#161
Beta Was this translation helpful? Give feedback.
All reactions