PartitionedGraphs extension for DataGraphs and interface overhaul. #55
Merged
mtfishman merged 60 commits intoITensor:mainfrom Feb 6, 2026
Merged
PartitionedGraphs extension for DataGraphs and interface overhaul. #55mtfishman merged 60 commits intoITensor:mainfrom
PartitionedGraphs extension for DataGraphs and interface overhaul. #55mtfishman merged 60 commits intoITensor:mainfrom
Conversation
…btype `AbstractNamedGraph` - Interface now no longer assumes vertex and edge date stored as mutable field. Instead, requires overloading setters and getters. - Subtyping `AbstractNamedGraph` cuts down on the method forwarding almost entirely.
…rams of abstract type.
…Graph` Tests have been adjusted accordingly.
… `getindex` This now correctly mirrors `DataGraphs` interface.
This is in anticipation of making this change in `DataGraphs`
These are defined on the abstract type
89a155a to
be9c19a
Compare
3 tasks
PartitionedGraphs extension for DataGraphs.PartitionedGraphs extension for DataGraphs and interface overhaul.
Member
|
(I closed and reopened the PR to trigger the tests since NamedGraphs.jl v0.9 is now registered.) |
mtfishman
reviewed
Feb 6, 2026
mtfishman
reviewed
Feb 6, 2026
mtfishman
reviewed
Feb 6, 2026
mtfishman
reviewed
Feb 6, 2026
mtfishman
reviewed
Feb 6, 2026
mtfishman
reviewed
Feb 6, 2026
mtfishman
reviewed
Feb 6, 2026
mtfishman
reviewed
Feb 6, 2026
mtfishman
reviewed
Feb 6, 2026
9 tasks
Contributor
Author
|
Ive accidentally committed a notebook. Let me fix the history. |
Member
I think the history of the |
b8041a9 to
14257ac
Compare
Contributor
Author
|
Doing the rebase is good git-fu practice for me... |
mtfishman
reviewed
Feb 6, 2026
mtfishman
reviewed
Feb 6, 2026
…a view; one must use `view` explictly.
Member
|
Thanks again! Having a carefully thought-out interface here will be very helpful as a basis for a lot of future work. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a change to the
DataGraphsinterface. Data on anAbstractDataGraphcan be queried with the functionsgetindex,setindex!,isassignedandunsetindex!. To customize the behavior of these function for a custom subtype ofAbstractGraph, one should overload the following:This a bit more verbose than just having a function
vertex_dataetc that returns a mutable dictionary, but I think it is ultimately more generic. The return value ofvertex_dataetc is now constructed on the fly, so doingsetindex!(vertex_data(g), val, vertex)will not modify the underlying graph.The benefit of this change is that one no longer require the data on the vertices and edges to be stored as a mutable field; it can be generated on the fly. This then results in constant behavior when defining views of vertex/edge data. One can still use a mutable dictionary to store the data for a given concrete
AbstractDataGraphsubtype.DataGraphsPartitionedGraphsExt
This package extension (currently existing as a library in DataGraphs while PartitionedGraphs is a library of NamedGraphs) defines notions of getting data of partitioned and quotient graphs. By default, all index types that can be converted to collections of indices (e.g.
QuotientVertex,QuotientVertices,QuotientEdgeEdges) returns subgraphs when using thegetindexsyntax, inline with the behavior ofNamedGraphs. If one wishes to define separate data on the quotient graph on their custom partitioned data graph (this could be separate memory entirely, or data derived from the underlying graph), then one must overload the following:and similarly for the
QuotientEdgemethods (if desired). One can also overload:to define notions of setting/unsetting data on the quotient vertices. Again, similar methods can be defined for
QuotientEdge.Other Changes
AbstractDataGraphnow subtypesAbstractNamedGraph. This greatly reduces required method overloads.VertexDataViewandEdgeDataViewobjects that behave like dictionaries with respect to the graph data.PartitionedGraphspackage.Closes #57, closes #58, closes #59, closes #60, closes #61, closes #62.