Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Reverse order of composite subset regions #2116

Merged
merged 2 commits into from
Mar 28, 2023

Conversation

javerbukh
Copy link
Contributor

Description

This pull request is to address the ordering of composite subset regions. These regions show what pixel region and subset mode operations (i.e. and, or, xor, andnot) went into creating a composite subset, and in what order. The order is now newest pixel region at the end of the list (what is returned when running viz.app.get_subsets(subset_name='Subset 1') and indexing region or by setting object_only=True when calling get_subsets()).

This PR continues work from #2087 .

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)?

@javerbukh javerbukh added this to the 3.5 milestone Mar 27, 2023
@codecov
Copy link

codecov bot commented Mar 27, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01 🎉

Comparison is base (e761361) 91.93% compared to head (c683bd9) 91.95%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2116      +/-   ##
==========================================
+ Coverage   91.93%   91.95%   +0.01%     
==========================================
  Files         143      143              
  Lines       15789    15780       -9     
==========================================
- Hits        14516    14510       -6     
+ Misses       1273     1270       -3     
Impacted Files Coverage Δ
jdaviz/app.py 93.41% <100.00%> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

@pllim
Copy link
Contributor

pllim commented Mar 27, 2023

I cannot run this PR right now, so could you pls list out the order of a compound subset with >=4 children (a) on main, and (b) with this patch? Thanks!

@javerbukh
Copy link
Contributor Author

@pllim
Order is Circle, remove Rectangle, remove Ellipse, add Circle
On this branch:

{'Subset 1': [{'name': 'CircularROI',
   'glue_state': 'AndState',
   'region': <CirclePixelRegion(center=PixCoord(x=24.538639068603516, y=23.073347091674805), radius=4.586855888366699)>},
  {'name': 'RectangularROI',
   'glue_state': 'AndNotState',
   'region': <RectanglePixelRegion(center=PixCoord(x=27.23071230908755, y=25.19592064096577), width=5.38414788092258, height=6.5606823723976575, angle=0.0 deg)>},
  {'name': 'EllipticalROI',
   'glue_state': 'AndNotState',
   'region': <EllipsePixelRegion(center=PixCoord(x=28.384458541870117, y=20.371891021728516), width=3.263286590576172, height=5.457768440246582, angle=0.0 deg)>},
  {'name': 'CircularROI',
   'glue_state': 'OrState',
   'region': <CirclePixelRegion(center=PixCoord(x=28.96133041381836, y=22.880386352539062), radius=2.884364128112793)>}]}

on main

{'Subset 1': [{'name': 'CircularROI',
'glue_state': 'OrState',
'region': <CirclePixelRegion(center=PixCoord(x=31.457237243652344, y=21.592124938964844), radius=3.6866350173950195)>},
{'name': 'EllipticalROI',
'glue_state': 'AndNotState',
'region': <EllipsePixelRegion(center=PixCoord(x=28.457298278808594, y=19.449268341064453), width=2.72735595703125, height=3.6365489959716797, angle=0.0 deg)>},
{'name': 'RectangularROI',
'glue_state': 'AndNotState',
'region': <RectanglePixelRegion(center=PixCoord(x=27.81445399350715, y=23.9492688860212), width=5.142752513289409, height=6.857142857142858, angle=0.0 deg)>},
{'name': 'CircularROI',
'glue_state': 'AndState',
'region': <CirclePixelRegion(center=PixCoord(x=25.671642303466797, y=21.806411743164062), radius=3.7910242080688477)>}]}

Copy link
Contributor

@pllim pllim left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

Copy link
Member

@kecnry kecnry left a comment

Choose a reason for hiding this comment

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

I agree that this makes more intuitive sense and the previous implementation hasn't been released yet, so let's get this in asap!

@pllim pllim merged commit 0466ba2 into spacetelescope:main Mar 28, 2023
@pllim
Copy link
Contributor

pllim commented Mar 28, 2023

Thanks, all!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants