-
Notifications
You must be signed in to change notification settings - Fork 8
Allow arbitrary class data #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This PR extended the serialized spec to allow additional arbitrary string key value mappings on each class. This would be helpful for inlining some values into class level attributes (egraphs-good/egraph-visualizer#4) and also in egglog to serialize let bindings on the class as metadata (egraphs-good/egglog#376) TODO before merging: - [ ] Add support in graphviz visualizer and test it locally - [ ] Add support in egglog for emitting let bindings here - [ ] Add support in the javascript visualizer to display these TODO after merging: - [ ] Add support for turning some values automatically into extra class properties, in line with egraphs-good/egraph-visualizer#4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR extends the serialized specification to allow additional arbitrary string key-value mappings on each class, enabling inlining of values into class-level attributes and supporting metadata serialization in egglog.
- Extended
ClassDatastruct to include a flattenedextraHashMap for arbitrary string key-value pairs - Updated graphviz visualizer to display extra class data as HTML table labels in subgraphs
- Added test data demonstrating the new arbitrary class data functionality
Reviewed Changes
Copilot reviewed 4 out of 7 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/lib.rs | Added HashMap import and extra field to ClassData struct with serde flattening |
| src/graphviz.rs | Updated visualization logic to extract and display extra class data as HTML labels |
| tests/tiny.json | Added test data with example arbitrary class data mappings |
| tests/round_trip.rs | Changed debug output from file path to dot format content |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
I'm merging this PR since I'm cutting a release for egglog and it seems this one is ready to go. |
This PR extended the serialized spec to allow additional arbitrary string key value mappings on each class.
This would be helpful for inlining some values into class level attributes (egraphs-good/egraph-visualizer#4) and also in egglog to serialize let bindings on the class as metadata (egraphs-good/egglog#376)
TODO before merging:
TODO after merging: