-
Notifications
You must be signed in to change notification settings - Fork 38
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
as_steps support in profile viewer #309
Conversation
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.
As mentioned in glue-viz/glue#2292 (comment), I think we should instead be implementing the logic of converting the profile into a stepped profile in the bqplot layer artist so that it would be analogous to the fact that this conversion is done in the layer artist for Matplotlib (in fact it is done inside Matplotlib because of the drawstype='steps' option).
@@ -6,5 +6,8 @@ | |||
<div> | |||
<v-select label="attribute" :items="attribute_items" v-model="attribute_selected" hide-details /> | |||
</div> | |||
<div> | |||
<v-switch label="Plot as steps/histogram" v-model="as_steps" /> |
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 would avoid using the terminology 'histogram' here, maybe just use 'steps'
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 and works great! Can you add a changelog entry? Also we will need to wait to merge this until a new version of glue-core is released, will try and do shortly once we merge the other PR.
Just noticed that this seems to break when adding a subset (within the bqplot steps logic)... we'll need to fix that before merging/releasing. |
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.
Could you check that this works with glue-core 1.3.0 and if so bump the minimum glue-core version in setup.cfg? Once that is done I think we can merge this.
Codecov Report
@@ Coverage Diff @@
## main #309 +/- ##
==========================================
+ Coverage 89.14% 89.16% +0.02%
==========================================
Files 86 86
Lines 4275 4284 +9
==========================================
+ Hits 3811 3820 +9
Misses 464 464
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
* this can occur when first creating a subset, for example
60958e6
to
3cd9d31
Compare
Sorry this fell off the radar for a little while. I rebased, confirmed this works with glue 1.3+, and set that as a requirement in setup.cfg. |
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 great, thanks!
Description
This accompanies glue-viz/glue#2292 to expose the
as_steps
switch in the layer options widget, and handling togglingas_steps
in the bqplot layer artist for the profile viewer. The actual binning logic is adopted from https://github.com/astropy/specutils/blob/main/specutils/spectra/spectral_axis.py#L42.