Skip to main content

Visualizer plugin to use ase with weas-widget

Project description

ase-weas-widget

PyPI - Version PyPI - Python Version


Table of Contents

Installation

pip install ase-weas-widget

This should install weas-widget as the dependency if it is not installed. Please refer to the weas-widget repository for examples in order to verifying its correct installation.

Usage

This plugin allows viewing ase.Atoms object using ase.visualize.view via the weas-widget in a notebook environment:

from ase.build import bulk
from ase.visualize import view
atoms = bulk('Si', 'diamond', 5.4)
view(atoms.repeat((2,2,2)), viewer='weas')

Output example:

example output

The appearance of the resulting plot can be customized with a callback function that modifies the underlying WeasWidget object:

def apply_vesta(viewer):
    """Callback to customize the WeasWidget object"""
    viewer.avr.model_style = 1
    viewer.avr.show_bonded_atoms = True
    viewer.avr.color_type = "VESTA"
    
atoms = bulk('Si', 'diamond', 5.4)
view(atoms.repeat((2,2,2)), viewer='weas', mods=apply_vesta)

Output example:

example output

or equivalently using a pre-defined modifier function (callback) (see here for available options):

atoms = bulk('Si', 'diamond', 5.4)
view(atoms.repeat((2,2,2)), viewer='weas', presets='vesta,ball')

Please refer to the documentation of weas-widget for details about how to control and modify the output.

How it works

This plugin simply interfaces the WeasWidget object with the ase.visualize module. The view function returns the WeasWidget which is constructed from the ase.Atoms object as the output. The latter is then displayed by Jupyter.

License

ase-weas-widget is distributed under the terms of the MIT license.

Project details


Download files

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

Source Distribution

ase_weas_widget-0.2.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ase_weas_widget-0.2.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file ase_weas_widget-0.2.0.tar.gz.

File metadata

  • Download URL: ase_weas_widget-0.2.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for ase_weas_widget-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2491f8a73a0e9c087158eae7138e1175726f98d2806b87005deb5f61afe00736
MD5 a8284e894c1f1ef332b9ec9b34beeaac
BLAKE2b-256 4dfa7d65e3f318256acfd205e1391712695175ba35262d6f9540a9a22d49f9d5

See more details on using hashes here.

File details

Details for the file ase_weas_widget-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ase_weas_widget-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8cdbc84bb8e1883a22a1f874b0eea2b30413c7a4f8fefb43e1f19b401e1eba6e
MD5 2e69c84b587d4c6807af5f0994d7ffa3
BLAKE2b-256 1092ce4727758da92aca5583067b564261bc5e9acf7f2e2622aa16b8ca213627

See more details on using hashes here.

Supported by

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