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) -> 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.

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.

Alt text

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.3.tar.gz (31.7 kB view details)

Uploaded Source

Built Distribution

zndraw-0.1.3-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zndraw-0.1.3.tar.gz
  • Upload date:
  • Size: 31.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.8 Linux/5.19.0-40-generic

File hashes

Hashes for zndraw-0.1.3.tar.gz
Algorithm Hash digest
SHA256 16ba4e5431792ec06b92808e6cfe81255af2ba15d60b7318d8841f5a218444a2
MD5 ddb80546cef1059357d2369bf79913a7
BLAKE2b-256 54f856664c524b68b292e3a45b520593a18fab394bea7a5cf916aad8eb79b3d9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for zndraw-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 235665a67f561d0625aeeadc14fc65e4f88bcc1e0a8fdd6b0d55832daabbee59
MD5 b3166538d8f7759a9fb97fd174b21006
BLAKE2b-256 9e95d1d6af3abdc6e0e7c1520074fab82371fb37869b116fdd0be94f25f31a37

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