-
Notifications
You must be signed in to change notification settings - Fork 314
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
Improve handling around optional attrs #3151
Conversation
This pull request was exported from Phabricator. Differential Revision: D66833556 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3151 +/- ##
==========================================
- Coverage 95.84% 95.84% -0.01%
==========================================
Files 509 509
Lines 51354 51425 +71
==========================================
+ Hits 49222 49290 +68
- Misses 2132 2135 +3 ☔ View full report in Codecov by Sentry. |
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
523dadd
to
1e97473
Compare
This pull request was exported from Phabricator. Differential Revision: D66833556 |
1e97473
to
d27b349
Compare
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
This pull request was exported from Phabricator. Differential Revision: D66833556 |
d27b349
to
407668f
Compare
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
This pull request was exported from Phabricator. Differential Revision: D66833556 |
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
407668f
to
0a2ae46
Compare
This pull request was exported from Phabricator. Differential Revision: D66833556 |
0a2ae46
to
0457bcf
Compare
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
This pull request was exported from Phabricator. Differential Revision: D66833556 |
Summary: Implement "best point" functionality in Client. A few notes: * Renamed get_best_trial --> get_best_arm: this is more accurate to what it is actually doing (calculating the best in sample point) and renaming will allow us to continue using this method when we create BatchClient * If GS is not on a predictive step we return {} for the prediction term in both get_best_arm and get_pareto_frontier as well as log an error Reviewed By: lena-kashtelyan Differential Revision: D66702545
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
0457bcf
to
3cdc660
Compare
This pull request was exported from Phabricator. Differential Revision: D66833556 |
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
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
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
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
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
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
This pull request has been merged in de80239. |
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:
Differential Revision: D66833556