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

Rename OrderedChoiceEncode => OrderedChoiceToIntegerRange #2323

Closed
wants to merge 2 commits into from

Conversation

mgrange1998
Copy link
Contributor

Summary:
This change renames the OrderedChoiceEncode transform to one which reflects its behavior- see T182722751 for the overall task.

  • Adds a new "OrderedChoiceToIntegerRange" class with the logic from the original OrderedChoiceEncode
  • Updates OrderedChoiceEncode to inherit from DeprecatedTransformMixin and OrderedChoiceToIntegerRange
  • Updates the registry to support the new transform.

Initially, the new classes will be decoded into the deprecated classes to maintain backwards compatibility. Once the new classes are landed, call sites will be updated to use the new class instead of the old.

Differential Revision: D55754487

@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: D55754487

mgrange1998 added a commit to mgrange1998/Ax that referenced this pull request Apr 4, 2024
)

Summary:

This change renames the OrderedChoiceEncode transform to one which reflects its behavior- see T182722751 for the overall task. 

- Adds a new "OrderedChoiceToIntegerRange" class with the logic from the original OrderedChoiceEncode
- Updates OrderedChoiceEncode to inherit from DeprecatedTransformMixin and OrderedChoiceToIntegerRange
- Updates the registry to support the new transform.

Initially, the new classes will be decoded into the deprecated classes to maintain backwards compatibility. Once the new classes are landed, call sites will be updated to use the new class instead of the old.

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

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

Summary:
This task starts the backlog task "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.
```

Reviewed By: mpolson64

Differential Revision: D55643016
)

Summary:

This change renames the OrderedChoiceEncode transform to one which reflects its behavior- see T182722751 for the overall task. 

- Adds a new "OrderedChoiceToIntegerRange" class with the logic from the original OrderedChoiceEncode
- Updates OrderedChoiceEncode to inherit from DeprecatedTransformMixin and OrderedChoiceToIntegerRange
- Updates the registry to support the new transform.

Initially, the new classes will be decoded into the deprecated classes to maintain backwards compatibility. Once the new classes are landed, call sites will be updated to use the new class instead of the old.

Reviewed By: mpolson64

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

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 60330a8.

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.

2 participants