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

Hope to add multi-dimensional slicing function for VGroup like Numpy.Array #2916

Open
zg-young opened this issue Aug 7, 2022 · 1 comment · May be fixed by #4036
Open

Hope to add multi-dimensional slicing function for VGroup like Numpy.Array #2916

zg-young opened this issue Aug 7, 2022 · 1 comment · May be fixed by #4036
Labels
new feature Enhancement specifically adding a new feature (feature request should be used for issues instead)

Comments

@zg-young
Copy link

zg-young commented Aug 7, 2022

Description of proposed feature

A slice function like Numpy.Array,for example:

a = VGroup(Vgroup(..), ...) # 2 dim vgroup
a[1:4, 2:4] # slice

How can the new feature be used?

Slice function will make great sense for 2 dim mobject vgroup,if 2 dim Square vgroup represents a image, I want to get a part of image(that is a patch),but there is no simple method to impIement it, I have tried many times to overwrite Vgroup's method getitem(succeed to Group),but there is bug, which will affect other functions.

Additional comments

@zg-young zg-young added the new feature Enhancement specifically adding a new feature (feature request should be used for issues instead) label Aug 7, 2022
@MrDiver MrDiver added this to Dev Board Nov 8, 2022
@MrDiver MrDiver moved this to 🆕 New in Dev Board Nov 8, 2022
@chopan050
Copy link
Contributor

The only problem I see with this is that, unlike in NumPy where all rows would have the same length, there's nothing enforcing that all the internal Groups or Mobjects have the same amount of submobjects, so one can easily index out of bounds.

Otherwise, I like this idea!

@chopan050 chopan050 linked a pull request Dec 2, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Enhancement specifically adding a new feature (feature request should be used for issues instead)
Projects
Status: 🆕 New
Development

Successfully merging a pull request may close this issue.

2 participants