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

FIX: Deserialization of sized variable items #653

Merged
merged 2 commits into from
Mar 1, 2024

Conversation

HGSilveri
Copy link
Collaborator

We were only supporting the deserialization of unsized variable items (e.g. single values obtained through var[0]), although we also supported sized variable items through slices (e.g. var[1:5:2]).

The abstract representation allowed for serialization of these variable items but then deserialization failed. The easiest way to fix this was actually to add support for indexing variables with a list of indices (e.g. var[[0, 1, 3]]), so this hotfix actually introduces a small enhancement.

  • Fixes deserialization from the abstract representation of sized variable items
  • Adds option to get a sized VariableItem by indexing a Variable with a list of indices
  • Supports __len__ for sized VariableItem instances

@HGSilveri HGSilveri requested a review from a-corni March 1, 2024 14:00
Copy link
Collaborator

@a-corni a-corni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me !

@HGSilveri HGSilveri merged commit 83894fe into master Mar 1, 2024
8 checks passed
@HGSilveri HGSilveri deleted the hotfix/abstract-repr-sized-varitem branch March 1, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants