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 TSDataset.tsdataset_idx_slice loses hierarchical structure #439

Open
1 task done
d-a-bunin opened this issue Jul 31, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@d-a-bunin
Copy link
Collaborator

🐛 Bug Report

Method TSDataset.tsdataset_idx_slice loses hierarchical structure.

Expected behavior

It shouldn't

How To Reproduce

from etna.datasets import TSDataset
from etna.datasets import generate_hierarchical_df


def main():
    df = generate_hierarchical_df(periods=100, n_segments=[2, 4], start_time="2021-01-01",)
    df, hierarchical_structure = TSDataset.to_hierarchical_dataset(df=df, level_columns=["level_0", "level_1"])
    ts = TSDataset(df=df, freq="D", hierarchical_structure=hierarchical_structure)

    new_ts = ts.tsdataset_idx_slice(start_idx=10, end_idx=50)
    assert new_ts.hierarchical_structure is not None


if __name__ == "__main__":
    main()

Environment

No response

Additional context

No response

Checklist

  • Bug appears at the latest library version
@d-a-bunin d-a-bunin added the bug Something isn't working label Jul 31, 2024
@d-a-bunin d-a-bunin moved this from New to Specification in etna board Jul 31, 2024
@d-a-bunin d-a-bunin moved this from Specification to Todo in etna board Aug 28, 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: Todo
Development

No branches or pull requests

1 participant