"docs/source/api/git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "88833e6f16c86e3ab77399ad7e7b650bad3c460c"
Unverified Commit 1e8c645d authored by Rhett Ying's avatar Rhett Ying Committed by GitHub
Browse files

[Dist] fix max length to 80 introduced in deprecate etype PR (#4809)

parent ed8e9c44
...@@ -847,14 +847,15 @@ class RangePartitionBook(GraphPartitionBook): ...@@ -847,14 +847,15 @@ class RangePartitionBook(GraphPartitionBook):
), "The node types have invalid IDs." ), "The node types have invalid IDs."
for c_etype, etype_id in etypes.items(): for c_etype, etype_id in etypes.items():
assert isinstance(c_etype, tuple) and len(c_etype) == 3, \ assert isinstance(c_etype, tuple) and len(c_etype) == 3, \
f"Expect canonical edge type in a triplet of string, but got {c_etype}." "Expect canonical edge type in a triplet of string, but got " \
f"{c_etype}."
etype = c_etype[1] etype = c_etype[1]
self._etypes[etype_id] = etype self._etypes[etype_id] = etype
self._canonical_etypes[etype_id] = c_etype self._canonical_etypes[etype_id] = c_etype
if etype in self._etype2canonical: if etype in self._etype2canonical:
# If one etype maps to multiple canonical etypes, empty # If one etype maps to multiple canonical etypes, empty tuple
# tuple is used to indicate such ambiguity casued by etype. # is used to indicate such ambiguity casued by etype. See more
# See more details in self.to_canonical_etype(). # details in self.to_canonical_etype().
self._etype2canonical[etype] = tuple() self._etype2canonical[etype] = tuple()
else: else:
self._etype2canonical[etype] = c_etype self._etype2canonical[etype] = c_etype
...@@ -863,9 +864,10 @@ class RangePartitionBook(GraphPartitionBook): ...@@ -863,9 +864,10 @@ class RangePartitionBook(GraphPartitionBook):
), "The edge types have invalid IDs." ), "The edge types have invalid IDs."
# This stores the node ID ranges for each node type in each partition. # This stores the node ID ranges for each node type in each partition.
# The key is the node type, the value is a NumPy matrix with two columns, in which # The key is the node type, the value is a NumPy matrix with two
# each row indicates the start and the end of the node ID range in a partition. # columns, in which each row indicates the start and the end of the
# The node IDs are global node IDs in the homogeneous representation. # node ID range in a partition. The node IDs are global node IDs in the
# homogeneous representation.
self._typed_nid_range = {} self._typed_nid_range = {}
# This stores the node ID map for per-node-type IDs in each partition. # This stores the node ID map for per-node-type IDs in each partition.
# The key is the node type, the value is a NumPy vector which indicates # The key is the node type, the value is a NumPy vector which indicates
...@@ -1416,7 +1418,8 @@ class HeteroDataName(object): ...@@ -1416,7 +1418,8 @@ class HeteroDataName(object):
self._policy = NODE_PART_POLICY if is_node else EDGE_PART_POLICY self._policy = NODE_PART_POLICY if is_node else EDGE_PART_POLICY
if not is_node: if not is_node:
assert isinstance(entity_type, tuple) and len(entity_type) == 3, \ assert isinstance(entity_type, tuple) and len(entity_type) == 3, \
f"Expect canonical edge type in a triplet of string, but got {entity_type}." "Expect canonical edge type in a triplet of string, but got " \
f"{entity_type}."
self._entity_type = entity_type self._entity_type = entity_type
self.data_name = data_name self.data_name = data_name
...@@ -1439,7 +1442,8 @@ class HeteroDataName(object): ...@@ -1439,7 +1442,8 @@ class HeteroDataName(object):
def get_type(self): def get_type(self):
"""The type of the node/edge. """The type of the node/edge.
This is only meaningful in a heterogeneous graph. This is only meaningful in a heterogeneous graph.
In homogeneous graph, type is '_N' for a node and '_N:_E:_N' for an edge. In homogeneous graph, type is '_N' for a node and '_N:_E:_N' for an
edge.
""" """
return self._entity_type return self._entity_type
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment