Граф коммитов

838 Коммитов

Автор SHA1 Сообщение Дата
Thomas Robitaille 15098ddf09 Added Azure Pipelines configuration and removed Travis CI and AppVeyor configuration 2019-09-06 20:04:47 +01:00
Peter Williams 97518a596c
Merge pull request #221 from pkgw/jupyter-polish
Jupyter polish
2019-07-23 11:43:31 -04:00
Peter Williams 50de09837f Get CI packages from wwt channel, not astrofrog 2019-07-23 08:58:26 -04:00
Peter Williams c5bbd39ef2 Start testing on Python 3.7; stop testing on Python 3.5
conda-forge hasn't been building packages for Python 3.5 for a while, so that
installing the CI dependencies for that version has stopped working.
2019-07-23 08:58:26 -04:00
Peter Williams fd6a4fc2da Start working on CI failures
Pytest 5.0, recently released, includes pytest-faulthandler built in, and
trying to include it as an explicit dependency now results in a CI failure.
2019-07-23 08:58:26 -04:00
Peter Williams 1035ec993a package.json: wait a minute, we don't use any of these dev-dependencies
npm complains about security problems and, well, we just don't use these. We
can add things back later, at more recent versions, if we need to.
2019-07-23 08:58:26 -04:00
Peter Williams 25d058b0ec .gitignore: ignore some more generated files 2019-07-23 08:58:26 -04:00
Peter Williams 86764d9f5b webpack.config.js: put embed-bundle.js in the right place
Our `docs` directory doesn't use a `source/` subdirectory, so take that out of
the Webpack config. Add the generated files to .gitignore. Seeing as this file
wasn't landing in the right place and I don't see it referenced anywhere else
in the repo, I suspect that it's not actually doing anything.
2019-07-23 08:58:15 -04:00
Peter Williams 749af1d251 package.json: update @jupyter-widgets/base to the 2.0 series
I believe that we need to do this to be compatible with the JupyterLab 1.0.x
series. I don't fully understand what's going on, but changing this fixed a
failure to load for me, with an error along the lines of "No provider for
jupyterWidgetRegistry".
2019-07-15 22:09:40 -04:00
Peter Williams 3d9322d959 package.json: add a `files` stanza
This limits the files included in the NPM package to just our JavaScript
files. To the best of my understanding, these are the only ones we want. This
reduces the size of the resulting tarball from 14M to 6k.
2019-07-15 22:08:39 -04:00
Peter Williams a7c2c0ff1f docs/installation.rst: more thorough dev-mode Jupyter setup instructions
I hope. These are what have gotten things working for me with a fresh
environment I was just setting up.
2019-07-15 22:07:00 -04:00
Peter Williams 647d48d423 pywwt/__init__.py: fix the path to the notebook extension source
Relative to the pywwt module, these files live in `nbextension/static`, not
just `static`. Jupyter seems not to notice!
2019-07-15 20:50:15 -04:00
Peter Williams fa54ee6815
Merge pull request #215 from jsub1/interactive-figure
Interactive Figure Proof of Concept
2019-06-27 12:54:51 -04:00
Jeffrey SubbaRao 8e07376fdc Make the settings into a dict instead of an array 2019-06-26 12:06:52 -05:00
Peter Williams 871031f530
Merge pull request #220 from astrofrog/all-imagery
Include all available imagery layers
2019-06-25 21:43:26 -04:00
Thomas Robitaille c54b95a754 Make link checker more tolerant of slow responses 2019-06-24 23:03:04 +02:00
Thomas Robitaille ce922b6429 Include all available imagery layers 2019-06-23 08:48:40 +01:00
Jeffrey SubbaRao 436cbab3a3 Make error messages legible by giving it a lighter color for the time being 2019-06-12 10:29:51 -05:00
Jeffrey SubbaRao 2be030f01f Fix typos 2019-06-12 10:14:30 -05:00
Thomas Robitaille 43f8748b33 Added missing changelog entries 2019-06-10 22:29:20 +01:00
Jeffrey SubbaRao 92fd08d5a9 Minor fix to doc linking to reflect moving the remove method to the Annotation base class 2019-06-06 16:08:16 -05:00
Jeffrey SubbaRao 39b7a7167c Added comment 2019-06-06 16:08:15 -05:00
Jeffrey SubbaRao de45ee4d0d Move the js scripts in the interactive figure to their own directory 2019-06-06 16:08:15 -05:00
Jeffrey SubbaRao efda8e4bd9 Added tests for the serialization of the widget state 2019-06-06 16:08:15 -05:00
Jeffrey SubbaRao ab46da1f5d Fixed serialization for specified units in table layers 2019-06-06 16:08:15 -05:00
Jeffrey SubbaRao b9e890dc2d Broke the serialization core out into its own method so that we can test that componenet. 2019-06-06 16:08:15 -05:00
Jeffrey SubbaRao 757d93cfaa Replace camel case variables in python with underscores 2019-06-06 16:08:15 -05:00
Jeffrey SubbaRao cd4583391f Add saving of annotations to the interactive figure. Also added the option of specifying the center of a circle annotation in the constructor. That way we do not have to make a potentially blocking call to the widget's get_center if we are going to change the center immediately anyways. 2019-06-06 16:08:15 -05:00
Jeffrey SubbaRao eba8e2b5ca A tiny bit of clean up. Use simple traits method instead of
class_own_traits
2019-06-06 16:08:15 -05:00
Jeffrey SubbaRao 5c8ee5c074 Add 3D view mode specific settings and tracking planets/moons to the interactive figures 2019-06-06 16:08:14 -05:00
Jeffrey SubbaRao 667a8f33c5 Allow creation of multiple directories if specified when saving a bundle 2019-06-06 16:08:14 -05:00
Jeffrey SubbaRao 941c5f6ec5 Tweaking the doc string 2019-06-06 16:08:14 -05:00
Jeffrey SubbaRao 4a719236b2 Added initial doc string for save_as_html_bundle. Also renamed widght/height to max_width/max_height for better clarity 2019-06-06 16:08:14 -05:00
Jeffrey SubbaRao 46d807d2ac Add initial public method to generate either zipped or unzipped figures. Might need to tweak the root directory of the zip file later. 2019-06-06 16:08:14 -05:00
Jeffrey SubbaRao 3d85f48d76 First version of the html and js files needed for the interactive figure. More states need to be serialized/decoded and the user notification of errors could be improved. 2019-06-06 16:08:14 -05:00
Jeffrey SubbaRao ffd5874f11 change variable name 2019-06-06 16:08:14 -05:00
Jeffrey SubbaRao f9d5a98aa6 Added private methods for total serialization of the widget. Public interface is still a WIP 2019-06-06 16:08:13 -05:00
Jeffrey SubbaRao 6ae4ac1d65 Have to serialize the frame for table layers 2019-06-06 16:08:13 -05:00
Jeffrey SubbaRao 1cd3985566 fix whitespace 2019-06-06 16:08:13 -05:00
Jeffrey SubbaRao dc706b09b2 Serialization for the layer manager 2019-06-06 16:08:13 -05:00
Jeffrey SubbaRao 1eb3919771 Initial serialization code for image layers. Also tweaked the way we save the table layer data to be consistent with the image layer 2019-06-06 16:08:13 -05:00
Jeffrey SubbaRao c5583c40d0 have to include layer type info in serialization 2019-06-06 16:08:13 -05:00
Jeffrey SubbaRao cbfacac5ab intial serialization functions for table layers 2019-06-06 16:08:13 -05:00
Peter Williams 359cc0f24c
Merge pull request #217 from pkgw/image-ux
Work on image-display user experience
2019-06-06 16:25:59 -04:00
Peter Williams 6817d21d75
Merge pull request #219 from pkgw/fix-hub-urls
pywwt/jupyter_server.py: fix file service in JupyterHub contexts
2019-06-06 15:31:11 -04:00
Peter Williams 59994c61ad pywwt/jupyter_server.py: fix file service in JupyterHub contexts
When we're serving up files in JupyterHub, we need to include the notebook
server's base_url in the URL we generate. This is obnoxious to determine from
inside a kernel, but I found some code that shows how to do it.

