CDAT / vcs-js

3 stars 3 forks source link

Printing variables works using cdms2 and all plots work. #1

Closed danlipsa closed 7 years ago

danlipsa commented 7 years ago

@aashish24 @doutriaux1 @chaosphere2112 @mattben @jbeezley Please review.

vcs-js is back to the old master capabilities with the new vtkweb frontend and ES6 - thanks to Jon for starting this. vcs-js Outstanding issues:

  1. client plots (top left) don't transfer data from the server, but use a canned data pulled from girder.
  2. Windows are not closed on the server - this seems to be a vcs issue: https://github.com/UV-CDAT/vcs/issues/21
  3. the isofill, robinson projection seems to be clipped: https://github.com/UV-CDAT/vcs/issues/26
  4. Sometimes you get a blank area for one of the plots when you refresh.
  5. On Mac, you need to resize the browser window to get the plots to show up.
  6. On Mac, Firefox shows a scrollbar, Chrome and Safari do not - I think this is a problem with the demo rather than the API.
chaosphere2112 commented 7 years ago

@danlipsa I'm trying to test it, but apparently the build of VTK on our conda channel doesn't have VTKWeb installed.

Traceback (most recent call last):
  File "server.py", line 35, in <module>
    from vtk.web import protocols, server
  File "/Users/fries2/anaconda/envs/vtkwebjs/lib/python2.7/site-packages/vtk/web/protocols.py", line 9, in <module>
    from vtkWebCorePython import vtkWebApplication, vtkWebInteractionEvent
ImportError: No module named vtkWebCorePython
# packages in environment at /Users/fries2/anaconda/envs/vtkwebjs:
#
cloog                     0.18.0                        0  
nodejs                    4.5.0                         0    conda-forge
curl                      7.49.0                        1  
freetype                  2.5.5                         1  
gmp                       5.1.2                         6  
isl                       0.12.2                        1  
jbig                      2.1                           0  
jpeg                      8d                            2  
libpng                    1.6.17                        0  
libtiff                   4.0.6                         2  
mpc                       1.0.1                         0  
mpfr                      3.1.2                         0  
numpy                     1.9.2                    py27_2  
openssl                   1.0.2j                        0  
pip                       8.1.2                    py27_0  
python                    2.7.12                        1  
readline                  6.2                           2  
setuptools                27.2.0                   py27_0  
sqlite                    3.13.0                        0  
tk                        8.5.18                        0  
cdat_info                 2.6.1                    UVCDAT    uvcdat
cdms2                     2.6.1                    UVCDAT    uvcdat
cdtime                    2.6.1                    UVCDAT    uvcdat
cdutil                    2.6                      UVCDAT    uvcdat
clapack                   3.2.1                    UVCDAT    uvcdat
distarray                 2.6                      UVCDAT    uvcdat
dv3d                      2.6                      UVCDAT    uvcdat
esmf                      ESMF_6_3_0rp1_ESMP_01          UVCDAT    uvcdat
ffmpeg                    2.7.0                    UVCDAT    uvcdat
g2clib                    1.4.0b                   UVCDAT    uvcdat
genutil                   2.6                      UVCDAT    uvcdat
gfortran                  4.9.3                         1    uvcdat
hdf5                      1.8.16                   UVCDAT    uvcdat
jasper                    1.900.1                  UVCDAT    uvcdat
lapack                    3.4.2                    UVCDAT    uvcdat
libcdms                   2.6.1                    UVCDAT    uvcdat
libcf                     1.0.beta11               UVCDAT    uvcdat
libdrs_c                  1.0.1                    UVCDAT    uvcdat
libdrs_f                  1.0.1                    UVCDAT    uvcdat
libnetcdf                 4.3.3.1                  UVCDAT    uvcdat
ossuuid                   1.6.2                    UVCDAT    uvcdat
proj4                     4.9.2                    UVCDAT    uvcdat
regrid2                   2.6.1                    UVCDAT    uvcdat
udunits2                  2.2.17                   UVCDAT    uvcdat
unidata                   2.6                      UVCDAT    uvcdat
vcs                       2.6                      UVCDAT    uvcdat
vcsaddons                 2.6                      UVCDAT    uvcdat
vtk                       7.1.0.2.6         uvcdat_master    uvcdat
x264                      20151006.2245            UVCDAT    uvcdat
yasm                      1.2.0                    UVCDAT    uvcdat
wheel                     0.29.0                   py27_0  
xz                        5.2.2                         0  
zlib                      1.2.8                         3  
doutriaux1 commented 7 years ago

@chaosphere2112 for now get the recipe from UV-CDAT/conda-recipes and turn webvtk on.

danlipsa commented 7 years ago

@chaosphere2112 @doutriaux1 Sorry for the delay, I was off yesterday. vtkweb is aleady there. I am using the latest uvcdat repo with the latest vcs repo installed on top. Try launching the server like that:

PYTHONPATH=/home/danlipsa/anaconda2/envs/2.6-42-g24f85dc/lib/python2.7/site-packages/vtk /home/danlipsa/anaconda2/envs/2.6-42-g24f85dc/bin/vtkpython server/server.py -p 9000

Make sure you replace my conda dir with yours.

jbeezley commented 7 years ago

