Skip to main content

No project description provided

Project description

zincware PyPI version 'Threejs

ZnDraw

Install via pip install zndraw or pip install zndraw[webview] to open zndraw in a dedicated window.

CLI

You can use ZnDraw with the CLI zndraw atoms.xyz. For a full list of arguments use zndraw --help.

ZnDraw is designed to work with your Python scripts. To interface you can inherit from zndraw.examples.UpdateScene or follow this base class:

import abc
from pydantic import BaseModel

class UpdateScene(BaseModel, abc.ABC):
    @abc.abstractmethod
    def run(self, atom_ids: list[int], atoms: ase.Atoms, **kwargs) -> list[ase.Atoms]:
        pass

The run method expects as inputs

  • atom_ids: list[int], the ids of the currently selected atoms
  • atoms: ase.Atoms, the configuration as ase.Atoms file where atom_ids where selected.
  • kwargs: dict could be additional information from the scene

and as an output:

  • list[ase.Atoms], a list of ase Atoms objects to display.

You can define the parameters using pydantic.Field which will be displayed in the UI.

class MyUpdateCls(UpdateScene):
    steps: int = Field(100, le=1000, ge=1)
    x: float = Field(0.5, le=5, ge=0)
    symbol: str = Field("same")

To add your method click on the + on the right side of the window. Your should be able to add your method from the working directory via module.MyUpdateCls as long as it can be imported via from module import MyUpdateCls.

ZnDraw UI

ZnDraw UI2

ZnDraw UI3

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zndraw-0.1.8.tar.gz (7.1 MB view details)

Uploaded Source

Built Distribution

zndraw-0.1.8-py3-none-any.whl (7.6 MB view details)

Uploaded Python 3

File details

Details for the file zndraw-0.1.8.tar.gz.

File metadata

  • Download URL: zndraw-0.1.8.tar.gz
  • Upload date:
  • Size: 7.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.8 Linux/5.19.0-41-generic

File hashes

Hashes for zndraw-0.1.8.tar.gz
Algorithm Hash digest
SHA256 ad004d404245b476bbe77d275fd27fc331f812a7009b70197f1907c895d251c3
MD5 599d6db449d81e9c25e49894dcefe569
BLAKE2b-256 4581c38dd506e565fe675a93a516190d5632e9188a5e74c1e70e97a0690c7fce

See more details on using hashes here.

File details

Details for the file zndraw-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: zndraw-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 7.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.8 Linux/5.19.0-41-generic

File hashes

Hashes for zndraw-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 0d28fd06d737799a7ce75c02f30c78a0fac3a0e3889d6e67586de19bc9c020f6
MD5 ced22851c2cb3278ffa667f907503485
BLAKE2b-256 22a4f4d1e5efab7baeff2ea992596f356bfd29ebe8c994ceb4ea46ff1b5ed74f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page