!pip install git+https://github.com/njzjz/dpdata@3dmol py3Dmol
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/ Collecting git+https://github.com/njzjz/dpdata@3dmol Cloning https://github.com/njzjz/dpdata (to revision 3dmol) to /tmp/pip-req-build-1p51k99t Running command git clone -q https://github.com/njzjz/dpdata /tmp/pip-req-build-1p51k99t Running command git checkout -b 3dmol --track origin/3dmol Switched to a new branch '3dmol' Branch '3dmol' set up to track remote branch '3dmol' from 'origin'. Requirement already satisfied: py3Dmol in /usr/local/lib/python3.7/dist-packages (1.8.1) Requirement already satisfied: numpy>=1.14.3 in /usr/local/lib/python3.7/dist-packages (from dpdata==0.0.6.dev499+g10b73fe) (1.21.6) Requirement already satisfied: monty in /usr/local/lib/python3.7/dist-packages (from dpdata==0.0.6.dev499+g10b73fe) (2022.9.9) Requirement already satisfied: scipy in /usr/local/lib/python3.7/dist-packages (from dpdata==0.0.6.dev499+g10b73fe) (1.7.3) Requirement already satisfied: h5py in /usr/local/lib/python3.7/dist-packages (from dpdata==0.0.6.dev499+g10b73fe) (3.1.0) Requirement already satisfied: wcmatch in /usr/local/lib/python3.7/dist-packages (from dpdata==0.0.6.dev499+g10b73fe) (8.4.1) Requirement already satisfied: importlib_metadata>=1.4 in /usr/local/lib/python3.7/dist-packages (from dpdata==0.0.6.dev499+g10b73fe) (4.12.0) Requirement already satisfied: typing-extensions>=3.6.4 in /usr/local/lib/python3.7/dist-packages (from importlib_metadata>=1.4->dpdata==0.0.6.dev499+g10b73fe) (4.1.1) Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib_metadata>=1.4->dpdata==0.0.6.dev499+g10b73fe) (3.8.1) Requirement already satisfied: cached-property in /usr/local/lib/python3.7/dist-packages (from h5py->dpdata==0.0.6.dev499+g10b73fe) (1.5.2) Requirement already satisfied: bracex>=2.1.1 in /usr/local/lib/python3.7/dist-packages (from wcmatch->dpdata==0.0.6.dev499+g10b73fe) (2.3.post1) Building wheels for collected packages: dpdata Building wheel for dpdata (setup.py) ... done Created wheel for dpdata: filename=dpdata-0.0.6.dev499+g10b73fe-py3-none-any.whl size=118455 sha256=d62198ed7caa9988786683407d89cbb59d54c3e19bdfd7ccd02a850a6ea81c77 Stored in directory: /tmp/pip-ephem-wheel-cache-a1h1ibof/wheels/94/51/10/0343467fff90c6f1169d8fc24e570eff5a2a74b1e955920932 Successfully built dpdata Installing collected packages: dpdata Attempting uninstall: dpdata Found existing installation: dpdata 0.0.6.dev497+gb5b6e55 Uninstalling dpdata-0.0.6.dev497+gb5b6e55: Successfully uninstalled dpdata-0.0.6.dev497+gb5b6e55 Successfully installed dpdata-0.0.6.dev499+g10b73fe
import dpdata
import numpy as np
dpdata.System(data={
"atom_names": ["N"],
"atom_numbs": [2],
"atom_types": np.zeros((2,), dtype=int),
"coords": np.array([[[0,0,0],[1,1,1]]], dtype=np.float32),
"cells": np.zeros((1, 3, 3), dtype=np.float32),
"orig": np.zeros(3, dtype=np.float32),
"nopbc": True,
}).to_3dmol()
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
<py3Dmol.view at 0x7f038c3bb410>