-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add optional default to Category node #33
Conversation
Closes #1 Also clean up handling of optional attributes in evaluator
@IzaakWN does this work for your case? |
Yes, the Regarding a default value in |
I think we can make a nice solution for default Variable input by allowing a sentinel object in the variant for the evaluate signature, e.g.: double Correction::evaluate(const std::vector<std::variant<int, double, std::string, Variable::default>>& values) const; But I will save that for another PR. I think also that, after adding the binning overflow in #37, it might make sense to allow the default value to be any Content node, that way it is clearly separated from the valid keys in the mapping. Something like |
We could also have
so that one could re-use a key or add a new node. The question is whether this is prone to abuse: after all, if there is a default, it need not have a key. But I could also see an argument for having a "nominal" key. |
I settled on
|
Closes #1
Also clean up handling of optional attributes in evaluator