-
Notifications
You must be signed in to change notification settings - Fork 658
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TopologyAttr registration; prototype Topology json serialization
We now register TopologyAttrs using the same metaclassing mechanism as used for Parsers, Readers, and Writers. This is necessary in order to deserialize Topology objects that have been serialized to JSON. An existing Topology can now be serialized to JSON with: ```python top.to_json('topology.json') ``` and a Topology can be generated from its JSON form with: ```python top = Topology.from_json('topology.json') ``` Individual TopologyAttrs must define how to serialize themselves and to deserialize their data to make an instance of themselves for this to work. Addresses #643.
- Loading branch information
Showing
5 changed files
with
209 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters