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

Remove annulus from aperture photometry plugin #2276

Merged
merged 2 commits into from
Jul 6, 2023

Conversation

pllim
Copy link
Contributor

@pllim pllim commented Jun 29, 2023

Description

This pull request is to remove annulus options from Simple Aperture Photometry plugin. Now, you can draw annulus from the draw tool and then select it in the plugin like other shapes (implemented in #2240). This is another step towards #2139.

Screenshot 2023-06-29 190008

Fixes #2190

Change log entry

  • Is a change log needed? If yes, is it added to CHANGES.rst? If you want to avoid merge conflicts,
    list the proposed change log here for review and add to CHANGES.rst before merge. If no, maintainer
    should add a no-changelog-entry-needed label.

Checklist for package maintainer(s)

This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.

  • Are two approvals required? Branch protection rule does not check for the second approval. If a second approval is not necessary, please apply the trivial label.
  • Do the proposed changes actually accomplish desired goals? Also manually run the affected example notebooks, if necessary.
  • Do the proposed changes follow the STScI Style Guides?
  • Are tests added/updated as required? If so, do they follow the STScI Style Guides?
  • Are docs added/updated as required? If so, do they follow the STScI Style Guides?
  • Did the CI pass? If not, are the failures related?
  • Is a milestone set? Set this to bugfix milestone if this is a bug fix and needs to be released ASAP; otherwise, set this to the next major release milestone.
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

photometry plugin. Use the draw tool.

[ci skip] [rtd skip]
@pllim pllim added the plugin Label for plugins common to multiple configurations label Jun 29, 2023
@pllim pllim added this to the 3.6 milestone Jun 29, 2023
@github-actions github-actions bot added documentation Explanation of code and concepts imviz labels Jun 29, 2023
@pllim pllim marked this pull request as ready for review June 29, 2023 23:01
@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (a9f13e9) 91.34% compared to head (658a041) 91.34%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2276   +/-   ##
=======================================
  Coverage   91.34%   91.34%           
=======================================
  Files         150      150           
  Lines       16848    16815   -33     
=======================================
- Hits        15390    15360   -30     
+ Misses       1458     1455    -3     
Impacted Files Coverage Δ
...imviz/plugins/aper_phot_simple/aper_phot_simple.py 92.66% <ø> (-0.20%) ⬇️
...daviz/configs/imviz/tests/test_simple_aper_phot.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Comment on lines +184 to +189

.. note::

You cannot use annulus region as aperture (an exception will be thrown)
but you may use it for background (see below).

Copy link
Member

Choose a reason for hiding this comment

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

this error might be confusing. Can we either exclude the annulus subsets from the dropdown, or check immediately on selection and raise a validation error instead? Or at the least, can we provide a more end-user-friendly message that states that annulus regions are not valid for the aperture?
Screen Shot 2023-06-30 at 12 45 06 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kecnry , since you brought it up, is there a way to add custom filter here without having to refactor that class itself? I thought about having the aperture dropdown to skip incompatible shape and not show them but not sure how to do it.

class SubsetSelect(SelectPluginComponent):

I vaguely remember you implemented some sort of filtering somewhere...

Copy link
Member

Choose a reason for hiding this comment

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

this is more involved than I had hoped. Feel free to leave as-is for now and open a follow-up ticket so we can generalize filtering to the subset component.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay I opened #2280

Copy link
Collaborator

@duytnguyendtn duytnguyendtn left a comment

Choose a reason for hiding this comment

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

UI looks as expected and the code removals make sense. Thanks!

@pllim pllim merged commit 9402123 into spacetelescope:main Jul 6, 2023
@pllim pllim deleted the bye-bye-ann-bg branch July 6, 2023 15:44
@pllim
Copy link
Contributor Author

pllim commented Jul 6, 2023

Thanks, all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Explanation of code and concepts imviz plugin Label for plugins common to multiple configurations Ready for final review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove annulus settings from Simple Aperture Photometry plugin
3 participants