Skip to content

Add pop() for Points and Shapes - #8072

Merged
brisvag merged 16 commits into
napari:mainfrom
rahul713rk:issue8070
Sep 26, 2025
Merged

brisvag merged 16 commits into
napari:mainfrom
rahul713rk:issue8070

Conversation

@rahul713rk

Copy link
Copy Markdown
Contributor

References & Related Issues


Description

  • Implemented a pop method for both the Points and Shapes layers, enabling removal and return of point/shape data at a specified index.
  • Added tests for pop method.

@github-actions github-actions Bot added the tests Something related to our tests label Jul 6, 2025
@codecov

codecov Bot commented Jul 6, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.05%. Comparing base (5cade93) to head (90fb94f).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/napari/layers/points/points.py 90.90% 1 Missing ⚠️
src/napari/layers/shapes/shapes.py 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8072      +/-   ##
==========================================
+ Coverage   92.99%   93.05%   +0.06%     
==========================================
  Files         703      704       +1     
  Lines       63417    63609     +192     
==========================================
+ Hits        58972    59191     +219     
+ Misses       4445     4418      -27     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TimMonko TimMonko added this to the 0.6.3 milestone Jul 7, 2025
@rahul713rk
rahul713rk marked this pull request as ready for review July 8, 2025 13:48
@rahul713rk
rahul713rk requested a review from a team as a code owner July 8, 2025 13:48
@Czaki

Czaki commented Jul 8, 2025

Copy link
Copy Markdown
Collaborator

Could we wait with this on #8006? It will be easier to fix merge conflicts on this side.

@brisvag brisvag left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looking great!

Comment thread src/napari/layers/points/points.py Outdated
if not (0 <= index < len(self.data)):
return {
'data': None,
'properties': {},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we leave out properties since it's replaced byu features? Are we still trying to keep it around for some transition reason? @andy-sweet Do you remember the status of this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pretty sure this indeed shouldn't return properties, so I changed it :)

@TimMonko TimMonko modified the milestones: 0.6.3, 0.6.4 Jul 28, 2025

@brisvag brisvag left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As a followup, would be great to be able to go the other way: provide the same dictionary from pop and add a new point/shape with the given metadata/features already set.

@brisvag brisvag added the feature New feature or request label Sep 24, 2025
@brisvag

brisvag commented Sep 24, 2025

Copy link
Copy Markdown
Contributor

@rahul713rk I took the liberty to push the couple remaining issues, hopefully we're able to merge this for 0.6.5 :)

@brisvag

brisvag commented Sep 26, 2025

Copy link
Copy Markdown
Contributor

resolved the conflicts, let's see how this goes!

@brisvag brisvag changed the title [Update] Added pop for Points and Shapes Add pop() for Points and Shapes Sep 26, 2025
@brisvag brisvag added the highlight PR that should be mentioned in next release notes label Sep 26, 2025
@brisvag brisvag added the ready to merge Last chance for comments! Will be merged in ~24h label Sep 26, 2025
@brisvag
brisvag merged commit 53f097c into napari:main Sep 26, 2025
@github-actions github-actions Bot removed the ready to merge Last chance for comments! Will be merged in ~24h label Sep 26, 2025
@imagesc-bot

Copy link
Copy Markdown

This pull request has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/napari-v0-6-5-is-out/116715/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request highlight PR that should be mentioned in next release notes tests Something related to our tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement pop method for Shapes and Points

5 participants