-
Notifications
You must be signed in to change notification settings - Fork 13
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
Extra dims slider #417
Extra dims slider #417
Conversation
…this seemed to pick displayed data not all data so the update would end up showing blank zone due to first level being for example 218 -> 180 with data in that range...
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've added a few comments here and there where I could grasp what was going on. In general, I'm not sure I understand the motivation for this change. Is it all so that you can have sliders on an ipywidget in the jupyter lab notebooks?
Regardless of me understanding the motivation, I didn't see any obvious problems. So if it's passing all the tests, I guess it should be fine. I noticed you added a file under uvcdat-testdata
though, you might want to remove that before merging this.
tests/test_vcs_isofill_pick_frame.py
Outdated
|
||
class TestVCSBoxfillPickFrame(basevcstest.VCSBaseTest): | ||
def testBoxfillPickFrame(self): | ||
f = cdms2.open(os.path.join(cdat_info.get_sampledata_path(), "ta_ncep_87-6-88-4.nc")) |
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.
Should the class and method name be changed to match the filename (i.e. something with isofill
)?
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.
yep... you got me copy/pasting :) Will fix
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.
Actually these files are no longer need i created a more general test, will remove it.
vcs/displayplot.py
Outdated
|
||
try: | ||
import IPython.display | ||
import ipywidgets |
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.
My naive thought would be you set some variable here which you can later use to determine whether you have widgets or not. Otherwise, do you just assume the import worked later on?
vcs/displayplot.py
Outdated
if debug: | ||
IPython.display.display(self._parent._display_target.out) | ||
IPython.display.display(*widgets) | ||
IPython.display.display(IPythonDisplay(st)) |
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.
Does this mean vcs
now depends on IPython? Or maybe it always did, and I just didn't realize it?
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.
it's inside a try that starts with import IPython. So no it does not depend on it but takes advantage of it if present.
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.
No you're right it's been moved to its own section but only called from inside the try. I'll still use the variable way you suggested to prevent accidental use.
try: | ||
import IPython.display | ||
# import cdat_notebook |
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 guess there was already a dependency on IPython...
Looking back at my review, the mention of adding a baseline image in the Don't forget to remove that 😄 |
@sterlingbaldwin @downiec please try it in your envs. If it works for you, let's merge in. |
Works for me! |
in a notebook, after plotting, a slider appears for any extra dimensions plotted, moving the slider around update the picture.
Needed to fix a few things in VTK's backend:
update wouldn't work for vectors, isofill where using wrong contours, etc...
I think this is ready to go. Please ignore zillions of
if debug:
for now, I need them until we are sure it works.