Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ldp/graph/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def get_upstream_results(self, op: str | Op) -> Iterator[OpResult]:

def traverse(
self,
topological_order: bool = True,
topological_order: bool = False,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm cool with changing the default, but can you pass topological_order=True here:

for node in self.traverse():
? That's the only place we currently require topological sorting.

filter_fn: Callable[[OpResult], bool] = lambda _: True,
) -> Iterator[OpResult]:
"""Traverse the compute graph that led to this OpResult.
Expand All @@ -256,7 +256,7 @@ def traverse(
order. This requires having the whole graph in memory. If False,
traverse the backwards graph in depth-first order. This can be done
lazily and is useful if we are trying to hydrate the graph node-by-node.
Most user-facing cases can leave this as True. Defaults to True.
Probably True is a better default, but to avoid nx import we set to False.
filter_fn: Will only yield nodes that pass this filter function. Note that
nodes that fail will still be traversed.

Expand Down
Loading