Dag.ch_func
and signature comparison
#52
thorwhalen
started this conversation in
Enhancement
Replies: 1 comment
-
Closed with 34db0e5 But more tests to come from @sylvainbonnot . |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In solving DAG.ch_func should be more robust issue with this commit, we broke CI:
When making
ch_funcs
less permissive,test_dag_operations
stopped working because the injected functions had defaults whereas the (code_to_dag
-made)dag
template did not.Removed the defaults of injected functions, but am writing an issue about this since we really need more flexible signature comparisons.
In the particular instance of
Dag.ch_func
, we really want a user to specify a minimum when they first make the template, and then be able to assemble the functions they need and inject them in the dag. Aspects like defaults shouldn't show up there, so injecting a function that has a default shouldn't be a problem. Here, perhaps the validation/comparison rule could be "it's okay to add a default (i.e. inject a func with a default in a FuncNode whose func didn't have a default), but not to change it?See the Signature binary function (e.g. comparison) design issue for more on this.
Current state of affairs
If you replace by a different function with exactly the same signature,
all goes well:
But if you change the signature, even slightly you get an error.
Here we didn't include the defaults:
Here we include defaults, but
z
's is different:Here the defaults are exactly the same, but the order of parameters is
different:
Such sensitivity, though desirable as a default since it makes things robust out of the box, in many contexts it is quite annoying.
Therefore we need to allow the user to specify the signature comparison function.
Related
Diagnose an iterable of functions to make meshing easier
Beta Was this translation helpful? Give feedback.
All reactions