Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianSzwichtenberg committed Jan 16, 2024
1 parent 0dfb33d commit 5093a37
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions torch_geometric/data/hetero_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ def is_sorted_by_time(
if not types:
return False

Check warning on line 797 in torch_geometric/data/hetero_data.py

View check run for this annotation

Codecov / codecov/patch

torch_geometric/data/hetero_data.py#L797

Added line #L797 was not covered by tests

for t in [self._to_canonical(t) for t in types]:
for t in types:
if 'time' not in self[t]:
return False

Check warning on line 801 in torch_geometric/data/hetero_data.py

View check run for this annotation

Codecov / codecov/patch

torch_geometric/data/hetero_data.py#L801

Added line #L801 was not covered by tests
if not self[t].is_sorted_by_time():
Expand All @@ -813,8 +813,7 @@ def sort_by_time(self, types: Union[List[EdgeType],
return self

Check warning on line 813 in torch_geometric/data/hetero_data.py

View check run for this annotation

Codecov / codecov/patch

torch_geometric/data/hetero_data.py#L813

Added line #L813 was not covered by tests

out = copy.copy(self)
# TODO: should we limit `out` to be a [edge|node]_type_subgraph?
for t in [self._to_canonical(t) for t in types]:
for t in types:
out[t].sort_by_time()
return out

Expand All @@ -828,8 +827,7 @@ def snapshot(self, types: Union[List[EdgeType], List[NodeType]],
return self

Check warning on line 827 in torch_geometric/data/hetero_data.py

View check run for this annotation

Codecov / codecov/patch

torch_geometric/data/hetero_data.py#L827

Added line #L827 was not covered by tests

out = copy.copy(self)
# TODO: should we limit `out` to be a [edge|node]_type_subgraph?
for t in [self._to_canonical(t) for t in types]:
for t in types:
out[t].snapshot(start_time, end_time)
return out

Expand All @@ -842,8 +840,7 @@ def up_to(self, types: Union[List[EdgeType], List[NodeType]],
return self

Check warning on line 840 in torch_geometric/data/hetero_data.py

View check run for this annotation

Codecov / codecov/patch

torch_geometric/data/hetero_data.py#L840

Added line #L840 was not covered by tests

out = copy.copy(self)
# TODO: should we limit `out` to be a [edge|node]_type_subgraph?
for t in [self._to_canonical(t) for t in types]:
for t in types:
out[t].up_to(end_time)
return out

Expand Down

0 comments on commit 5093a37

Please sign in to comment.