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

Allow IO maps to use channels as keys #86

Closed
liamhuber opened this issue Nov 22, 2023 · 2 comments
Closed

Allow IO maps to use channels as keys #86

liamhuber opened this issue Nov 22, 2023 · 2 comments

Comments

@liamhuber
Copy link
Member

E.g. from

@macro_node()
def my_example(macro: Macro):
    macro.foo = foo()
    macro.bar = bar(i=macro.foo)
    macro.inputs_map = {"foo__widget": "thingy"}
    macro.outputs_map = {"bar__hide_it": None}

to

@macro_node()
def my_example(macro: Macro):
    macro.foo = foo()
    macro.bar = bar(i=macro.foo)
    macro.inputs_map = {foo.inputs.widget: "thingy"}
    macro.outputs_map = {bar.outputs.hide_it: None}

So that we can leverage tab-completion when defining the LHS of the pairs.

I guess implementation will involve something like adding something like

@property 
def mangled_name(self):
    return self.node.label + "__" + self.label

and then when parsing the IO maps, using key.mangled_name when isinstance(key, Channel).

@liamhuber
Copy link
Member Author

Came up in the context of discussing #85

@liamhuber
Copy link
Member Author

There are no more IO maps (#276 etc)

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

No branches or pull requests

1 participant