rm CondaPkg environment
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -4,7 +4,7 @@ import networkx as nx
|
||||
|
||||
__all__ = ["adjacency_data", "adjacency_graph"]
|
||||
|
||||
_attrs = dict(id="id", key="key")
|
||||
_attrs = {"id": "id", "key": "key"}
|
||||
|
||||
|
||||
def adjacency_data(G, attrs=_attrs):
|
||||
|
||||
@@ -5,7 +5,13 @@ import networkx as nx
|
||||
__all__ = ["node_link_data", "node_link_graph"]
|
||||
|
||||
|
||||
_attrs = dict(source="source", target="target", name="id", key="key", link="links")
|
||||
_attrs = {
|
||||
"source": "source",
|
||||
"target": "target",
|
||||
"name": "id",
|
||||
"key": "key",
|
||||
"link": "links",
|
||||
}
|
||||
|
||||
|
||||
def _to_tuple(x):
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -56,5 +56,5 @@ class TestAdjacency:
|
||||
def test_exception(self):
|
||||
with pytest.raises(nx.NetworkXError):
|
||||
G = nx.MultiDiGraph()
|
||||
attrs = dict(id="node", key="node")
|
||||
attrs = {"id": "node", "key": "node"}
|
||||
adjacency_data(G, attrs)
|
||||
|
||||
@@ -16,7 +16,13 @@ def test_attrs_deprecation(recwarn):
|
||||
assert len(recwarn) == 0
|
||||
|
||||
# Future warning raised with `attrs` kwarg
|
||||
attrs = dict(source="source", target="target", name="id", key="key", link="links")
|
||||
attrs = {
|
||||
"source": "source",
|
||||
"target": "target",
|
||||
"name": "id",
|
||||
"key": "key",
|
||||
"link": "links",
|
||||
}
|
||||
data = node_link_data(G, attrs=attrs)
|
||||
assert len(recwarn) == 1
|
||||
|
||||
@@ -26,7 +32,6 @@ def test_attrs_deprecation(recwarn):
|
||||
|
||||
|
||||
class TestNodeLink:
|
||||
|
||||
# TODO: To be removed when signature change complete
|
||||
def test_custom_attrs_dep(self):
|
||||
G = nx.path_graph(4)
|
||||
@@ -35,13 +40,13 @@ class TestNodeLink:
|
||||
G.graph[1] = "one"
|
||||
G.graph["foo"] = "bar"
|
||||
|
||||
attrs = dict(
|
||||
source="c_source",
|
||||
target="c_target",
|
||||
name="c_id",
|
||||
key="c_key",
|
||||
link="c_links",
|
||||
)
|
||||
attrs = {
|
||||
"source": "c_source",
|
||||
"target": "c_target",
|
||||
"name": "c_id",
|
||||
"key": "c_key",
|
||||
"link": "c_links",
|
||||
}
|
||||
|
||||
H = node_link_graph(
|
||||
node_link_data(G, attrs=attrs), multigraph=False, attrs=attrs
|
||||
@@ -53,11 +58,11 @@ class TestNodeLink:
|
||||
|
||||
# provide only a partial dictionary of keywords.
|
||||
# This is similar to an example in the doc string
|
||||
attrs = dict(
|
||||
link="c_links",
|
||||
source="c_source",
|
||||
target="c_target",
|
||||
)
|
||||
attrs = {
|
||||
"link": "c_links",
|
||||
"source": "c_source",
|
||||
"target": "c_target",
|
||||
}
|
||||
H = node_link_graph(
|
||||
node_link_data(G, attrs=attrs), multigraph=False, attrs=attrs
|
||||
)
|
||||
@@ -70,7 +75,7 @@ class TestNodeLink:
|
||||
def test_exception_dep(self):
|
||||
with pytest.raises(nx.NetworkXError):
|
||||
G = nx.MultiDiGraph()
|
||||
attrs = dict(name="node", source="node", target="node", key="node")
|
||||
attrs = {"name": "node", "source": "node", "target": "node", "key": "node"}
|
||||
node_link_data(G, attrs)
|
||||
|
||||
def test_graph(self):
|
||||
@@ -133,7 +138,7 @@ class TestNodeLink:
|
||||
def test_exception(self):
|
||||
with pytest.raises(nx.NetworkXError):
|
||||
G = nx.MultiDiGraph()
|
||||
attrs = dict(name="node", source="node", target="node", key="node")
|
||||
attrs = {"name": "node", "source": "node", "target": "node", "key": "node"}
|
||||
node_link_data(G, **attrs)
|
||||
|
||||
def test_string_ids(self):
|
||||
@@ -155,13 +160,13 @@ class TestNodeLink:
|
||||
G.graph[1] = "one"
|
||||
G.graph["foo"] = "bar"
|
||||
|
||||
attrs = dict(
|
||||
source="c_source",
|
||||
target="c_target",
|
||||
name="c_id",
|
||||
key="c_key",
|
||||
link="c_links",
|
||||
)
|
||||
attrs = {
|
||||
"source": "c_source",
|
||||
"target": "c_target",
|
||||
"name": "c_id",
|
||||
"key": "c_key",
|
||||
"link": "c_links",
|
||||
}
|
||||
|
||||
H = node_link_graph(node_link_data(G, **attrs), multigraph=False, **attrs)
|
||||
assert nx.is_isomorphic(G, H)
|
||||
|
||||
Reference in New Issue
Block a user