Skip to content

Allow cube fit in deconfigged#4172

Open
rosteen wants to merge 6 commits into
spacetelescope:mainfrom
rosteen:cube-fit-in-deconfigged
Open

Allow cube fit in deconfigged#4172
rosteen wants to merge 6 commits into
spacetelescope:mainfrom
rosteen:cube-fit-in-deconfigged

Conversation

@rosteen
Copy link
Copy Markdown
Collaborator

@rosteen rosteen commented May 7, 2026

This PR allows the Cube Fit toggle to appear in the Model Fitting plugin when appropriate, and will hide it if the last cube data is deleted from the data collection. Note that I added two ToDos that I think are beyond the scope of this ticket but should be done to make sure model fitting is behaving properly in deconfigged. Basically, there are a couple places that fall back on assuming the cube was the first data loaded into the app, which isn't necessarily true in deconfigged in the same way it is in Cubeviz.

@rosteen rosteen added this to the 5.0.2 milestone May 7, 2026
@rosteen rosteen requested review from javerbukh and kecnry as code owners May 7, 2026 18:54
@rosteen rosteen added the bug Something isn't working label May 7, 2026
@rosteen rosteen added the plugin Label for plugins common to multiple configurations label May 7, 2026
@rosteen rosteen requested a review from MatthewPortman as a code owner May 7, 2026 18:54
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

❌ Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.76%. Comparing base (22cc726) to head (eceb3c6).

Files with missing lines Patch % Lines
...igs/default/plugins/model_fitting/model_fitting.py 88.23% 2 Missing ⚠️
jdaviz/core/template_mixin.py 50.00% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (84.21%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4172      +/-   ##
==========================================
- Coverage   84.76%   84.76%   -0.01%     
==========================================
  Files         205      205              
  Lines       30539    30552      +13     
==========================================
+ Hits        25886    25897      +11     
- Misses       4653     4655       +2     

☔ 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.

@rosteen rosteen force-pushed the cube-fit-in-deconfigged branch from 0edbc4e to bf63191 Compare May 8, 2026 17:51
if self.dataset_selected in self._app.data_collection.labels:
data = self._app.data_collection[self.dataset_selected]
else: # User selected some subset from spectrum viewer, just use original cube
# TODO: generalize this for deconfigged
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.

is there a ticket for this?

Copy link
Copy Markdown

@jbchampagne jbchampagne left a comment

Choose a reason for hiding this comment

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

I tested this out and the issue appears to be fixed, looks good to me!

if self.dataset_selected in self._app.data_collection.labels:
data = self._app.data_collection[self.dataset_selected].get_object(statistic=None)
else: # User selected some subset from spectrum viewer, just use original cube
# TODO: generalize this for deconfigged
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

does this need a separate ticket from what clare noted?

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

Labels

bug Something isn't working plugin Label for plugins common to multiple configurations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants