>>> import neet
>>> import networkx as nx
>>> from neet.boolean.examples import s_pombe
>>> from neet.boolean.conv import wt_to_logic
# Incoming edges identified by Network.neighbors
>>> [s_pombe.neighbors(i, "in") for i in range(s_pombe.size)]
[{0}, {1, 2, 3, 4}, {0, 1, 2, 5, 8}, {0, 1, 3, 5, 8}, {4, 5}, {2, 3, 4, 5, 6, 7}, {8, 1, 6}, {8, 1, 7}, {8, 4}]
>>> [wt_to_logic(s_pombe).neighbors(i, "in") for i in range(s_pombe.size)]
[{0}, {2, 3, 4}, {0, 1, 2, 5, 8}, {0, 1, 3, 5, 8}, {5}, {2, 3, 4, 6, 7}, {8, 1, 6}, {8, 1, 7}, {4}]
# Incoming edges included in DiGraph generated by Network.network_graph
>>> [list(s_pombe.network_graph().predecessors(i)) for i in range(s_pombe.size)]
[[0], [1, 2, 3, 4], [0, 1, 2, 5, 8], [0, 1, 3, 5, 8], [4, 5], [2, 3, 4, 5, 6, 7], [1, 6, 8], [1, 7, 8], [4, 8]]
>>> [list(wt_to_logic(s_pombe).network_graph().predecessors(i)) for i in range(s_pombe.size)]
[[0], [2, 3, 4], [0, 1, 2, 5, 8], [0, 1, 3, 5, 8], [5], [2, 3, 4, 6, 7], [1, 6, 8], [1, 7, 8], [4]]
They don't commute.
Description
We can convert a
WTNetworkinto aLogicNetworkwhich, by default, only includes edges if they have a demonstrable effect on the state of target node. TheWTNetworkuses theNetwork.neighborsmethod to determine which edges exist when converting the network into anetworkx.DiGraph. The result is fake edges, particularly self-edges, in thenetworkx.DiGraph.Neet Version: 1.0.0
Operating System: ChromeOS 79
To Reproduce
neet.boolean.examples.s_pombeinto a logic network viaNetwork.network_graph.Network.neighbors.Expected Behavior
The
Network.network_graphmethod should commute withneet.boolean.conv.wt_to_logic.Actual Behavior
They don't commute.