rm CondaPkg environment

This commit is contained in:
ton
2023-04-06 13:53:47 +07:00
parent 0a57ed7884
commit c43d949309
3329 changed files with 5725 additions and 447022 deletions

View File

@@ -462,7 +462,7 @@ gexf.net/1.2draft http://www.gexf.net/1.2draft/gexf.xsd" version="1.2">
G = nx.MultiGraph()
G.add_node(0, label="1", color="green")
G.add_node(1, label="2", color="green")
G.add_edge(0, 1, id="0", wight=3, type="undirected", start=0, end=1)
G.add_edge(0, 1, id="0", weight=3, type="undirected", start=0, end=1)
G.add_edge(0, 1, id="1", label="foo", start=0, end=1)
G.add_edge(0, 1)
fh = io.BytesIO()
@@ -491,6 +491,16 @@ gexf.net/1.2draft http://www.gexf.net/1.2draft/gexf.xsd" version="1.2">
sorted(e) for e in H.edges()
)
# Test missing alpha value for version >draft1.1 - set default alpha value
# to 1.0 instead of `None` when writing for better general compatibility
fh = io.BytesIO()
# G.nodes[0]["viz"]["color"] does not have an alpha value explicitly defined
# so the default is used instead
nx.write_gexf(G, fh, version="1.2draft")
fh.seek(0)
H = nx.read_gexf(fh, node_type=int)
assert H.nodes[0]["viz"]["color"]["a"] == 1.0
# Second graph for the other branch
G = nx.Graph()
G.add_node(0, label="1", color="green")

View File

@@ -146,13 +146,13 @@ graph [
def test_parse_gml(self):
G = nx.parse_gml(self.simple_data, label="label")
assert sorted(G.nodes()) == ["Node 1", "Node 2", "Node 3"]
assert [e for e in sorted(G.edges())] == [
assert sorted(G.edges()) == [
("Node 1", "Node 2"),
("Node 2", "Node 3"),
("Node 3", "Node 1"),
]
assert [e for e in sorted(G.edges(data=True))] == [
assert sorted(G.edges(data=True)) == [
(
"Node 1",
"Node 2",
@@ -446,14 +446,14 @@ graph
G = nx.Graph()
G.name = data
G.graph["data"] = data
G.add_node(0, int=-1, data=dict(data=data))
G.add_node(0, int=-1, data={"data": data})
G.add_edge(0, 0, float=-2.5, data=data)
gml = "\n".join(nx.generate_gml(G, stringizer=literal_stringizer))
G = nx.parse_gml(gml, destringizer=literal_destringizer)
assert data == G.name
assert {"name": data, "data": data} == G.graph
assert list(G.nodes(data=True)) == [(0, dict(int=-1, data=dict(data=data)))]
assert list(G.edges(data=True)) == [(0, 0, dict(float=-2.5, data=data))]
assert list(G.nodes(data=True)) == [(0, {"int": -1, "data": {"data": data}})]
assert list(G.edges(data=True)) == [(0, 0, {"float": -2.5, "data": data})]
G = nx.Graph()
G.graph["data"] = "frozenset([1, 2, 3])"
G = nx.parse_gml(nx.generate_gml(G), destringizer=literal_eval)
@@ -544,7 +544,7 @@ graph
"directed 1 multigraph 1 ]"
)
# Tests for string convertable alphanumeric id and label values
# Tests for string convertible alphanumeric id and label values
nx.parse_gml("graph [edge [ source a target a ] node [ id a label b ] ]")
nx.parse_gml(
"graph [ node [ id n42 label 0 ] node [ id x43 label 1 ]"
@@ -710,7 +710,7 @@ class TestPropertyLists:
assert graph.nodes(data=True)["n1"] == {"properties": ["element"]}
@pytest.mark.parametrize("coll", (list(), tuple()))
@pytest.mark.parametrize("coll", ([], ()))
def test_stringize_empty_list_tuple(coll):
G = nx.path_graph(2)
G.nodes[0]["test"] = coll # test serializing an empty collection

View File

@@ -522,13 +522,13 @@ class TestReadGraphML(BaseGraphML):
# edges with no data, no keys:
(1, 2),
# edges with only data:
(1, 2, dict(key="data_key1")),
(1, 2, dict(id="data_id2")),
(1, 2, dict(key="data_key3", id="data_id3")),
(1, 2, {"key": "data_key1"}),
(1, 2, {"id": "data_id2"}),
(1, 2, {"key": "data_key3", "id": "data_id3"}),
# edges with both data and keys:
(1, 2, 103, dict(key="data_key4")),
(1, 2, 104, dict(id="data_id5")),
(1, 2, 105, dict(key="data_key6", id="data_id7")),
(1, 2, 103, {"key": "data_key4"}),
(1, 2, 104, {"id": "data_id5"}),
(1, 2, 105, {"key": "data_key6", "id": "data_id7"}),
]
)
fh = io.BytesIO()
@@ -1485,7 +1485,7 @@ class TestWriteGraphML(BaseGraphML):
# test for handling json escaped strings in python 2 Issue #1880
import json
a = dict(a='{"a": "123"}') # an object with many chars to escape
a = {"a": '{"a": "123"}'} # an object with many chars to escape
sa = json.dumps(a)
G = nx.Graph()
G.graph["test"] = sa

File diff suppressed because it is too large Load Diff