You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Background: our use case always involves applying Operators to different Functions/Constants/etc than the ones they were originally built with. This is because compilation is expensive, and we reuse the compiled Operator as much as possible.
We hit an issue recently where a developer had forgotten to supply the value of an important Constant when running the operator, but this didn't lead to an error - instead the Operator was silently run with the Constant from the time that the operator was built. This took longer than it should have to diagnose.
For Functions, forgetting an argument like this typically results in an error, because the dimensions do not match. However, for scalar Constants this is not true.
I was imagining an argument supplied when instantiating the Functions/Constants (no_default_arg=True).
Or perhaps it would be more intuitive to instead make it a keyword argument at Operator creation time, or perhaps even to apply()? (although default arguments from Dimensions are probably still desirable...)
The text was updated successfully, but these errors were encountered:
I suppose an environment variable or an entry in configuration would be "too global" ?
otherwise, what if we make that no_default_arg an optional argument of Operator(...), which is a list of all symbolic objects appearing in the Operator that should be explicitly overridden at apply time?
Background: our use case always involves applying Operators to different Functions/Constants/etc than the ones they were originally built with. This is because compilation is expensive, and we reuse the compiled Operator as much as possible.
We hit an issue recently where a developer had forgotten to supply the value of an important Constant when running the operator, but this didn't lead to an error - instead the Operator was silently run with the Constant from the time that the operator was built. This took longer than it should have to diagnose.
For Functions, forgetting an argument like this typically results in an error, because the dimensions do not match. However, for scalar Constants this is not true.
I was imagining an argument supplied when instantiating the Functions/Constants (
no_default_arg=True
).Or perhaps it would be more intuitive to instead make it a keyword argument at Operator creation time, or perhaps even to
apply()
? (although default arguments fromDimension
s are probably still desirable...)The text was updated successfully, but these errors were encountered: