display Package

display Module

mvtk Module

mayavi toolkit.

WARNING: This code is still under development.

abipy.display.mvtk.get_fig_mlab(figure=None, **kwargs)[source]
abipy.display.mvtk.plot_wigner_seitz(lattice, figure=None, **kwargs)[source]

Adds the skeleton of the Wigner-Seitz cell of the lattice to a mayavi figure

Parameters:
  • lattice – Reciprocal-space pymatgen.core.lattice.Lattice object

  • figure – mayavi figure, None to plot on the curretn figure

  • kwargs – kwargs passed to the mayavi function plot3d. Color defaults to black and line_width to 1.

Returns: mayavi figure

abipy.display.mvtk.plot_unit_cell(lattice, figure=None, **kwargs)[source]

Adds the unit cell of the lattice to a mayavi figure.

Parameters:
  • lattice – Lattice object

  • figure – mayavi figure, None to plot on the curretn figure

  • kwargs – kwargs passed to the mayavi function plot3d. Color defaults to black and line_width to 1.

Returns: mayavi figure

abipy.display.mvtk.plot_lattice_vectors(lattice, figure=None, **kwargs)[source]

Adds the basis vectors of the lattice provided to a mayavi figure.

Parameters:
  • latticepymatgen.core.lattice.Lattice object.

  • figure – mayavi figure, None if a new figure should be created.

  • kwargs – kwargs passed to the mayavi function plot3d. Color defaults to black and line_width to 1.

Returns: mayavi figure

abipy.display.mvtk.plot_structure(structure, frac_coords=False, to_unit_cell=False, style='points+labels', unit_cell_color=(0, 0, 0), color_scheme='VESTA', figure=None, show=False, **kwargs)[source]

Plot structure with mayavi.

Parameters:
  • structureabipy.core.structure.Structure object

  • frac_coords

  • to_unit_cell – True if sites should be wrapped into the first unit cell.

  • style – “points+labels” to show atoms sites with labels.

  • unit_cell_color

  • color_scheme – color scheme for atom types. Allowed values in (“Jmol”, “VESTA”)

  • figure

  • kwargs

Returns: mayavi figure

abipy.display.mvtk.plot_labels(labels, lattice=None, coords_are_cartesian=False, figure=None, **kwargs)[source]

Adds labels to a mayavi figure.

Parameters:
  • labels – dict containing the label as a key and the coordinates as value.

  • latticepymatgen.core.lattice.Lattice object used to convert from reciprocal to cartesian coordinates

  • coords_are_cartesian – Set to True if you are providing. coordinates in cartesian coordinates. Defaults to False. Requires lattice if False.

  • figure – mayavi figure, None to plot on the curretn figure

  • kwargs – kwargs passed to the mayavi function text3d. Color defaults to blue and size to 25.

Returns: mayavi figure

class abipy.display.mvtk.MayaviFieldAnimator(filepaths)[source]

Bases: object

volume_animate()[source]

utils Module

Tools to build ipython widgets.

abipy.display.utils.widget2py(*args)[source]
abipy.display.utils.str2bool_or_none(*args)[source]
abipy.display.utils.markers_dropdown(default='o')[source]
abipy.display.utils.colors_dropdow(default='None')[source]
abipy.display.utils.linewidth_slider(default=1, orientation='horizontal')[source]
abipy.display.utils.size_slider(default=5, orientation='horizontal')[source]
abipy.display.utils.saturation_slider(default=0.75, orientation='horizontal')[source]
abipy.display.utils.colormap_widget(default=None)[source]