Setting the PYTHONPATH should be unnecessary if you are running with vtkpython rather than just python.

chaosphere2112 commented 7 years ago

Had not heard of vtkpython. I'll give that a shot.

chaosphere2112 commented 7 years ago

@jbeezley Nope, that doesn't work at all:

$ vtkpython
vtk version 7.1.0
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site

I'm going to give the manual pythonpath a try.

danlipsa commented 7 years ago

@chaosphere2112 @jbeezley Note, I am using vtkpython as well. Not sure why this needs the PYTHONPATH as well. It may be a conda thing.

jbeezley commented 7 years ago

That's probably a problem with the vtk build in conda then. vtkpython is intended to add all necessary paths (LD_LIBRARY_PATH and PYTHONPATH) automatically.

chaosphere2112 commented 7 years ago

So, the process as I believe I have interpreted:

  1. npm install
  2. npm run demo &
  3. PYTHONPATH=/path/to/my/env/blahblahblah/vtk python server/server.py -p 9000 (which appears to correctly set up python for vtkweb)

at which point I open http://localhost:8080/demo in my browser, and nothing happens; console says ReferenceError: $ is not defined with a link to line 98 of demo.js.

danlipsa commented 7 years ago

@jbeezley Do you know what this error is?

jbeezley commented 7 years ago

That sort of error would seem to indicate there was an error thrown while loading the main bundle. There was no error before that point? Was ../dist/vcs.js served by the dev server?

danlipsa commented 7 years ago

@chaosphere2112 I think you are missing the 'npm run build' step.

chaosphere2112 commented 7 years ago
$ npm run build

> vcs-js@0.1.0 build /Users/fries2/Projects/vcs-js
> webpack --progress --colors

Hash: e51d31b561d0a51489da  
Version: webpack 1.13.2
Time: 40ms

ERROR in Entry module not found: Error: Cannot resolve module 'babel' in /Users/fries2/Projects/vcs-js
chaosphere2112 commented 7 years ago
$ npm install -g babel
npm WARN deprecated babel@6.5.2: Babel's CLI commands have been moved from the babel package to the babel-cli package
/Users/fries2/anaconda/envs/vtkwebjs/bin/babel -> /Users/fries2/anaconda/envs/vtkwebjs/lib/node_modules/babel/cli.js
/Users/fries2/anaconda/envs/vtkwebjs/bin/babel-external-helpers -> /Users/fries2/anaconda/envs/vtkwebjs/lib/node_modules/babel/cli.js
/Users/fries2/anaconda/envs/vtkwebjs/bin/babel-node -> /Users/fries2/anaconda/envs/vtkwebjs/lib/node_modules/babel/cli.js
/Users/fries2/anaconda/envs/vtkwebjs/lib
└── babel@6.5.2 
jbeezley commented 7 years ago

You don't want a global install of babel, and npm run build should be unnecessary because we are using webpack-dev-server. In any case, babel should be installed through the usual npm install. My first guess is that you are using an older version of npm. I would try npm install -g npm@3, delete node_modules, and try again.

chaosphere2112 commented 7 years ago

The errors I mentioned:

ERROR in ./src/session.js

/Users/fries2/Projects/vcs-js/src/session.js
  33:37  error  Unexpected parentheses around single function argument having a body with no curly braces  arrow-parens
  38:15  error  Unexpected parentheses around single function argument having a body with no curly braces  arrow-parens
  40:40  error  Unexpected parentheses around single function argument having a body with no curly braces  arrow-parens
  87:15  error  Unexpected parentheses around single function argument having a body with no curly braces  arrow-parens

✖ 4 problems (4 errors, 0 warnings)

ERROR in ./src/file.js

/Users/fries2/Projects/vcs-js/src/file.js
  11:15  error  Unexpected parentheses around single function argument having a body with no curly braces  arrow-parens

✖ 1 problem (1 error, 0 warnings)

ERROR in ./src/vtkweb/index.js

/Users/fries2/Projects/vcs-js/src/vtkweb/index.js
  32:57  error  Unary operator '++' used  no-plusplus
  40:58  error  Unary operator '++' used  no-plusplus

✖ 2 problems (2 errors, 0 warnings)
danlipsa commented 7 years ago

@chaosphere2112 Searching for no-plusplus says to replace ++ with += which is fine. I think you have a newer version of eslint.

chaosphere2112 commented 7 years ago

@danlipsa I'm running v3.7.1, apparently.

danlipsa commented 7 years ago

@chaosphere2112 I have 3.3.1. This is downloaded by npm install I think, so it should be a way to fix the version.

jbeezley commented 7 years ago

@danlipsa, if you run npm update, it will update all of your local packages to the most recent version. What happened here is eslint was updated in kw-web-suite, which pulled in some minor rule changes. You can try pinning the version of kw-web-suite to prevent that from happening in the future.

danlipsa commented 7 years ago

Thanks @jbeezley. @chaosphere2112 Do you want me to update the PR and fix the errors with the new lint?

chaosphere2112 commented 7 years ago

@danlipsa Please; once you do, I'll merge and get started on my work.

danlipsa commented 7 years ago

@chaosphere2112 Done.

chaosphere2112 commented 7 years ago

:+1: Thanks!