-
Notifications
You must be signed in to change notification settings - Fork 11
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
Workflow: Automatic parsing of outputs #717
Comments
@samwaseda that is neat! I have two concerns though: The first is simply technical: if we want to decorate @node(ParseOutput(add))
def add(x, y):
return x + y The second is more philosophical: I think the code here is a nice treatment of the symptom, but I think it would be preferable to treat the underlying disease where the data we pass around is just these big tuples of very granular items. The alternative would be packaging up the output in bundles that can exploit composition. Then we'd use something similar to multiple dispatch (cf. a bit of discussion here here to allow passing that entire collection of data as input to a channel that needs just a part of the data, and let the channel define how to un-package and extract what it needs. E.g. suppose we had an Of course, the second objection doesn't preclude having the sort of helper tool you suggest! Even if we go the route of composable data packages, such a tool could be useful, it just makes it less urgent of a problem. |
Actually I would then leave the output name empty, i.e. @node
def add(x, y):
return x + y
ok I'm not 100% sure if I understand it correctly, but isn't the problem the ontological typing, and not so much about what the variable is called? One way or other, the ontological typing will be required at some point, but in a very different way, i.e.: def add(x: float, y:float) -> float:
return x + y Here the type hinting tells what is the type, and from what I understood this is going to be extended to ontological typing. And this is going to make sure that the output of a node can be correctly attached to the input of a different node. The problem I'm trying to solve here is that in iron flow you need a tag for each output value separately, which is essentially causing the problem that we have to write pretty much the same thing twice (once inside |
Note: I'm not trying to completely make it impossible to name the output values via |
Ah, I'm daft. You mean to stick it right inside the node class!
Yeah, ok, I can see what you're getting at now. The outstanding technical problem then is that this still allows characters in the labels that are not compliant with dot access. Maybe that's fine, and if you chose to |
I'm not sure if we will directly override python's typing with ontology information or if it will be provided in a supplementary way. I lean towards the latter. Making the data containers and ontological typing play together is a separate issue though, and the channel labelling stuff you propose here should work independent of that and without interference (at least as far as I can see right now). |
I'm coming back to implement this now, and I need to write down my thoughts anyhow so let's do it here. Conditions:
Behaviour:
Questions:
|
#770 makes some changes to the spec outline above. Namely, if |
I saw this PR and I have to admit that it is not only cumbersome to have to write all the output names, but also it is potentially super dangerous if the user has to check the consistency of outputs. The suggestion below is not immediately applicable in that PR, but I think it would allow for a better systematic recognition of output variables:
What it does:
Output:
What do you think? @liamhuber
The text was updated successfully, but these errors were encountered: