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

Light cleanup of GenerationStrategyInterface #2256

Closed

Conversation

lena-kashtelyan
Copy link
Contributor

Summary:
Key changes:

  1. bring back to GS aspects of GSI that are not needed there and are polluting the interface,
  2. make _name a required attribute of both GSI and GS.

Re: 2), having it be set during the first call to name property was causing weird bugs in equality checks, there two GSs looked like they were equal but they weren't at the time of the initial equality check (one had the _name set because its name prop was called, and another did not yet). They would become equal during the call to __repr__ that occurred in reporting their inequality as an error (!), because __repr__ would call GS.name, which would result in GS._name getting set. Weird stuff!

Reviewed By: danielcohenlive, mgarrard

Differential Revision: D51441575

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 7, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51441575

lena-kashtelyan pushed a commit to lena-kashtelyan/Ax that referenced this pull request Mar 7, 2024
Summary:

Key changes: 
1. bring back to GS aspects of GSI that are not needed there and are polluting the interface,
2. make `_name` a required attribute of both GSI and GS. 

Re: 2), having it be set during the first call to `name` property was causing weird bugs in equality checks, there two GSs looked like they were equal but they weren't at the time of the initial equality check (one had the `_name` set because its `name` prop was called, and another did not yet). They would become equal during the call to `__repr__` that occurred in reporting their inequality as an error (!), because `__repr__` would call `GS.name`, which would result in `GS._name` getting set. Weird stuff!

Reviewed By: danielcohenlive, mgarrard

Differential Revision: D51441575
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51441575

Summary:

Key changes: 
1. bring back to GS aspects of GSI that are not needed there and are polluting the interface,
2. make `_name` a required attribute of both GSI and GS. 

Re: 2), having it be set during the first call to `name` property was causing weird bugs in equality checks, there two GSs looked like they were equal but they weren't at the time of the initial equality check (one had the `_name` set because its `name` prop was called, and another did not yet). They would become equal during the call to `__repr__` that occurred in reporting their inequality as an error (!), because `__repr__` would call `GS.name`, which would result in `GS._name` getting set. Weird stuff!

Reviewed By: danielcohenlive, mgarrard

Differential Revision: D51441575
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51441575

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 73.33333% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 94.84%. Comparing base (d0df866) to head (1e96b05).

❗ Current head 1e96b05 differs from pull request most recent head 4c3106c. Consider uploading reports for the commit 4c3106c to get more accurate results

Files Patch % Lines
ax/core/generation_strategy_interface.py 66.66% 4 Missing ⚠️
ax/utils/testing/core_stubs.py 40.00% 3 Missing ⚠️
ax/modelbridge/generation_strategy.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2256      +/-   ##
==========================================
- Coverage   94.86%   94.84%   -0.02%     
==========================================
  Files         467      467              
  Lines       46478    46489      +11     
==========================================
+ Hits        44090    44094       +4     
- Misses       2388     2395       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

lena-kashtelyan pushed a commit to lena-kashtelyan/Ax that referenced this pull request Mar 8, 2024
Summary:

Key changes: 
1. bring back to GS aspects of GSI that are not needed there and are polluting the interface,
2. make `_name` a required attribute of both GSI and GS. 

Re: 2), having it be set during the first call to `name` property was causing weird bugs in equality checks, there two GSs looked like they were equal but they weren't at the time of the initial equality check (one had the `_name` set because its `name` prop was called, and another did not yet). They would become equal during the call to `__repr__` that occurred in reporting their inequality as an error (!), because `__repr__` would call `GS.name`, which would result in `GS._name` getting set. Weird stuff!

Reviewed By: danielcohenlive, mgarrard

Differential Revision: D51441575
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in c7dadf4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants