Skip to content

Commit

Permalink
add ipywidgets to install_requires (#638)
Browse files Browse the repository at this point in the history
* add ipywidgets to install_requires

* test_movie_making.ipynb

* turn off conda build now

* using py3.6
  • Loading branch information
hainm committed Jul 18, 2017
1 parent a2cd107 commit 4d9045f
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ language: cpp
matrix:
include:
- { os: linux, env: PYTHON_VERSION=2.7 }
- { os: linux, env: PYTHON_VERSION=3.4 }
- { os: linux, env: PYTHON_VERSION=3.5 CONDA_BUILD=True}
- { os: linux, env: PYTHON_VERSION=3.5 TESTJS=True}
- { os: linux, env: PYTHON_VERSION=3.6 }
# - { os: linux, env: PYTHON_VERSION=3.6 CONDA_BUILD=True} # turn on if ipywidgets=7 is built
- { os: linux, env: PYTHON_VERSION=3.6 TESTJS=True}

sudo: true
dist: trusty
Expand Down
109 changes: 109 additions & 0 deletions nglview/tests/notebooks/api/test_movie_making.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "4a569424c063488b8d61fed66d2fb7b2",
"version_major": "2",
"version_minor": "0"
},
"text/plain": [
"A Jupyter Widget"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"[MoviePy] Building file ./test.gif with imageio\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 83%|████████▎ | 5/6 [00:00<00:00, 5.56it/s]\n"
]
}
],
"source": [
"import pytraj\n",
"import nglview as nv\n",
"\n",
"traj = pytraj.load(nv.datafiles.XTC, top=nv.datafiles.PDB)\n",
"view = nv.show_pytraj(traj[:5])\n",
"view"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<nglview.contrib.movie.MovieMaker at 0x109757190>"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"maker = view._get_movie_maker()\n",
"maker"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"maker.output = './test.gif'\n",
"maker.make() # non-blocking call"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"![](./test.gif)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.13"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ def enable_extentions():
# - permission denied?
print('Failed to enable extensions.')
print('Skip. Tips: Do it yourself')
print(' nglview install')
print(' nglview enable')

def js_prerelease(command, strict=False):
"""decorator for building minified js/css prior to another command"""
Expand Down Expand Up @@ -183,6 +185,9 @@ def run(self):
'tests_require': [
'pytest'
],
'install_requires': [
'ipywidgets>=7.0.b0',
],
'extras_require': {
"ipywidgets": ["ipywidgets"],
"simpletraj": ["simpletraj"],
Expand Down

0 comments on commit 4d9045f

Please sign in to comment.