ase_notebook.viewer module¶
A module for creating visualisations of a structure.
-
class
ase_notebook.viewer.
AseView
(config: Union[None, ase_notebook.configuration.ViewConfig] = None, **kwargs)[source]¶ Bases:
object
Class for visualising
ase.Atoms
orpymatgen.Structure
.-
_add_element_properties
(atoms, element_groups, bond_thickness, lighten_by_depth=True)[source]¶ Add initial properties to the element groups.
-
_initialise_elements
(atoms, center_in_uc=False, repeat_uc=(1, 1, 1))[source]¶ Prepare visualisation elements, in a backend agnostic manner.
-
add_miller_plane
(h, k, l, *, color='blue', stroke_color=None, stroke_width=1, fill_opacity=0.5, stroke_opacity=0.9, reset=False)[source]¶ Add a miller plane to the config.
-
property
config
¶ Return the visualisation configuration.
-
get_input_as_dict
(atoms, **kwargs)[source]¶ Return the configuration, atoms and kwargs as a JSONable dictionary.
-
launch_gui_subprocess
(atoms, center_in_uc=False, repeat_uc=(1, 1, 1), test_init=2)[source]¶ Launch a GUI to view the atoms or structure, in a (non-blocking) subprocess.
We encode all the data into a json object, then parse this to a console executable via stdin.
- Parameters
test_init – wait for a x seconds, then test whether the process initialized without error.
-
make_gui
(atoms, center_in_uc=False, repeat_uc=(1, 1, 1), bring_to_top=True, launch=True)[source]¶ Launch a (blocking) GUI to view the atoms or structure.
-
make_render
(atoms, center_in_uc=False, repeat_uc=(1, 1, 1), reuse_objects=True, use_atom_arrays=False, use_label_arrays=True, create_gui=True)[source]¶ Create a pythreejs render of the atoms or structure.
-