Ax icon indicating copy to clipboard operation
Ax copied to clipboard

Adding DeprecatedTransformMixin class

Open mgrange1998 opened this issue 1 year ago • 1 comments

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

mgrange1998 avatar Apr 04 '24 17:04 mgrange1998

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

facebook-github-bot avatar Apr 04 '24 17:04 facebook-github-bot