-
Notifications
You must be signed in to change notification settings - Fork 10
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
flatten/binning: handle slow live-updates for large data #56
Conversation
* raise a warning alert in the plugin telling the user the live-previews aren't updating and prompt them to manually update the preview or to disable the preview markers
* doesn't require upstream PR, but won't have any affect without it
Codecov ReportAttention:
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, works for me. One small revision requested, but not required.
@@ -189,6 +200,10 @@ def _live_update(self, event={}): | |||
mark.times = [] | |||
mark.update_xy(times, lc.flux.value) | |||
|
|||
self.last_live_time = np.round(time() - start, 2) | |||
if self.last_live_time > 0.3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make the threshold a traitlet, and expose it in the user API? It'd be great if a user could assert: "I'm sick of that warning, I'll gladly wait, leave me alone." The user could set the number to 10_000
, get coffee, and come back without a warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea, but even though we aren't technically committing to API yet, we might soon, and I think it might make sense to play with it and converge more on the feature (if necessary) before we make it customizable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with that. 👍🏻
…ope#56) * flatten: disable live-updating when slow * raise a warning alert in the plugin telling the user the live-previews aren't updating and prompt them to manually update the preview or to disable the preview markers * binning: disable live-updating when slow * make use of action_spinner * doesn't require upstream PR, but won't have any affect without it
This PR introduces a check on the time that the live-updates take, and if exceeding a certain threshold, temporarily disables the live-preview updates and shows an alert prompting to either manually update the live-preview or disable the live-preview marks.
This also makes use of a change upstream in jdaviz to show a spinner in the "apply" buttons when the plugin is computing which temporarily disables clicking the button. For cases where binning/flattening is slow to run, this gives immediate feedback that the button was clicked and doesn't need to be clicked again. This doesn't need to be blocked by pinning a new release of jdaviz,
but should make sure that PR gets merged first.The code here can be simplified slightly by using the
@with_spinner()
decorator from spacetelescope/jdaviz#2560, but that can be a follow-up once that is in a jdaviz release.Note: this video was before some style changes in spacetelescope/jdaviz#2560 - the check marks are now gone and will show a spinner, if running on jdaviz main. If not running on main, the "bin" button will not react, but everything else will still work.
Screen.Recording.2023-11-10.at.12.35.36.PM.mov