Skip to content

Draft: Graph Serialization/Deserialization#65

Open
liamsemeria wants to merge 10 commits intoxtc-tools:mainfrom
liamsemeria:dev/sliam/graph-serialization
Open

Draft: Graph Serialization/Deserialization#65
liamsemeria wants to merge 10 commits intoxtc-tools:mainfrom
liamsemeria:dev/sliam/graph-serialization

Conversation

@liamsemeria
Copy link
Contributor

@liamsemeria liamsemeria commented Mar 11, 2026

Motivation

Could be used as an interchange format for using graph display tools or other tools independent of xtc itself.

Description

Adds functionality to convert to and from a dict for xtc graphs, and to and from yaml.

One thing to note: when deserializing all list attrs are turned into tuples (since tuples need to be lists to serialize). This is fine now since there are no attrs that use lists instead of tuples, but if for some reason a new xtc op gets added that requires an attribute to be a list then it wouldn't deserialize properly. To fix this maybe the unused type hints in operators.py can be used in op_factory somehow.

For deserializing pad2d #66 is required.

TODO:

  • custom outputs.
  • outputs in the yaml
  • tuples attrs being deserialized correctly
  • versioning
  • deterministic uid serialization

@guillon guillon self-assigned this Mar 11, 2026
@guillon guillon self-requested a review March 11, 2026 14:18
@liamsemeria liamsemeria force-pushed the dev/sliam/graph-serialization branch from e968f5b to 1eff19b Compare March 13, 2026 11:22
@liamsemeria liamsemeria marked this pull request as ready for review March 13, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants