Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve handling around optional attrs (facebook#3151)
Summary: After disccusion offline with lena-kashtelyan we decided that _none_throws_experiment() is a little verbose and it would be easier for developers to have a simple property with a short name to access attributes that may or may not be set on the Client. That being said we wanted to still keep them private as to not imply that it was supported behavior for users to call these functions and rely on their outputs' structure not changing. With that in mind we're making the following changes: 1. All optional attrs are prefixed with _maybe ex. _experiment becomes _maybe_experiment 2. All optional attrs get a @/property where the maybe is dropped and none_throws is called 3. _generation_strategy and _early_stopping_strategy get special methods that either return either return the existing attr or instantiate some default, call client.set, and return. This is important so a user that is fine with defaults will not have to call client.configure_generation_strategy(GenerationStrategyConfig()) manually Reviewed By: lena-kashtelyan Differential Revision: D66833556
- Loading branch information