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

Adding DeprecatedTransformMixin class #2321

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mgrange1998
Copy link
Contributor

Summary:
This task starts the backlog task T182722751 "Rename Ax transforms in terms of what they transform from and to, when it isn't clear"

It has a list of transforms to have their names updated to clearer values

OrderedChoiceEncode -> OrderedChoiceToIntegerRange
ChoiceEncode -> ChoiceToNumericChoice
TaskEncode -> TaskChoiceToIntTaskChoice
Cast -> Map

This change

  • Adds a "DeprecatedTransformMixin", which classes can inherit from in order to print a logging message with the deprecated transform and the new transform to update to.
  • Overrides the eq built-in of Transform to support equality between a DeprecatedTransform(DeprecatedTransformMixin, Transform) and an equivalent Transform object. This is needed for cases where a DeprecatedTransform is saved to a sqa store, and loaded back as the equivalent renamed Transform

Subsequent changes will add the new transform classes, and update the transform registry to point to the new classes instead of the old.

Warning

The warning is as follows:

[WARNING 04-04 09:58:45] ax.modelbridge.transforms.deprecated_transform_mixin: 
`DeprecatedTransform` transform has been deprecated 
and will be removed in a future release. Using `Transform` instead.

Differential Revision: D55643016

Summary:
This task starts the backlog task T182722751 "Rename Ax transforms in terms of what they transform from and to, when it isn't clear"

It has a list of transforms to have their names updated to clearer values
```
OrderedChoiceEncode -> OrderedChoiceToIntegerRange
ChoiceEncode -> ChoiceToNumericChoice
TaskEncode -> TaskChoiceToIntTaskChoice
Cast -> Map
```

This change
- Adds a "DeprecatedTransformMixin", which classes can inherit from in order to print a logging message with the deprecated transform and the new transform to update to. 
- Overrides the __eq__ built-in of Transform to support equality between a DeprecatedTransform(DeprecatedTransformMixin, Transform) and an equivalent Transform object. This is needed for cases where a DeprecatedTransform is saved to a sqa store, and loaded back as the equivalent renamed Transform

Subsequent changes will add the new transform classes, and update the transform registry to point to the new classes instead of the old. 

## Warning

The warning is as follows:
```
[WARNING 04-04 09:58:45] ax.modelbridge.transforms.deprecated_transform_mixin: 
`DeprecatedTransform` transform has been deprecated 
and will be removed in a future release. Using `Transform` instead.
```

Differential Revision: D55643016
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Apr 4, 2024
@facebook-github-bot
Copy link
Contributor

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

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants