ase_notebook.draw_elements module

Module defining backend agnostic containers for visualisation elements.

class ase_notebook.draw_elements.DrawElementsBase(name, coordinates, element_properties=None, group_properties=None)[source]

Bases: object

Abstract base class to store a set of 3D-visualisation elements.

_protected_keys = ('name', 'type', 'position', 'get')
property element_properties

Return per element properties.

etype = None
get_elements_property(name)[source]

Return a single property.

get_max_zposition()[source]

Return the maximum z-coordinate.

property group_properties

Return element group properties.

set_property(name, value, element=False)[source]

Set a group or per element property.

set_property_many(properties, element=False)[source]

Set multiple group or per element properties.

unstack_coordinates()[source]

Return a list of all coordinates in the group.

unstack_positions()[source]

Return a list of all coordinates in the group.

update_positions(axes, offset, **kwargs)[source]

Update element positions, give a axes basis and centre offset.

class ase_notebook.draw_elements.DrawElementsLine(name, coordinates, element_properties=None, group_properties=None)[source]

Bases: ase_notebook.draw_elements.DrawElementsBase

Store a set of 3D-visualisation line elements.

etype = 'line'
get_max_zposition()[source]

Return the maximum z-coordinate.

unstack_coordinates()[source]

Return a list of all coordinates in the group.

unstack_positions()[source]

Return a list of all coordinates in the group.

update_positions(axes, offset, **kwargs)[source]

Update element positions, give a axes basis and centre offset.

class ase_notebook.draw_elements.DrawElementsPoly(name, coordinates, element_properties=None, group_properties=None)[source]

Bases: ase_notebook.draw_elements.DrawElementsBase

Store a set of 3D-visualisation polygon elements.

etype = 'poly'
get_max_zposition()[source]

Return the maximum z-coordinate.

unstack_coordinates()[source]

Return a list of all coordinates in the group.

unstack_positions()[source]

Return a list of all coordinates in the group.

update_positions(axes, offset, **kwargs)[source]

Update element positions, give a axes basis and centre offset.

class ase_notebook.draw_elements.DrawElementsSphere(name, coordinates, radii, element_properties=None, group_properties=None, radii_scale=1.0)[source]

Bases: ase_notebook.draw_elements.DrawElementsBase

Store a set of 3D-visualisation sphere elements.

_protected_keys = ('name', 'type', 'position', 'sradius', 'get')
etype = 'sphere'
get_max_zposition()[source]

Return the maximum z-coordinate.

property scaled_radii

Return the scaled radii, for each sphere.

unstack_coordinates()[source]

Return a list of all coordinates in the group.

unstack_positions()[source]

Return a list of all coordinates in the group.

update_positions(axes, offset, radii_scale, **kwargs)[source]

Update element positions, give a axes basis and centre offset.

class ase_notebook.draw_elements.DrawGroup(elements: List[ase_notebook.draw_elements.DrawElementsBase])[source]

Bases: collections.abc.Mapping

Store and manipulate 3-D visualisation element groups.

_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 221
_abc_registry = <_weakrefset.WeakSet object>
get_all_coordinates()[source]

Return a list of all coordinates.

get_all_positions()[source]

Return a list of all coordinates.

get_position_range()[source]

Return the (minimum, maximum) coordinates.

update_positions(axes=None, offset=None, radii_scale=1)[source]

Update element positions, give a axes basis and centre offset.

yield_zorder()[source]

Yield elements, in order of the z-coordinate.

class ase_notebook.draw_elements.Element(**kwargs)[source]

Bases: object

Representation of a single element.

Implemented as a frozen dictionary with attribute access.

get(key, default)[source]

Return key or default.