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
Defaults is an R6 class. This is because it facilitates incorporating a check that any changes to the list are only to existing names in the list keys, and not new names. This avoids an error where it is assumed the parameter was updated, but it actually wasn't, as the key was incorrect.
This works well and has no functional issues - but it does feel quite complicated - in particular, how it is used (with helper functions get_param() and defaults() in an attempt to simplify that - or potentially adding more complication?). However, it becomes redundant once that parameter list gets extracted from the object - to avoid that issue currently, I would need to input the environment to the model function (whereas I currently extract the list and input that to the function).
An alternative solution would for defaults to just be a function returning a list, and that the check on the keys is performed as part of the validation rules within model(). The downside of this approach is that it is not being checked at the point at which defaults is being modified. The positive is that it would be much simpler.
The text was updated successfully, but these errors were encountered:
Defaults is an R6 class. This is because it facilitates incorporating a check that any changes to the list are only to existing names in the list keys, and not new names. This avoids an error where it is assumed the parameter was updated, but it actually wasn't, as the key was incorrect.
This works well and has no functional issues - but it does feel quite complicated - in particular, how it is used (with helper functions
get_param()
anddefaults()
in an attempt to simplify that - or potentially adding more complication?). However, it becomes redundant once that parameter list gets extracted from the object - to avoid that issue currently, I would need to input the environment to the model function (whereas I currently extract the list and input that to the function).An alternative solution would for defaults to just be a function returning a list, and that the check on the keys is performed as part of the validation rules within
model()
. The downside of this approach is that it is not being checked at the point at which defaults is being modified. The positive is that it would be much simpler.The text was updated successfully, but these errors were encountered: