Raphtory
Raphtory copied to clipboard
General follow-ups from PR #2075 (History object and TimeIndexEntry updates)
General follow-ups for PR #2075. This PR introduced a history object to access the histories of different elements (like nodes, edges, temporal properties, edge deletions, PathFromNode, PathFromGraph, etc...). Also, TimeIndexEntry(timestamp, secondary_index) was renamed to EventTime(epoch, event_id). This PR also refactored many of the internal and API functions to replace the use of i64 timestamps with EventTime (previously TimeIndexEntry) to allow specifying an event id (previously secondary index) where desired. These are some of the follow-ups that still need to be addressed:
- #2295
- How should
EventTime(previouslyTimeIndexEntry) be printed in Python?- Currently, it's
EventTime(epoch={}, event_id={}). Should the event_id be printed? Should the epoch be changed to an easily-readable date time? Should both the epoch and date time be printed?
- Currently, it's
- Update remaining GraphQL types and functions to return
EventTimeand takeTimeInputarguments instead ofi64in both cases.-
lastOpened(),lastUpdated(),created() - functions of types
mutableGraph,mutableNode,mutableEdgeshould be updated-
addNode(),addEdge(),delete(), etc... currently takeInt!as input, should be updated toTimeInput
-
-
VectorisedGraphWindow::start/endshould beEventTimeinstead ofi64 -
TemporalPropertyInput::timeshould beEventTimeinstead ofi64
-
- Write a benchmark to evaluate the performance benefit tradeoff of using
MergedHistory<L, R>vsCompositeHistory-
CompositeHistoryholds aBox<[T]>.T,L, andRcan be any type with history operations defined on it. -
MergedHistory'sLandRcan be otherMergedHistoryobjects, which can be nested indefinitely. - If we only have 2 items,
MergedHistoryis more efficient. If we have many items,CompositeHistoryis more efficient. How many items do we need to have such thatCompositeHistorybecomes more efficient thanMergedHistory? Test using benchmark. - Ideally, once we know, we can expose only one of
merge/composeto users in Python and manage the switch fromMergedHistorytoCompositeHistoryautomatically when it makes sense.
-
- Make sure
median()functions all behave the same. Make sure the calculation is the same in all cases.- Currently, if there is an even number of items ("2 middle items"), some places pick one of the two to return and the history object's interval.median() returns the average of these 2 items rounded up. Pick one and stick to it.
- Add to the docs for
PersistentGraphthat theevent_ids associated to some of itsEventTimes may not be the same as in other graph types. Converting some graph to aPersistentGraphmight alter someevent_ids, soEventTimeequality might fail for some history entries. Currently, in our tests, we make sure to only compare epochs (timestamps) for equality betweenPersistentGraphs and other graph types. - Check if the new
DiskGraphstill has differentevent_ids onEventTimeentries, or if this was fixed.- Update comment in
raphtory/tests/df_loaders.rsline 144 if/when it's fixed
- Update comment in
- Add interval functions onto
LazyNodeStatefor interval type. We currently can't do g.nodes.history.intervals.mean for example.- The type is
LazyNodeState<ops::Map<HistoryOp<'static, DynamicGraph>, PyIntervals>>and is created inraphtory/src/python/graph/node_state/lazy_node_state_history.rsat line 117.
- The type is