zincware / ZnDraw

Display and Edit Molecules

Home Page:https://zndraw.icp.uni-stuttgart.de

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zincware PyPI version DOI codecov 'Threejs

ZnDraw

Install via pip install zndraw. If you have pip install pywebview installed, ZnDraw will open in a dedicated window.

CLI

You can use ZnDraw to view a file using the CLI zndraw traj.xyz. Supported file formats include everything that ase.io can read and additionally h5 files in the H5MD standard.

If you want to view the frames while they are added to the scene you can use zndraw -mp traj.xyz. See zndraw --help for more CLI options.

Python

ZnDraw provides a Python interface. The zndraw.ZnDraw object offers append, extend as well as assignment operations. More information is available in the example notebook.

from zndraw import ZnDraw
import ase

vis = ZnDraw()

vis.socket.sleep(2) # give it some time to fully connect
vis[0] = ase.Atoms(
  "H2O", positions=[[0.75, -0.75, 0], [0.75, 0.75, 0], [0, 0, 0]]
  )

ZnDraw also provides an interface to the Python logging library, including support for formatters and different logging levels.

import logging

log = logging.getLogger(__name__)
log.addHandler(vis.get_logging_handler())
log.critical("Critical Message")

User Interface

ZnDraw UI

ZnDraw UI3

Development

ZnDraw is developed using https://python-poetry.org/. Furthermore, the javascript packages have to be installed using https://www.npmjs.com/.

cd zndraw/static/
npm install

About

Display and Edit Molecules

https://zndraw.icp.uni-stuttgart.de

License:Apache License 2.0


Languages

Language:Python 50.1%Language:JavaScript 38.5%Language:Jinja 8.0%Language:CSS 3.1%Language:Dockerfile 0.2%