Closed ivan-krukov closed 4 years ago
I refactored the code as requested.
I'm not sure if we should add wrappers for the common methods such as add_node
or add_edges_from
so that instead of calling self.graph.add_node
we can just directly call self.add_node
.
At the current stage, the
Genealogical
class inherits fromnetworkx.DiGraph
. When we usenx
methods on the genealogy classes, it will invoke the constructor of__class__
without extra arguments. This means that at present the instance attributes of the genealogies are updated manually.Ideally, we want to have the
digraph
as a member of theGenealogical
class. But this will mean that some code would need to be refactored to callself.graph
.