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

Fixing data_setitem function of label layer #6618

Merged
merged 7 commits into from Jan 27, 2024

Conversation

leopold-franz
Copy link
Contributor

@leopold-franz leopold-franz commented Jan 25, 2024

Labels layer bug fix. Adapting the test now

References and relevant issues

This PR closes an new issue that hasn't been noticed yet.

Description

This fixes a bug. The following error arises if the "value" input is an array and there are unchanged values in the indices.
*** ValueError: shape mismatch: value array of shape (855416,) could not be broadcast to indexing result of shape (88060,)

@github-actions github-actions bot added the tests Something related to our tests label Jan 25, 2024
@Czaki Czaki added this to the 0.4.19 milestone Jan 25, 2024
@Czaki Czaki added the bugfix PR with bugfix label Jan 25, 2024
@Czaki
Copy link
Collaborator

Czaki commented Jan 25, 2024

Thanks for spotting the bug and providing PR with a fix for it.

@Czaki Czaki added the ready to merge Last chance for comments! Will be merged in ~24h label Jan 25, 2024
Copy link

codecov bot commented Jan 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0be7f18) 92.06% compared to head (abf2bd1) 92.24%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6618      +/-   ##
==========================================
+ Coverage   92.06%   92.24%   +0.18%     
==========================================
  Files         604      604              
  Lines       53999    54001       +2     
==========================================
+ Hits        49713    49814     +101     
+ Misses       4286     4187      -99     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Czaki
Copy link
Collaborator

Czaki commented Jan 25, 2024

Nice spot.

Note

In [4]: isinstance(np.arange(10), Sequence)
Out[4]: False

@Czaki Czaki changed the title Fixing data_setitem function of label layer. Fixing data_setitem function of label layer Jan 27, 2024
@Czaki Czaki merged commit 56f2c71 into napari:main Jan 27, 2024
31 of 32 checks passed
Czaki pushed a commit that referenced this pull request Jan 27, 2024
Labels layer bug fix. Adapting the test now

# References and relevant issues
This PR closes an new issue that hasn't been noticed yet.

# Description
This fixes a bug. The following error arises if the "value" input is an
array and there are unchanged values in the indices.
*** ValueError: shape mismatch: value array of shape (855416,) could not
be broadcast to indexing result of shape (88060,)

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@Czaki Czaki removed the ready to merge Last chance for comments! Will be merged in ~24h label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix PR with bugfix tests Something related to our tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants