Compute topological sort with dynamic key#145
Open
kaushikcfd wants to merge 3 commits intoinducer:mainfrom
Open
Compute topological sort with dynamic key#145kaushikcfd wants to merge 3 commits intoinducer:mainfrom
kaushikcfd wants to merge 3 commits intoinducer:mainfrom
Conversation
839095b to
e6374ef
Compare
e6374ef to
e37fa88
Compare
4 tasks
e37fa88 to
fbe9a7a
Compare
inducer
reviewed
Jun 19, 2022
Owner
inducer
left a comment
There was a problem hiding this comment.
Thanks for working on this! While I agree that the operation introduced here is mostly well-defined, the approach seems a bit "brutal". 🙂 The potential
pytools/graph.py
Outdated
| self.node = node | ||
| self.key = key | ||
| node: Any | ||
| key: Any |
Owner
There was a problem hiding this comment.
Maybe introduce type variables for key and node, for increased expressiveness of the type annotation?
Comment on lines
+242
to
+250
| :arg trigger_key_update: A function called after scheduling a node in | ||
| *graph* that takes in an instance of :class:`TopologicalOrderState` | ||
| corresponding to the scheduling state at that point and returns whether | ||
| the comparison keys corresponding to the nodes be updated. | ||
|
|
||
| :arg get_key: A callable called when *trigger_key_update* | ||
| returns *True*. Takes in an instance of :class:`TopologicalOrderState` | ||
| and returns another callable that accepts node as an argument and returns the | ||
| comparison key corresponding to the node. |
Owner
There was a problem hiding this comment.
Couldn't this be a single callable that either performs the update or says "I've not done anything"?
fbe9a7a to
eaafc94
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #143.