An EventGraph class with tests#319
Conversation
|
Some TODOs that came out of discussion:
|
|
Thanks for keeping track of everything we discussed in the meeting. Some additional suggestions:
I think these are all things that we need to agree on now since changing them later would mean breaking changes. So, maybe you can also add what you think @hackl and @IngoScholtes FYI: Just merged the pytest CI fix to main, so after rebasing you shouldn't run into problems anymore. |
… namespace); continuations method removed from EventGraph
|
@M-Lampert - I've moved the and returns the exact same thing as before (the If not, let me know - happy to move around. For the purposes of fixing the documentation related to this, let me know if simply renaming Of course this is to get the docs consistent with the PR and get the CI to pass wrt this PR - it might move again in the (near) future. |
|
Just replacing every |
Introduced an
EventGraphclass with tests to illustrate basic functionality.EventGraphis a pathpyGGraphso in addition to being constructed from aTemporalGraph, it is capable of being constructed directly from atorch_geometric.data.Dataobject.Essentially the usage might be:
A couple of things to discuss:
If an
EventGraphis constructed from aTemporalGraphand theTemporalGraphis later changed by the caller, should theEventGraphchange as well? Right now we don't -eg._temporal_graph = TemporalGraph(g.data.clone(), mapping=g.mapping). This seems to me like the right thing to do.eg.shortest_pathsworks, but creates aTemporalGraph(if it doesn't exist) to pass on totemporal_shortest_paths. This seems wasteful ifEventGraphwas constructed fromDataand doesn't need all theTemporalGraphmachinery. Perhapstemporal_shortest_pathscan be tweaked to work with a pre-computed edge-index (as would be the case ifEventGraphis constructed directly fromtorch_geometric.data.Data).temporal_shortest_paths(g: TemporalGraph | None, eg: "EventGraph" | None, delta: int). Add methods toEventGraph/TemporalGraphthat call this function under the hood.Some changes in other files were for my understanding of the code by adding comments, and are unrelated to the PR.