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

[BUG] Method to_dict doesn't capture parameters of classes from external libraries #29

Open
1 task done
Mr-Geekman opened this issue Aug 14, 2023 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@Mr-Geekman
Copy link

Issue by Mr-Geekman
Wednesday May 03, 2023 at 13:19 GMT
Originally opened as tinkoff-ai#1256


🐛 Bug Report

We want to distinguish between transforms

transform_1 = ChangePointsTrendTransform(
    in_column="target",
    change_points_model=RupturesChangePointsModel(
        change_points_model=Binseg(model="ar"),
        n_bkps=5,
    ),
)
transform_2 = ChangePointsTrendTransform(
    in_column="target",
    change_points_model=RupturesChangePointsModel(
        change_points_model=Binseg(model="l1"),
        n_bkps=5,
    )
)

But currently they have the same to_dict, because Binseg isn't etna class.

We can have a similar problem with other external classes too, we should try to create a general solution for all such cases.

Expected behavior

We should learn how to handle external classes correctly.

How To Reproduce

from ruptures import Binseg

from etna.transforms.decomposition import RupturesChangePointsModel
from etna.transforms import ChangePointsTrendTransform


def main():
    transform_1 = ChangePointsTrendTransform(
        in_column="target",
        change_points_model=RupturesChangePointsModel(
            change_points_model=Binseg(model="ar"),
            n_bkps=5,
        ),
    )
    transform_2 = ChangePointsTrendTransform(
        in_column="target",
        change_points_model=RupturesChangePointsModel(
            change_points_model=Binseg(model="l1"),
            n_bkps=5,
        )
    )

    assert transform_1.to_dict() != transform_2.to_dict()


if __name__ == "__main__":
    main()

Environment

No response

Additional context

No response

Checklist

  • Bug appears at the latest library version
@Mr-Geekman Mr-Geekman added bug Something isn't working priority/medium Medium priority task labels Aug 14, 2023
@Mr-Geekman Mr-Geekman moved this to Todo in etna board Aug 15, 2023
@d-a-bunin d-a-bunin moved this from Todo to Hold in etna board Mar 26, 2024
@d-a-bunin d-a-bunin removed the priority/medium Medium priority task label May 30, 2024
@martins0n martins0n moved this from Hold to Specification in etna board Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Specification
Development

No branches or pull requests

2 participants