Difference between revisions of "Support/Jupyter"

From Jmol
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
JSmol may be implemented in a Jupyter Notebook through [https://towardsdatascience.com/jupyter-notebook-extensions-517fa69d2231 Jupyter Notebook Extensions], which blend javascript with the notebook environment.  One extension is [https://github.com/fekad/jupyter-jsmol jupyter-jsmol] by Adam Fekete.  Jupyter-jsmol provides a python wrapper to the JSmol widget.
 
JSmol may be implemented in a Jupyter Notebook through [https://towardsdatascience.com/jupyter-notebook-extensions-517fa69d2231 Jupyter Notebook Extensions], which blend javascript with the notebook environment.  One extension is [https://github.com/fekad/jupyter-jsmol jupyter-jsmol] by Adam Fekete.  Jupyter-jsmol provides a python wrapper to the JSmol widget.
 +
 +
== Installation ==
  
 
Jupyter-jsmol can be installed with pip in your notebook virtual environment.  (Note the use of the underscore in the pip package)
 
Jupyter-jsmol can be installed with pip in your notebook virtual environment.  (Note the use of the underscore in the pip package)
Line 10: Line 12:
  
 
Old versions of Jupyter Notebooks require you to enable the extension:
 
Old versions of Jupyter Notebooks require you to enable the extension:
 +
 
<code>jupyter nbextension enable --py [--sys-prefix|--user|--system] jupyter_jsmol</code>
 
<code>jupyter nbextension enable --py [--sys-prefix|--user|--system] jupyter_jsmol</code>
  
 
If you use JupyterLab you'll have to install the extension:
 
If you use JupyterLab you'll have to install the extension:
 +
 
<code>jupyter labextension install @jupyter-widgets/jupyterlab-manager</code>
 
<code>jupyter labextension install @jupyter-widgets/jupyterlab-manager</code>
  
 +
== Examples ==
  
 +
There are several examples on the [https://github.com/fekad/jupyter-jsmol/tree/master/examples jupyter-jsmol github]
  
 +
Wayne Decatur has setup a [https://mybinder.org/v2/gist/fomightez/c6c0954414a8e576c5c2611c64163790/HEAD?filepath=1%20-%20Basic%20usage.ipynb Binder container] to demonstrate usage
  
 
+
[https://chemcompute.org ChemCompute] has jupyter-jsmol preinstalled in its Jupyter notebooks.  ChemCompute is a free website for students to run Computational Chemistry jobs.  Through ChemCompute's Jupyter Notebook you can run a calculation with [https://psicode.org/ Psi4] and view the output in JSmol.
 
+
# Go to [https://chemcompute.org ChemCompute] and login or register at the top right.  You can likely login with your institutional login.
 
+
# Access an [https://chemcompute.org/jupyterhub_internal/user-redirect/notebooks/experiments/05%20-%20H2%20MOs%20STO-3G.ipynb example Jupyter Notebook]
 
 
 
 
 
 
 
 
.
 

Latest revision as of 17:17, 11 September 2021

Running JSmol in Jupyter notebooks

The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text.

JSmol may be implemented in a Jupyter Notebook through Jupyter Notebook Extensions, which blend javascript with the notebook environment. One extension is jupyter-jsmol by Adam Fekete. Jupyter-jsmol provides a python wrapper to the JSmol widget.

Installation

Jupyter-jsmol can be installed with pip in your notebook virtual environment. (Note the use of the underscore in the pip package)

pip install jupyter_jsmol

Old versions of Jupyter Notebooks require you to enable the extension:

jupyter nbextension enable --py [--sys-prefix|--user|--system] jupyter_jsmol

If you use JupyterLab you'll have to install the extension:

jupyter labextension install @jupyter-widgets/jupyterlab-manager

Examples

There are several examples on the jupyter-jsmol github

Wayne Decatur has setup a Binder container to demonstrate usage

ChemCompute has jupyter-jsmol preinstalled in its Jupyter notebooks. ChemCompute is a free website for students to run Computational Chemistry jobs. Through ChemCompute's Jupyter Notebook you can run a calculation with Psi4 and view the output in JSmol.

  1. Go to ChemCompute and login or register at the top right. You can likely login with your institutional login.
  2. Access an example Jupyter Notebook

Contributors

Perrim, AngelHerraez