-
Notifications
You must be signed in to change notification settings - Fork 7
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
latent/possible bug with LutView and ArrayView.remove_lut_view #138
Comments
Can we write the API such that Creation at removal time could then be determined either by state (i.e. add some |
Sure, but it's hard to enforce that at an API level: you would just need to make sure that every concrete implementation in the guis check isinstance... (before they had a guarantee, now they all need to check) |
Right...but it's also not a massive burden, because there are only 3
I'm not sure what you meant by this what was the guarantee? Maybe you can elaborate on your obverall goal (i.e. why you're doing that necessitates |
no no, it's definitely not hard, and if that's how it needs to be, that's fine... it just has a bit of a smell :). I'm thinking of something that is perhaps a gui specific subclass (like CanvasElement is a graphics specific subclass). I'm looking for a way to ensure via typing that "this thing should never be passed to this method". Currently, it looks like it should be just fine, the method wants a LutView, but if you give it one, it may or may not work. So, yes, we can implement those three methods and it would definitely work. but it does definitely require additional human-only comments to explain exactly how a subclass should implement it. |
in StreamingViewer, I was cleaning up, and tried it's here: |
I mean, one other idea is to put |
yeah, that could also potentially work. as long as each one can find its parent... (which I think it can right?) |
with #87, we have a very nice unification of LutViews, with both the GUI object that controls clims and cmap as well as the graphics object on the canvas both being an instance of
LutView
.ChannelController
is capable of managing either of these in it'slut_views
list.However, if one (read: me) is not careful, they might attempt to call
ArrayView.remove_lut_view()
on all of thelut_views
managed by a givenChannelController
. However, that would an error currently because only some of thoselut_views
are "relevant" for the front-end GUI object to "remove". (for example: we don't want to ask a Qt ArrayView to remove a vispy ImageHandle...)just hit this myself, need to think about best way to handle this.
cc @gselzer if you have any thoughts
The text was updated successfully, but these errors were encountered: