Band Structure Configuration API#

class pyprocar.cfg.band_structure.BandStructureConfig(plot_type: ~pyprocar.cfg.base.PlotType, custom_settings: ~typing.Dict[str, ~typing.Any] = <factory>, modes: ~typing.List[str] = <factory>, color: str = 'black', spin_colors: ~typing.Tuple[str] = <factory>, colorbar_title: str = 'Atomic Orbital Projections', colorbar_title_size: int = 15, colorbar_title_padding: int = 20, colorbar_tick_labelsize: int = 10, cmap: str = 'jet', clim: ~typing.Tuple[float, float] | None = (0.0, 1.0), fermi_color: str = 'blue', fermi_linestyle: str = 'dotted', fermi_linewidth: float = 1, grid: bool = False, grid_axis: str = 'both', grid_color: str = 'grey', grid_linestyle: str = 'solid', grid_linewidth: float = 1, grid_which: str = 'major', label: ~typing.Tuple[str] = <factory>, legend: bool = True, linestyle: ~typing.Tuple[str] = <factory>, linewidth: ~typing.Tuple[float] = <factory>, marker: ~typing.Tuple[str] = <factory>, markersize: ~typing.Tuple[float] = <factory>, opacity: ~typing.Tuple[float] = <factory>, plot_color_bar: bool = True, savefig: str | None = None, title: str | None = None, weighted_color: bool = True, weighted_width: bool = False, figure_size: ~typing.Tuple[int] = <factory>, dpi: str = 'figure')[source]#

Bases: BaseConfig

Configuration class for plotting band structures with custom options.

Parameters:
  • color (str, optional (default ‘black’)) – Color for the plot lines.

  • spin_colors (Tuple[str], optional) – Colors for the spin texture lines.

  • colorbar_title (str, optional) – Title of the colorbar.

  • colorbar_title_size (int, optional) – Font size of the title of the colorbar.

  • colorbar_title_padding (int, optional) – Padding of the title of the colorbar.

  • colorbar_tick_labelsize (int, optional) – Size of the tick labels on the colorbar.

Plot Appearance:
  • cmap (str, optional (default ‘jet’)) – The colormap used for the plot.

  • clim (Tuple[float, float], optional) – The color scale limits for the color bar.

  • fermi_color (str, optional) – Color of the Fermi line.

  • fermi_linestyle (str, optional) – The linestyle of the Fermi line.

  • fermi_linewidth (float, optional) – The linewidth of the Fermi line.

  • grid (bool, optional) – If true, a grid will be shown on the plot.

  • grid_axis (str, optional) – Which axis (or both) the grid lines should be drawn on.

  • grid_color (str, optional) – The color of the grid lines.

  • grid_linestyle (str, optional) – The linestyle of the grid lines.

  • grid_linewidth (float, optional) – The linewidth of the grid lines.

  • grid_which (str, optional) – Which grid lines to draw (major, minor, or both).

  • label (Tuple[str], optional) – The labels for the plot lines.

  • legend (bool, optional) – If true, a legend will be shown on the plot.

  • linestyle (Tuple[str], optional) – The linestyles for the plot lines.

  • linewidth (Tuple[float], optional) – The linewidths for the plot lines.

  • marker (Tuple[str], optional) – The marker styles for the plot points.

  • markersize (Tuple[float], optional) – The size of the markers for the plot points.

  • opacity (Tuple[float], optional) – The opacities for the plot lines.

  • plot_color_bar (bool, optional) – If true, a color bar will be shown on the plot.

  • savefig (str, optional) – The file name to save the figure. If null, the figure will not be saved.

  • title (str, optional) – The title for the plot. If null, no title will be displayed.

  • weighted_color (bool, optional) – If true, the color of the lines will be weighted.

  • weighted_width (bool, optional) – If true, the width of the lines will be weighted.

  • figure_size (Tuple[int], optional) – The size of the figure (width, height) in inches.

  • dpi (str, optional) – The resolution in dots per inch. If ‘figure’, use the figure’s dpi value.

Methods

__post_init__():

Post-initialization to set additional properties like plot_type.

Examples

To initialize a basic configuration with the default settings:

>>> config = BandStructureConfig()

To customize the plot with a specific colormap and line styles:

>>> custom_config = BandStructureConfig(cmap='magma', linestyle=('dotted', 'dashed'))
as_dict()[source]#

Returns a dictionary of the configuration settings.

clim: Tuple[float, float] | None = (0.0, 1.0)#
cmap: str = 'jet'#
color: str = 'black'#
colorbar_tick_labelsize: int = 10#
colorbar_title: str = 'Atomic Orbital Projections'#
colorbar_title_padding: int = 20#
colorbar_title_size: int = 15#
dpi: str = 'figure'#
fermi_color: str = 'blue'#
fermi_linestyle: str = 'dotted'#
fermi_linewidth: float = 1#
figure_size: Tuple[int]#
grid: bool = False#
grid_axis: str = 'both'#
grid_color: str = 'grey'#
grid_linestyle: str = 'solid'#
grid_linewidth: float = 1#
grid_which: str = 'major'#
label: Tuple[str]#
legend: bool = True#
linestyle: Tuple[str]#
linewidth: Tuple[float]#
marker: Tuple[str]#
markersize: Tuple[float]#
modes: List[str]#
opacity: Tuple[float]#
plot_color_bar: bool = True#
savefig: str | None = None#
spin_colors: Tuple[str]#
title: str | None = None#
weighted_color: bool = True#
weighted_width: bool = False#
class pyprocar.cfg.band_structure.BandStructureMode(value)[source]#

Bases: Enum

An enumeration for defining the modes of Band Structure representations.

Variables:
  • PLAIN (str) – Represents the band structure in a simple, where the colors are the different bands.

  • PARAMETRIC (str) – Represents the band structure in a parametric form, summing over the projections.

  • SACATTER (str) – Represents the band structure in a scatter plot, where the colors are the different bands.

  • ATOMIC (str) – Represents the band structure in an atomic level plot, plots singlr kpoint bands.

  • OVERLAY (str) – Represents the band structure in an overlay plot, where the colors are the selected projections

  • OVERLAY_SPECIES (str) – Represents the band structure in an overlay plot, where the colors are the different projection of the species.

  • OVERLAY_ORBITALS (str) – Represents the band structure in an overlay plot, where the colors are the different projection of the orbitals.

ATOMIC = 'atomic'#
OVERLAY = 'overlay'#
OVERLAY_ORBITALS = 'overlay_orbitals'#
OVERLAY_SPECIES = 'overlay_species'#
PARAMETRIC = 'parametric'#
PLAIN = 'plain'#
SACATTER = 'scatter'#
class pyprocar.cfg.band_structure.BandStructureProperty(value)[source]#

Bases: Enum

An enumeration for defining the properties that can be visualized on the BandStructure.