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

named nodes #129

Merged
merged 11 commits into from
Nov 17, 2021
Merged

named nodes #129

merged 11 commits into from
Nov 17, 2021

Conversation

PythonFZ
Copy link
Member

@PythonFZ PythonFZ commented Nov 15, 2021

Had to make a new PR, because of rebasing conflicts on the other one.

TODOs

  • add documentation

Example

A Node can now be named, this allows using the same Node in different dependencies or using the same Node multiple times with slightly different parameters. E.g. this can be useful for adding multiple files. The file adding syntax does not change, and all Nodes are required to be on the same graph.

    HelloWorld()(inputs=3)
    HelloWorld(name="Test01")(inputs=17)
    HelloWorld(name="Test02")(inputs=42)

    project.repro()

    assert HelloWorld(load=True).output == 3
    assert HelloWorld(load=True, name="Test01").output == 17
    assert HelloWorld(load=True, name="Test02").output == 42

@PythonFZ PythonFZ marked this pull request as ready for review November 15, 2021 16:16
@PythonFZ PythonFZ requested a review from SamTov November 15, 2021 16:45
@daydreamer125 daydreamer125 added enhancement New feature or request and removed enhancement New feature or request labels Nov 16, 2021
Copy link
Member

@SamTov SamTov left a comment

Choose a reason for hiding this comment

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

It all looks good I just had a question about one method. We should also run the license header updater on this soon.

zntrack/core/zntrack.py Outdated Show resolved Hide resolved
zntrack/core/zntrack.py Show resolved Hide resolved
@PythonFZ
Copy link
Member Author

It all looks good I just had a question about one method. We should also run the license header updater on this soon.

Can you make the license header an issue? Which files are missing?

@SamTov
Copy link
Member

SamTov commented Nov 17, 2021

It all looks good I just had a question about one method. We should also run the license header updater on this soon.

Can you make the license header an issue? Which files are missing?

None files are missing all of the headers are just the old ones.

@PythonFZ PythonFZ mentioned this pull request Nov 17, 2021
@PythonFZ PythonFZ merged commit 7fe27f0 into main Nov 17, 2021
@PythonFZ PythonFZ deleted the named_nodes_fix branch November 17, 2021 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants