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

FR/RFC: optional kwarg to disable (some?) default operator arguments #812

Open
tjb900 opened this issue Apr 25, 2019 · 1 comment
Open

Comments

@tjb900
Copy link
Contributor

tjb900 commented Apr 25, 2019

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...)

@FabioLuporini
Copy link
Contributor

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?

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

2 participants