Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TaskGraph.keys #126

Merged
merged 2 commits into from
Feb 15, 2024
Merged

Add TaskGraph.keys #126

merged 2 commits into from
Feb 15, 2024

Conversation

jl-wynen
Copy link
Member

Needed by scipp/essreflectometry#6

I went with TaskGraph.keys instead of TaskGraph.nodes in order to avoid the discussion of whether data and provider nodes are conceptually separate or the same node, see #124.

Comment on lines 116 to 120
def keys(self) -> Generator[Key, None, None]:
"""Iterate over all keys of the graph.

Yields all keys, i.e., the types of values that can be computed or are
provided as parameters.
Copy link
Member

Choose a reason for hiding this comment

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

Erm, this is odd, because we have self._keys, and the keys passed in the __init__, with a quite different meaning from what you implemented here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Renamed the args in other methods to targets to match the name in transform_coords.

@@ -103,15 +103,28 @@ def compute(
If ``keys`` is a single type, returns the single result that was computed.
If ``keys`` is a tuple of types, returns a dictionary with type as keys
Copy link
Member

Choose a reason for hiding this comment

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

Docstring would need an update given the rename.

@jl-wynen jl-wynen merged commit fa4afab into main Feb 15, 2024
5 checks passed
@jl-wynen jl-wynen deleted the iterate-graph branch February 15, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants