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

API access (hidden) to disable cubeviz movie UI #2440

Merged
merged 3 commits into from
Sep 12, 2023

Conversation

kecnry
Copy link
Member

@kecnry kecnry commented Sep 11, 2023

Description

This pull request creates a traitlet in the "Export Plot" plugin so that notebooks running a standalone UI can disable the capability for cubeviz movies (#2264). The movie implementation saves the movie on the python/server-side, so would for cases where the python/server and browser/client are on different machines, it may make sense to disable (at least until we re-implement to send the movie through the browser's save file dialog).

This can be done in the launching notebook via: cubeviz.plugins['Export Plot']._obj.movie_enabled = False.

Alternatively, this will default to True if the configuration sets server_is_remote: true, before the plugin is first initialized.

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

@kecnry kecnry requested a review from havok2063 September 11, 2023 18:58
can be disabled with: cubeviz.plugins['Export Plot']._obj.movie_enabled = False
@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Patch coverage is 93.33% of modified lines.

Files Changed Coverage
jdaviz/app.py ø
...configs/default/plugins/export_plot/export_plot.py 80.00%
...nfigs/cubeviz/plugins/tests/test_cubeviz_helper.py 100.00%

📢 Thoughts on this report? Let us know!.

@kecnry kecnry added the no-changelog-entry-needed changelog bot directive label Sep 12, 2023
@kecnry kecnry marked this pull request as ready for review September 12, 2023 16:20
Copy link
Contributor

@javerbukh javerbukh left a comment

Choose a reason for hiding this comment

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

This implementation looks reasonable to me.

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.

Does this mean anyone who wants to deploy to "cloud" needs their own YAML config?

@kecnry
Copy link
Member Author

kecnry commented Sep 12, 2023

Does this mean anyone who wants to deploy to "cloud" needs their own YAML config?

If anyone deploying to the cloud wants to disable cubeviz movie (or other similar "features" that aren't designed for running remotely), then they can either override the configuration from the YAML file (like MAST does - see also the added test) or with the snippet mentioned in the PR description.

Eventually we will want to avoid these cases and have all "exported" files sent through the browser rather than saved python/server-side 🐱.

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.

Approving by proxy for Cherinka.

@pllim pllim added this to the 3.7 milestone Sep 12, 2023
@pllim pllim added the cubeviz label Sep 12, 2023
@pllim
Copy link
Contributor

pllim commented Sep 12, 2023

Don't need backporting, right?

@kecnry
Copy link
Member Author

kecnry commented Sep 12, 2023

Don't need backporting, right?

Cubeviz movie was added in 3.6, but I still think this is more of a feature than a bugfix. MAST can update to 3.7 directly (currently running 3.4).

@kecnry kecnry merged commit 8943fb6 into spacetelescope:main Sep 12, 2023
@kecnry kecnry deleted the disable-movie branch September 12, 2023 19:27
javerbukh pushed a commit to javerbukh/jdaviz that referenced this pull request Sep 15, 2023
* (hidden) API access to disable cubeviz movie UI
* default movie_enabled based on new app-setting server_is_remote
* test coverage
javerbukh pushed a commit to javerbukh/jdaviz that referenced this pull request Sep 15, 2023
fix event handling for choosing config from launcher

filepath fallback when object from config-detection fails to load

fix: support for notebook 7 (spacetelescope#2420)

Notebook 7 requires a different way to detect if the app runs in
a notebook context.

Fix explanation in markdown cell.

DOC: Footprints plugin API docs (spacetelescope#2426)

* build footprints API docs

* add code snippet in plugin docs

* fix syntax in API docs

---------

Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com>

prevent overwriting user-API methods (spacetelescope#2425)

fix default color for overlay when traitlet set by user

* for the FIRST overlay, the user could have set the color traitlet before the internal overlay object is created (which occurs as soon as the plugin is first shown).  In that case, we want to respect the user choice of color.

similar fixes for any other traitlet when plugin inactive

regression test

change log entry

fix API import of single region and overwriting existing entry

* along with regression testing

TST: Also pull in scikit-image dev
to get rid of incompatibility with numpy

Use new "true circle" tool from glue-jupyter (spacetelescope#2332)

* Use truecircle tool
from glue-viz/glue-jupyter#376

* MNT: Bump glue-jupyter minversion
that can use this new tool

* Add change log

* Fix line too long

* Fix change log verbiage

Co-authored-by: Kyle Conroy <kyleconroy@gmail.com>

---------

Co-authored-by: Kyle Conroy <kyleconroy@gmail.com>

Enable multiselect in subset plugin for recentering (spacetelescope#2430)

* Enable multiselect in subset plugin for recentering

* Fix bug with default text

* Remove unused import

* Fix bug in aperature photometry

* Address review comments

* Remove commented out code

* Add initial tests

* Fix bug when exiting multiselect and switching subsets

* Add documentation and update CHANGES file

* Remove print statement

* Add comment about recentering taking multiple iterations to docs

* fix chip styling in subset dropdown

* only set selected_has_subregions if exists

* only show multiselect toggle in imviz

* Apply suggestions from code review

Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com>

---------

Co-authored-by: Kyle Conroy <kyleconroy@gmail.com>
Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com>

Debug standalone build (spacetelescope#2441)

* Log jdaviz output for debugging

* Run workflow on debugging branch

* See if collecting data from jupyter-client will fix this, otherwise might need to downgrade

* Remove debugging stuff

MNT: Bump actions/checkout to v4

Enable workflow_dispatch for standalone

because it cannot be enabled outside of main apparently

[ci skip] [rtd skip]

EXP: Update workflow versions

Fix Mosviz slit overlay (spacetelescope#2434)

* Fix Mosviz slit overlay
by using polygon instead of forcing a rectangle without angle info.

Co-authored-by: Camilla Pacifici <camilla.pacifici@gmail.com>

* Off by one error in predicted PR num

---------

Co-authored-by: Camilla Pacifici <camilla.pacifici@gmail.com>

API access (hidden) to disable cubeviz movie UI (spacetelescope#2440)

* (hidden) API access to disable cubeviz movie UI
* default movie_enabled based on new app-setting server_is_remote
* test coverage

TST: Ignore ASDF warning about gwcs-1.0.0 schema
because gwcs dev and/or asdf-wcs-schemas 0.2.0 triggers the warning because the schema is no longer supported.
javerbukh pushed a commit to javerbukh/jdaviz that referenced this pull request Sep 18, 2023
fix event handling for choosing config from launcher

filepath fallback when object from config-detection fails to load

fix: support for notebook 7 (spacetelescope#2420)

Notebook 7 requires a different way to detect if the app runs in
a notebook context.

Fix explanation in markdown cell.

DOC: Footprints plugin API docs (spacetelescope#2426)

* build footprints API docs

* add code snippet in plugin docs

* fix syntax in API docs

---------

Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com>

prevent overwriting user-API methods (spacetelescope#2425)

fix default color for overlay when traitlet set by user

* for the FIRST overlay, the user could have set the color traitlet before the internal overlay object is created (which occurs as soon as the plugin is first shown).  In that case, we want to respect the user choice of color.

similar fixes for any other traitlet when plugin inactive

regression test

change log entry

fix API import of single region and overwriting existing entry

* along with regression testing

TST: Also pull in scikit-image dev
to get rid of incompatibility with numpy

Use new "true circle" tool from glue-jupyter (spacetelescope#2332)

* Use truecircle tool
from glue-viz/glue-jupyter#376

* MNT: Bump glue-jupyter minversion
that can use this new tool

* Add change log

* Fix line too long

* Fix change log verbiage

Co-authored-by: Kyle Conroy <kyleconroy@gmail.com>

---------

Co-authored-by: Kyle Conroy <kyleconroy@gmail.com>

Enable multiselect in subset plugin for recentering (spacetelescope#2430)

* Enable multiselect in subset plugin for recentering

* Fix bug with default text

* Remove unused import

* Fix bug in aperature photometry

* Address review comments

* Remove commented out code

* Add initial tests

* Fix bug when exiting multiselect and switching subsets

* Add documentation and update CHANGES file

* Remove print statement

* Add comment about recentering taking multiple iterations to docs

* fix chip styling in subset dropdown

* only set selected_has_subregions if exists

* only show multiselect toggle in imviz

* Apply suggestions from code review

Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com>

---------

Co-authored-by: Kyle Conroy <kyleconroy@gmail.com>
Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com>

Debug standalone build (spacetelescope#2441)

* Log jdaviz output for debugging

* Run workflow on debugging branch

* See if collecting data from jupyter-client will fix this, otherwise might need to downgrade

* Remove debugging stuff

MNT: Bump actions/checkout to v4

Enable workflow_dispatch for standalone

because it cannot be enabled outside of main apparently

[ci skip] [rtd skip]

EXP: Update workflow versions

Fix Mosviz slit overlay (spacetelescope#2434)

* Fix Mosviz slit overlay
by using polygon instead of forcing a rectangle without angle info.

Co-authored-by: Camilla Pacifici <camilla.pacifici@gmail.com>

* Off by one error in predicted PR num

---------

Co-authored-by: Camilla Pacifici <camilla.pacifici@gmail.com>

API access (hidden) to disable cubeviz movie UI (spacetelescope#2440)

* (hidden) API access to disable cubeviz movie UI
* default movie_enabled based on new app-setting server_is_remote
* test coverage

TST: Ignore ASDF warning about gwcs-1.0.0 schema
because gwcs dev and/or asdf-wcs-schemas 0.2.0 triggers the warning because the schema is no longer supported.
@kecnry kecnry mentioned this pull request Oct 24, 2023
9 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants