Audit trail¶
Audit trails for graphs and graph hierarchies.
This module containes a collection of utils for audit trails that provide version control for transformations of graphs and graph hierarchies:
Versioning, abstract class for in-memory versioning of objects;
VersionedGraph, wrapper around graph objects in ReGraph that allows to track their audit trail;
VersionedHierarchy, wrapper around hierarchy objects in ReGraph that allows to track their audit trail;
-
class
regraph.audit.
VersionedGraph
(graph, init_branch='master', current_branch=None, deltas=None, heads=None, revision_graph=None)[source]¶ Class for versioned hierarchies.
Methods
from_json
(graph, json_data)Retrieve versioning object from JSON.
rewrite
(self, rule[, instance, message])Rewrite the versioned graph and commit.
-
class
regraph.audit.
VersionedHierarchy
(hierarchy, init_branch='master', current_branch=None, deltas=None, heads=None, revision_graph=None)[source]¶ Class for versioned hierarchies.
Methods
from_json
(hierarchy, json_data)Retrieve versioning object from JSON.
rewrite
(self, graph_id, rule[, instance, …])Rewrite the versioned hierarchy and commit.
-
class
regraph.audit.
Versioning
(init_branch='master', current_branch=None, deltas=None, heads=None, revision_graph=None)[source]¶ Class for version control.
- Attributes
- _current_branch
Name of the current branch
- _deltasdict
Dictionary with delta’s to all other branches
- _headsdict
- _revision_graphnetworkx.DiGraph
Methods
_compose_deltas
(self, delta1, delta2)Abstract method for composing deltas.
_invert_delta
(self, delta1)Abstract method for inverting deltas.
_merge_into_current_branch
(self, delta)Abstract method for merging a branch into the current one.
_create_identity_delta
(self)Abstract method for creating an identity-delta.
branches()
current_branch()
commit(graph, rule, instance)
branch(new_branch)
switch_branch(branch)
merge(branch1, branch2)
_compose_delta_path