Also added some module-level documentation outlining what's going on and why.
2019-06-06 14:54:52 -04:00
Peter Williams ac8b91930a Add min/max controls to the Jupyter image layer control widgets
Now by showing `my_image_layer.controls` you get widgets that let you adjust
the opacity, stretch function, and data range. The best UI I could come up
with for the data range has "coarse" controls that are typed in manually and
"fine" controls that use a range slider widget.

I note that in my testing, the adjustments don't apply until focus changes to
another widget, which makes for a kind of weak UX. I checked the ipywidgets
bug tracker but don't see any complaints about this; I'm not sure what's going
on, since this seems like a pretty basic piece of functionality.
2019-06-06 10:48:12 -04:00
Peter Williams af97e29d1d Make it so that the Jupyter widget can return a custom ImageLayer subclass
This custom subclass exposes some work-in-progress controls that allow the
image display parameters to be adjusted interactively.
2019-06-06 10:48:12 -04:00
Peter Williams 9826a7f283 pywwt/layers.py: honor user-supplied vmax/vmin and make sure settings are applied
The way that the ImageLayer constructor was structured, any user specification
of the vmax and vmin values would be overridden. Restructure to prefer them,
and also make sure that the settings are applied but not in a redundant way.
2019-06-06 10:48:12 -04:00
Peter Williams 5b52e15c2e lib/wwt.js: defensive coding for multiple views of a single model
In the Jupyter widget system, it is possible to create multiple views of a
single widget model. Views can be "detached", in which case their underlying
DOM elements are removed from the document. This is what happens if you create
a WWT view in a JupyterLab notebook, use the "Create a new view for this
output" context menu item to move the output to a new tab, and then hide the
original output. There is one underlying widget model and two views, only one
of which has active DOM elements.

The wrinkle for pywwt is that all of our widget state is stored inside the
<iframe> that does the rendering, so we're not really a real model-view setup.
The way things currently work, operations that affect the widget state are
passed as message from Python to JS, which are then distributed to all of the
views. So long as all views receive the same messages, things should stay in
sync. (Although if you create a widget, do some things to it, and then create
a new view of it, that view will have missed historical messages and so will
be out of sync.)

The problem I discovered was that if you send messages to a "detached" widget
view, you sometimes get JS exceptions. And apparently the code that
distributes the messages just terminates, preventing the control messages from
being sent to other widget views. This means that those views basically stop
responding to any Python controls.

This is bad news for the workflow of creating a WWT view then moving it to a
separate tab, which is something we very much want to support for UX reasons.
The real solution is to Do The Right Thing when a widget is detached, so that
the JS exceptions don't happen in the first place, but that's going to take
some time to get right. In the meantime, let's just log and swallow those JS
exceptions, so that the message passing can keep on working to the views that
aren't broken. This will keep things limping along.
2019-06-06 10:48:12 -04:00