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

Port access by attribute #118

Merged
merged 9 commits into from
Nov 16, 2022
Merged

Port access by attribute #118

merged 9 commits into from
Nov 16, 2022

Conversation

liamhuber
Copy link
Member

Overrides the inputs and outputs attributes of a node with a new list-like class. This class allows elements that are NodePort instances (or their values) to be accessed as attributes according to their label strings.

This closes #108.

We do introduce a little danger here: accessing port values this way (instead of through Node.input(index), or at least Node.inputs[index].get_val()) bypasses functionality for the exec mode, and for running with an executor in data mode (although for the latter I don't see in the ryvencore source code any difference to just directly grabbing val...) If/when I get test cases up for exec mode, this can be revisited.

This way we can safely have port labels the same as the built-in list method names without getting in trouble
@github-actions
Copy link

Binder 👈 Launch a binder notebook on branch pyiron/ironflow/port_access_by_attribute

@liamhuber liamhuber added the format_black Invoke black formatting CI label Nov 16, 2022
@liamhuber liamhuber merged commit 12b3d17 into main Nov 16, 2022
@liamhuber liamhuber deleted the port_access_by_attribute branch November 16, 2022 17:43
@liamhuber liamhuber mentioned this pull request Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format_black Invoke black formatting CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make input/output accessible by label
2 participants