panels Package

panels Package

a2f Module

Panels to interact with A2F files.

class abipy.panels.a2f.A2fFilePanel(ncfile, **params)[source]

Bases: PanelWithElectronBands

Panel with widgets to interact with a abipy.electrons.gsr.GsrFile.

get_a2f_view() Row[source]

Return Row with widgets to visualize the structure.

on_view_a2f()[source]

Visualize a2f function.

get_panel(as_dict=False, **kwargs)[source]

Return tabs with widgets to interact with the A2F file.

name = 'A2fFilePanel'

core Module

“Basic tools and mixin classes for AbiPy panels.

abipy.panels.core.set_abinit_template(template_name: str)[source]
abipy.panels.core.get_abinit_template_cls_kwds() tuple[source]
abipy.panels.core.open_html(html_string: str, browser: str = None) None[source]

Open a string with an HTML document in browser.

abipy.panels.core.abipanel(panel_template: str = 'FastList')[source]

Activate panel extensions used by AbiPy. Return panel module.

Parameters:

panel_template – String with the name of the panel template to be used by default.

abipy.panels.core.gen_id(n: int = 1, pre: str = 'uuid-')[source]

Generate n universally unique identifiers prepended with pre string. Return string if n == 1 or list of strings if n > 1

abipy.panels.core.get_template_cls_from_name(name: str)[source]

Return panel template from string. Support name in the form FastList as well as FastListTemplate.

abipy.panels.core.depends_on_btn_click(btn_name: str, show_doc: bool = True, show_shared_wdg_warning: bool = True, show_exc: bool = True)[source]

This decorator is used for callbacks triggered by a button of name btn_name

Parameters:
  • btn_name – String with the name of the button.

  • show_doc – If True, a Markdown pane with the doc string is returned the first time.

  • show_shared_warning

  • show_exc – If True, a Markdown pane with the backtrace is returned if an exception is raised.

abipy.panels.core.show_exception(func)[source]

This decorator returns a Markdown pane with the backtrace if the function raises an exception.

class abipy.panels.core.HTMLwithClipboardBtn(object=None, btn_cls=None, **params)[source]

Bases: HTML

Receives an HTML string and returns an HTML pane with a button that allows users to copy the content to the system clipboard. Requires call to abipanel to load the JS extension.

name = 'HTMLwithClipboardBtn'
abipy.panels.core.mpl(fig, sizing_mode='stretch_width', with_controls=False, with_divider=True, **kwargs) Column[source]

Helper function returning a panel Column with a matplotly pane followed by a divider and (optionally) controls to customize the figure.

abipy.panels.core.ply(fig, sizing_mode='stretch_both', with_chart_studio=False, with_help=False, with_divider=True, with_controls=False) Column[source]

Helper function returning a panel Column with a plotly pane, buttons to push the figure to plotly chart studio and, optionally, controls to customize the figure.

abipy.panels.core.dfc(df: DataFrame, wdg_type: str = 'tabulator', with_export_btn=True, with_controls=False, with_divider=True, transpose=False, **kwargs)[source]

Helper function returning a panel Column with a DataFrame or Tabulator widget followed by a divider and (optionally) controls to customize the figure.

Note that not all the options work as exected. See comments below.

abipy.panels.core.my_md(string: str, **kwargs) Markdown[source]

Return a Markdown pane from string. Extra kwargs are passed to pane.Markdown. The string can contain links to Abinit variables in the wikilink format.

class abipy.panels.core.ButtonContext(btn: Button)[source]

Bases: object

A context manager for buttons triggering computations on the server.

This manager disables the button when we __enter__ and changes the name of the button to “running”. It reverts to the initial state of the button once __exit__ is invoked, showing the Exception type in a “red” button if an exception is raised during the computation.

This a very important tool because we need to disable the button when we start the computation to prevent the user from triggering multiple callbacks while the server is still working. At the same time, whathever happens in the callback, the button should go back to “clickable” mode when the callback returns so that the user can try to change the parameters and rerun.

Note also that we want to provide some graphical feedback to the user if something goes wrong. At present we don’t expose the python traceback on the client. It would be nice but we need panel machinery to do that. Moreover this is not the recommended approach for security reasons so we just change the “color” of the button and use the string representation of the exception as button name.

class abipy.panels.core.Loading(panel_obj, err_wdg=None, width=70)[source]

Bases: object

A context manager for setting the loading attribute of a panel object.

class abipy.panels.core.ActiveBar(progress, err_wdg=None, width=70)[source]

Bases: object

A context manager that sets progress.active to True on entry and False when we exit.

class abipy.panels.core.AbipyParameterized(*, has_remote_server, mpi_procs, plotly_template, verbose, name)[source]

Bases: Parameterized

Base class for AbiPy panels. Provides helper functions for typical operations needed for building dashboard and basic parameters supported by the subclasses.

verbose = 0
mpi_procs = 1
plotly_template = 'plotly'
has_remote_server = False
warning = Markdown(str, name='warning')
disable_show_messages(show_doc=False, show_shared_wdg_warning=False)[source]

Context manager to disable the output of the docstring and the warning message.

with self.disable_show_messages():

pn.Row(“## Callback with no info message”, self.on_plot_phbands_and_phdos)

on_plotly_template()[source]

Change the default plotly template. NB: It’s not a good idea to expose this option when running the server as other users will be affected by this change hence this function is just for internal use.

mpl_kwargs()[source]

Default arguments passed to AbiPy matplotlib plot methods.

pws_col(keys, **kwargs) Column[source]
pws_row(keys, **kwargs) Row[source]
wdg_box(keys, **kwargs) WidgetBox[source]
pws(keys)[source]

Helper function returning the list of parameters and widgets defined in self from a list of strings. Accepts also widget or parameter instances.

get_summary_view_for_abiobj(abiobj, **kwargs)[source]
wdg_exts_with_get_panel(name='File extensions supported:')[source]

Return Select widget with the list of file extensions implementing a get_panel method.

static html_with_clipboard_btn(html_str: str, **kwargs)[source]
static get_software_stack() Column[source]

Return column with version of python packages in tabular format.

static get_fileinput_section(file_input) Column[source]
static get_abifile_from_file_input(file_input, use_structure=False)[source]
get_ebands_from_file_input(file_input, remove=True)[source]

Read and return an abipy.electrons.ebands.ElectronBands object from a file_input widget. Return None if the file does not provide an ebands object. Remove the file if remove == True.

static get_alert_data_transfer() Alert[source]
static get_template_cls_from_name(template)[source]
get_abinit_template_cls_kwds()[source]
get_template_from_tabs(tabs, template, **tabs_kwargs)[source]

This method receives panel Tabs or a dictionary, include them in a template and return the template instance.

name = 'AbipyParameterized'
abipy.panels.core.return_to_top_html()[source]
class abipy.panels.core.PanelWithStructure(structure: Structure, **params)[source]

Bases: AbipyParameterized

A paremeterized object with a abipy.core.structure.Structure object.

structure_viewer = 'jsmol'
on_view_structure()[source]

Visualize input structure.

get_structure_view() Row[source]

Return Row with widgets to visualize the structure.

get_structure_info() Column[source]

Return Column with lattice parameters, angles and atomic positions grouped by type.

name = 'PanelWithStructure'
abipy.panels.core.get_structure_info(structure: Structure) Column[source]

Return Column with lattice parameters, angles and atomic positions grouped by type.

class abipy.panels.core.NcFileViewer(ncfile, **params)[source]

Bases: AbipyParameterized

This class implements toool to inspect dimensions and variables stored in a netcdf file.

Relyes on the API provided by AbinitNcFile defined in core.mixins.py

nc_path = '/'
get_ncfile_view() Column[source]
on_netcdf_info_btn() Column[source]

This Tab allows one to

name = 'NcFileViewer'
class abipy.panels.core.PanelWithElectronBands(ebands, **params)[source]

Bases: PanelWithStructure

Provide widgets and views for operating on abipy.electrons.ebands.ElectronBands object.

with_gaps = False
with_kpoints_plot = False
set_fermie_to_vbm = False
edos_method = 'gaussian'
edos_step_ev = 0.1
edos_width_ev = 0.2
skw_lpratio = 5
skw_line_density = 20
skw_ebands_kpath = None
skw_ebands_kpath_fileinput = None
fs_viewer = 'matplotlib'
ifermi_wigner_seitz = True
ifermi_interpolation_factor = 8
ifermi_eref = 'fermie'
ifermi_with_velocities = True
ifermi_offset_eV = 0.0
ifermi_plot_type = 'plotly'
ebands_kpath = None
ebands_kpath_fileinput = None
ebands_kmesh = None
ebands_kmesh_fileinput = None
effmass_accuracy = 4
effmass_degtol_ev = 0.001
effmass_spin = 0
get_ebands_kpath()[source]

Receives the netcdf file selected by the user as binary string.

get_ebands_kmesh()[source]

Receives the netcdf file selected by the user as binary string.

get_skw_ebands_kpath()[source]

Receives the netcdf file selected by the user as binary string.

get_plot_ebands_view() Row[source]
on_plot_ebands_btn() Column[source]

This Tab allows one to plot the KS energies stored in the netcdf file as well as the associated list of k-points in the Brillouin.

get_plot_edos_view() Row[source]
on_plot_edos_btn() Row[source]

Button triggering edos plot.

get_skw_view() Row[source]

Column with widgets to use SKW.

on_plot_skw_btn() Column[source]

Button triggering SKW plot.

get_effmass_view() Row[source]

Return Row with widgets to compute effective masses with finite diff.

on_plot_effmass_btn() Column[source]

Compute and visualize effective masses with finite differences.

Note that the quality of the results strongly depend on the step i.e. the separation between two consecutive points along the k-path. The accuracy option allows one to change the number of points for the finite difference.

get_ifermi_view()[source]

Widgets to visualize the Fermi surface with ifermi package.

on_plot_ifermi_btn()[source]

This Tab allows you to interpolate KS energies defined in the IBZ and visualize isosurfaces in the BZ using the [ifermi](https://fermisurfaces.github.io/IFermi/) package.

The energy of the isosurface is given by: energy_reference + energy_offset.

  • use fermie with zero offset to visualize the Fermi surface in metals.

  • for electron pockets in semiconductors, use cbm with a positive offset e.g. 0.1 eV.

  • for hole pockets in semiconductors, use vbm and a negative offset e.g. -0.1 eV.

name = 'PanelWithElectronBands'
class abipy.panels.core.BaseRobotPanel(robot, **params)[source]

Bases: AbipyParameterized

Base class for panels with AbiPy robot.

on_compare_params_btn()[source]

Compare lattice parameters and atomic positions.

get_compare_params_widgets()[source]
name = 'BaseRobotPanel'
class abipy.panels.core.PanelWithEbandsRobot(robot, **params)[source]

Bases: BaseRobotPanel

Mixin class for panels with a robot that owns a list of of abipy.electrons.ebands.ElectronBands.

get_ebands_plotter_widgets() Column[source]
on_ebands_plotter_btn() Row[source]

Plot the electronic density of states.

get_edos_plotter_widgets() Column[source]
on_edos_plotter_btn() Row[source]

Plot the electronic density of states.

name = 'PanelWithEbandsRobot'
abipy.panels.core.jsmol_html(structure, supercell=(1, 1, 1), width=700, height=700, color='black', spin='false') Column[source]

ddb Module

Panel objects to operate on DDB files.

class abipy.panels.ddb.PanelWithAnaddbParams(*, asr, chneut, dipdip, dipquad, dos_method, eps0_gamma_ev, ifc_yscale, lo_to_splitting, ndivsm, nqsmall, quadquad, units, name)[source]

Bases: Parameterized

Base class providing widgets to invoke Anaddb via AbiPy. Used, for instance, by DdbFilePanel and DdbRobotPanel so that we don’t have to repeat the same parameters over and over again.

nqsmall = 10
ndivsm = 5
lo_to_splitting = 'automatic'
chneut = 1
dipdip = 1
dipquad = 1
quadquad = 1
asr = 2
units = 'eV'
dos_method = 'tetra'
eps0_gamma_ev = 0.0001
ifc_yscale = 'log'
kwargs_for_anaget_phbst_and_phdos_files(**extra_kwargs) dict[source]

Return the parameters required to invoke anaget_phbst_and_phdos_files Additional kwargs can be specified in extra_kwargs if needed.

name = 'PanelWithAnaddbParams'
class abipy.panels.ddb.DdbFilePanel(ddb: DdbFile, **params)[source]

Bases: PanelWithStructure, PanelWithAnaddbParams

A panel to analyze a abipy.dfpt.ddb.DdbFile. Provides widgets to invoke anaddb and visualize the results.

vsound_num_points = 20
vsound_qpt_norm = 0.1
get_becs_view() Row[source]
get_epsinf() Column[source]

Compute eps_infinity and Born effective charges from DDB.

get_eps0_view() Row[source]
plot_eps0w() Column[source]

Compute eps0(omega) from DDB and plot the results.

get_phbands_view() Row[source]
on_plot_phbands_and_phdos() Column[source]

This Tab provides widgets to compute:

  • Phonon dispersion along a high-symmetry q-path

  • Total phonon DOS and atom-projected phonon DOSes

  • Thermodynamic properties in the Harmonic approximation

Important

Note that anaddb uses the q-mesh found in the DDB file to build the interatomic force constants (IFCs) in real space and then compute phonon quantities at arbitrary q-points by Fourier interpolation.

The variables [[dipdip@anaddb]], [[dipquad@anaddb]] and [[quadquad@anaddb]] define the treatment of the long-range part (LR) of the IFCs in the Fourier interpolation of the dynamical matrix in semiconductors. See XXX

By default, anaddb includes all the three different LR terms (DD, DQ, QQ) to improve the quality of the Fourier interpolation under the assumption that the DDB file contains the Born effective charges, the macroscopic dielectric tensor and the dynamical quadrupoles.

This means that, in the majority of the cases, there is no need to change the default value of [[dipdip@anaddb]], [[dipquad@anaddb]] and [[quadquad@anaddb]] unless you want to disable them for testing purposes. Note, however, that the fact these options are activated by default does not necessarily mean that anaddb can take advantage of them. Please look at the output in the Summary Tab to understand if your DDB file contains the required entries.

get_vsound_view() Row[source]
plot_vsound() Column[source]

This Tab provides widgets to compute the speed of sound by fitting the first three phonon branches along selected q-directions by linear least-squares fit.

The variables [[dipdip@anaddb]], [[dipquad@anaddb]] and [[quadquad@anaddb]] define the treatment of the long-range part (LR) of the IFCs in the Fourier interpolation of the dynamical matrix in semiconductors. See XXX

By default, anaddb includes all the three different LR terms (DD, DQ, QQ) to improve the quality of the Fourier interpolation under the assumption that the DDB file contains the Born effective charges, the macroscopic dielectric tensor and the dynamical quadrupoles.

This means that, in the majority of the cases, there is no need to change the default value of [[dipdip@anaddb]], [[dipquad@anaddb]] and [[quadquad@anaddb]] unless you want to disable them for testing purposes. Note, however, that the fact these options are activated by default does not necessarily mean that anaddb can take advantage of them. Please look at the output in the Summary Tab to understand if your DDB file contains the required entries.

get_asr_dipdip_view() Row[source]
plot_without_asr_dipdip() Column[source]

This Tab provides widgets to compare phonon bands and DOSes computed with/without enforcing the acoustic sum rule and the treatment of the dipole-dipole interaction in the dynamical matrix. Requires DDB file with eps_inf, BECS.

get_dos_vs_qmesh_view() Row[source]
plot_dos_vs_qmesh() Column[source]

This Tab provides widgets to compare phonon DOSes and thermodynamic properties obtained using different q-meshes specifined via nqsmall_list.

The variables [[dipdip@anaddb]], [[dipquad@anaddb]] and [[quadquad@anaddb]] define the treatment of the long-range part (LR) of the IFCs in the Fourier interpolation of the dynamical matrix in semiconductors. See XXX

By default, anaddb includes all the three different LR terms (DD, DQ, QQ) to improve the quality of the Fourier interpolation under the assumption that the DDB file contains the Born effective charges, the macroscopic dielectric tensor and the dynamical quadrupoles.

This means that, in the majority of the cases, there is no need to change the default value of [[dipdip@anaddb]], [[dipquad@anaddb]] and [[quadquad@anaddb]] unless you want to disable them for testing purposes. Note, however, that the fact these options are activated by default does not necessarily mean that anaddb can take advantage of them. Please look at the output in the Summary Tab to understand if your DDB file contains the required entries.

get_quadrupoles_view() Row[source]
plot_phbands_quad() Column[source]

This Tab provides widgets to compare phonon bands and DOSes computed with/without the inclusion of the dipole-quadrupole and quadrupole-quadrupole terms in the dynamical matrix. Requires DDB file with eps_inf, BECS and dynamical quadrupoles.

get_ifcs_view() Row[source]
on_plot_ifc()[source]

Plot the Interatomic Force Constants in real space.

get_elastic_view() Row[source]
on_compute_elastic_btn() Column[source]

Call anaddb to compute elastic and piezoelectric tensors. Require DDB with strain terms.

By default, this method sets the anaddb input variables automatically by looking at the 2nd-order derivatives available in the DDB file. This behaviour can be changed by setting explicitly the value of: relaxed_ion and piezo.

get_panel(as_dict=False, **kwargs)[source]

Return tabs with widgets to interact with the DDB file.

name = 'DdbFilePanel'
class abipy.panels.ddb.PanelWithFileInput(use_structure=False, **params)[source]

Bases: AbipyParameterized

info_str = '\nPost-process the data stored in one of the ABINIT output files (*GSR.nc*, *DDB*, *FATBANDS.nc*, etc)\n'
on_file_input(event) None[source]
on_mpid_input(event) None[source]
get_panel()[source]
name = 'PanelWithFileInput'
class abipy.panels.ddb.PanelWithStructureInput(*, has_remote_server, mpi_procs, plotly_template, verbose, name)[source]

Bases: PanelWithFileInput

info_str = '\nThis app allows users to upload a file with structure info and operate on it.\n'
name = 'PanelWithStructureInput'
class abipy.panels.ddb.DdbPanelWithFileInput(*, has_remote_server, mpi_procs, plotly_template, verbose, name)[source]

Bases: AbipyParameterized

info_str = '\nThis app allows users to upload a DDB file with the dynamical matrix, compute\nphonon-related properties such as band structures, DOS, infrared absorption and visualize\nthe results.\n'
on_file_input(event) None[source]
on_mpid_input(event)[source]
get_panel()[source]
name = 'DdbPanelWithFileInput'
class abipy.panels.ddb.CompareDdbWithMP(*, has_remote_server, mpi_procs, plotly_template, verbose, name)[source]

Bases: AbipyParameterized

info_str = '\nThis app alllows users to upload a DDB file and compare it with the one available on the MP.\n'
on_file_input(event) None[source]
get_panel()[source]
name = 'CompareDdbWithMP'
class abipy.panels.ddb.DdbRobotPanel(robot: DdbRobot, **params)[source]

Bases: BaseRobotPanel, PanelWithAnaddbParams

A panel to analyze multiple DdbFiles via the low-level API provided by DdbRobot. Provides widgets to invoke anaddb and visualize the results.

kwargs_for_anaget_phbst_and_phdos_files(**extra_kwargs) dict[source]

Extend method of base class to handle lo_to_splitting

plot_combiplot(**kwargs) Column[source]

Plot phonon band structures.

plot_without_asr_dipdip() Column[source]

Compare phonon bands and DOSes computed with/without the acoustic sum rule and the treatment of the dipole-dipole interaction in the dynamical matrix. Requires DDB file with eps_inf, BECS.

get_panel(as_dict=False, **kwargs)[source]

Return tabs with widgets to interact with the DDB file.

name = 'DdbRobotPanel'
class abipy.panels.ddb.RobotWithFileInput(*, has_remote_server, mpi_procs, plotly_template, verbose, name)[source]

Bases: AbipyParameterized

info_str = '\nThis app allows users to create an AbiPy robot to post-process\na set of ABINIT output files of the same type.\n '
on_load_files(event)[source]
get_panel()[source]
name = 'RobotWithFileInput'

fatbands Module

Panels for interacting with FATBANDS.nc files.

class abipy.panels.fatbands.FatBandsFilePanel(ncfile: FatBandsFile, **params)[source]

Bases: PanelWithElectronBands

Panel with widgets to interact with a abipy.electrons.fatbands.FatBandsFile.

on_plot_fatbands_btn() Column[source]

Plot fatbands grouped by atomic type and angular momentum l

on_plot_fatdos_btn() Column[source]

Plot PJDOS grouped by atomic type and angular momentum l

get_panel(as_dict=False, **kwargs)[source]

Return tabs with widgets to interact with the FATBANDS.nc file.

name = 'FatBandsFilePanel'

flows Module

“Panels to interact with AbiPy flows.

class abipy.panels.flows.WorkTaskSelector(flow: Flow, **params)[source]

Bases: Viewer

task = None
update_work() None[source]
sync_widgets() None[source]
name = 'WorkTaskSelector'
class abipy.panels.flows.FlowPanel(flow: Flow, **params)[source]

Bases: NodeParameterized

Provides widgets and callbacks to interact with an AbiPy Flow.

get_task_view() Column[source]
on_task_btn() Column[source]

Return panel associated to the selected task.

on_structures_btn() Row[source]
get_panel(as_dict=False, **kwargs)[source]

Return tabs with widgets to interact with the flow.

name = 'FlowPanel'
class abipy.panels.flows.JsPane[source]

Bases: HTML

Based on: https://discourse.holoviz.org/t/how-to-make-a-dynamic-link-in-panel/2137

execute_js(script: str) None[source]
name = 'JsPane'
class abipy.panels.flows.FlowMultiPageApp(flow: Flow, template, spectator_mode=True, **kwargs)[source]

Bases: object

on_goto_work_bnt(event) None[source]
on_goto_task_bnt(event) None[source]
handle_wt()[source]
serve(**serve_kwargs)[source]

gsr Module

Panels to interact with GSR files.

class abipy.panels.gsr.GsrFilePanel(ncfile: GsrFile, **params)[source]

Bases: PanelWithElectronBands

Panel with widgets to interact with a abipy.electrons.gsr.GsrFile.

get_panel(as_dict=False, **kwargs)[source]

Return tabs with widgets to interact with the GSR file.

name = 'GsrFilePanel'
class abipy.panels.gsr.GsrRobotPanel(robot: GsrRobot, **params)[source]

Bases: PanelWithEbandsRobot

A Panel to interact with multiple GSR files.

on_gsr_dataframe_btn() Column[source]
get_panel(as_dict=False, **kwargs)[source]

Return tabs with widgets to interact with the abipy.electrons.gsr.GsrRobot.

name = 'GsrRobotPanel'

hist Module

“Panels for HIST files.

class abipy.panels.hist.HistFilePanel(hist: HistFile, **params)[source]

Bases: AbipyParameterized

Panel with widgets to interact with a abipy.dynamics.hist.HistFile.

on_plot_relax_btn() Column[source]

Plot the evolution of structural parameters (lattice lengths, angles and volume) as well as pressure, info on forces and total energy.

on_view_relax_btn()[source]

Visalize the structural relaxation with an external application.

get_panel(as_dict=False, **kwargs)[source]

Return tabs with widgets to interact with the HIST.nc file.

name = 'HistFilePanel'

nodes Module

“Panels to interact with AbiPy flows.

class abipy.panels.nodes.FilePathSelect(*, description, disabled_options, groups, size, options, disabled, loading, align, aspect_ratio, css_classes, design, height, height_policy, margin, max_height, max_width, min_height, min_width, sizing_mode, styles, stylesheets, tags, visible, width, width_policy, value, name)[source]

Bases: Select

classmethod from_filepaths(filepaths: list[str], filter_files=True, **kwargs)[source]
property filepath: str
name = 'FilePathSelect'
class abipy.panels.nodes.NodeParameterized(node: Node, **params)[source]

Bases: AbipyParameterized

get_status_view() Column[source]
on_status_btn() None[source]

Show the status of the node.

get_history_view() Column[source]
on_history_btn() None[source]

Show the history of the node.

get_graphviz_view() Column[source]
on_graphviz_btn() None[source]

Visualize node dependencies with [graphviz package](https://graphviz.readthedocs.io/en/stable/index.html)

get_debug_view() Column[source]
on_debug_btn() None[source]
get_events_view() Column[source]
on_events_btn() Terminal[source]
on_corrections_btn() Terminal[source]
on_handlers_btn()[source]
get_dims_and_vars_view() Row[source]
on_vars_btn()[source]
on_dims_btn() Row[source]
get_files_in_dir_view(where)[source]

Return None if no file is found

get_panel(as_dict=False, **kwargs)[source]

Return tabs with widgets to interact with the flow.

name = 'NodeParameterized'
class abipy.panels.nodes.StatusCards(df: DataFrame, **params)[source]

Bases: Parameterized

name = 'StatusCards'
open_all_cards(event)[source]
close_all_cards(event)[source]
add_vrect_to_fig(fig)[source]

Add vertical rectangles to the plotly fig in order to group tasks belonging to the same Work.

update_card(event)[source]

This callback is triggered when the user opens/closes the card. Here we compute and display the plot/table the first time the card is opened.

outputs Module

Panels for interacting with output files in text format.

class abipy.panels.outputs.AbinitOutputFilePanel(outfile, **params)[source]

Bases: AbipyParameterized

Panel with widgets to interact with the main Abinit output file.

get_cycles_view(what: str) GridBox[source]

Return GridBox with matplotlib plots for the GS/DFPT SCF cycles or None if no cycle is found.

get_outfile_view() Column[source]
get_panel(as_dict=False, **kwargs)[source]

Return tabs with widgets to interact with the Abinit output file.

name = 'AbinitOutputFilePanel'
class abipy.panels.outputs.AbinitOutputFilePanelWithFileInput(*, has_remote_server, mpi_procs, plotly_template, verbose, name)[source]

Bases: AbipyParameterized

info_str = '\nThis application allows users to analyze the Abinit main output file\n'
on_file_input(event) None[source]
get_panel(**kwargs)[source]
name = 'AbinitOutputFilePanelWithFileInput'

phonons Module

“Panels for phonon-related objects.

class abipy.panels.phonons.PhononBandsPlotterPanel(plotter, **params)[source]

Bases: AbipyParameterized

on_phbands_plot_btn() Row[source]
get_panel(as_dict=False, **kwargs)[source]

Return tabs with widgets to interact with the abipy.dfpt.phonons.PhononBandsPlotter.

name = 'PhononBandsPlotterPanel'

sigeph Module

Panels to interact with the SIGEPH file.

class abipy.panels.sigeph.SigEPhFilePanel(sigeph: SigEPhFile, **params)[source]

Bases: PanelWithElectronBands

Panel with widgets to interact with a abipy.electrons.eph.SigephFile.

plot_lws() GridSpec[source]
plot_qpgaps() GridSpec[source]
plot_qps_vs_e0()[source]
on_plot_qpsolution_sk()[source]
get_panel(as_dict=False, **kwargs)[source]

Return tabs with widgets to interact with the SIGEPH file.

name = 'SigEPhFilePanel'

structure Module

“GUIs for structure.

class abipy.panels.structure.StructurePanel(structure: Structure, with_inputs: bool = True, **params)[source]

Bases: PanelWithStructure

Panel with widgets to interact with an AbiPy Structure.

convert()[source]

Convert the input structure to one of the format selected by the user.

spglib_summary() Row[source]

Call spglib to find space group symmetries and Wyckoff positions.

on_abisanitize_btn() None[source]

Returns a new structure in which:

  • Structure is refined.

  • Reduced to primitive settings.

  • Lattice vectors are exchanged if the triple product is negative

symprec:

Symmetry precision used to refine the structure.

angle_tolerance:

Tolerance on angles.

primitive:

Returns most primitive structure found.

primitive_standard:

Whether to convert to a primitive cell using the standards defined in Setyawan, W., & Curtarolo, S. (2010). High-throughput electronic band structure calculations: Challenges and tools. Computational Materials Science, 49(2), 299-312. doi:10.1016/j.commatsci.2010.05.010

get_kpath() Column[source]

Generate high-symmetry k-path from input structure in the ABINIT format.

get_gs_input() AbinitInput[source]

Return an AbinitInput for GS calculation from the parameters selected via the widgets.

on_gs_input_btn()[source]

This Tab provides widgets to generate a minimalistic ABINIT input file for ground-state calculations or structural relaxations. In the case of relaxation runs, the following variables are automatically added:

[[optcell]] = 2, [[ionmov]] = 2, [[ecutsm]] = 0.5 and [[dilatmx]] = 1.05.

kprra (number of k-points per reciprocal atom) defines the k-mesh for electrons. AbiPy automatically computes the variables [[ngkpt]], [[nshiftk]] and [[shiftk]] from kprra.

The pseudopotentials are taken from the [PseudoDojo project](http://www.pseudo-dojo.org/) according to value of XC type and Pseudos type and recommended values for [[ecut]] and [[pawecutdg]] and [[nband]] are automatically added to the input.

At the end of the page, there is a button to download a targz file with all the required input files.

on_ebands_input_btn()[source]

This Tab provides widgets to generate a minimalistic ABINIT input file for band structure calculations. The first dataset performs a GS run to obtain the density file. The second dataset reads the DEN file and performs a NSCF calculation on a high-symmetry k-path generated automatically according to the input structure. [[ndivsm]] and [[kptbounds]]

Optionally, one can add a third dataset to compute the e-DOS via a NSCF run on a much denser k-mesh.

kprra (number of k-points per reciprocal atom) defines the k-mesh for electrons. AbiPy automatically computes the variables [[ngkpt]], [[nshiftk]] and [[shiftk]] from kprra.

The pseudopotentials are taken from the [PseudoDojo project](http://www.pseudo-dojo.org/) according to value of XC type and Pseudos type and recommended values for [[ecut]] and [[pawecutdg]] and [[nband]] are automatically added to the input.

At the end of the page, there is a button to download a targz file with all the required input files.

on_ph_input_btn()[source]

This Tab provides widgets to generate a minimalistic ABINIT input file for the DFPT computation of phonons, Born effective charges (BECS) and macroscopic dieletric tensors.

kprra (number of k-points per reciprocal atom) defines the k-mesh for electrons. AbiPy automatically computes the variables [[ngkpt]], [[nshiftk]] and [[shiftk]] from kprra.

The pseudopotentials are taken from the [PseudoDojo project](http://www.pseudo-dojo.org/) according to value of XC type and Pseudos type and recommended values for [[ecut]] and [[pawecutdg]] and [[nband]] are automatically added to the input.

At the end of the page, there is a button to download a targz file with all the required input files.

on_mp_match_btn()[source]

Match your structure with the ones available in the MP database. Produce table with lattice parameters and space group info.

NB: Requires a String API key for accessing the MaterialsProject REST interface. Please apply on the Materials Project website for one. If this is None, the code will check if there is a PMG_MAPI_KEY in your .pmgrc.yaml. If so, it will use that environment This makes easier for heavy users to simply add this environment variable to their setups and MPRester can then be called without any arguments.

get_panel(with_inputs=True, as_dict=False, **kwargs)[source]

Build panel with widgets to interact with the structure either in a notebook or in a bokeh app.

Parameters:

with_inputs – True if tabs for generating input files should be shown.

name = 'StructurePanel'
class abipy.panels.structure.InputFileGenerator(*, abi_sanitize, has_remote_server, mpi_procs, plotly_template, verbose, name)[source]

Bases: AbipyParameterized

abi_sanitize = True
info_str = '\nGenerate ABINIT input files for performing basic:\n\n   - GS calculations\n   - NSCF band structure calculations\n   - DFPT calculations for phonons including Born effective charges and dielectric constant\n\nstarting from a crystalline structure provided by the user either via an external file\nor through the Materials Project identifier (*mp-id*).\n'
on_file_input(event)[source]
on_mpid_input(event)[source]
update_main_area()[source]
get_panel()[source]
name = 'InputFileGenerator'

tasks Module

Panels to interact with the AbiPy tasks.

class abipy.panels.tasks.TaskPanel(task: AbinitTask, **params)[source]

Bases: NodeParameterized

Provides widgets to interact with an AbiPy Task.

get_inputs_view()[source]

Show the input files of the task: input file, submission script and TaskManager

get_errs_view()[source]

Show the error files of the task Return None if no error is found so that we don’t show this view in the GUI.

get_main_text_outs_view() Column[source]

Show the main text output files of the task.

get_panel(as_dict=False, **kwargs)[source]

Return tabs with widgets to interact with the flow.

name = 'TaskPanel'

viewers Module

Viewer objects.

class abipy.panels.viewers.AceViewer(filepath: str, theme='terminal', height=1200, **params)[source]

Bases: Viewer

open_ace_editor(event) None[source]
name = 'AceViewer'
class abipy.panels.viewers.JSONViewer(dictionary, theme='dark', hover_preview=True, depth=2, **params)[source]

Bases: Viewer

name = 'JSONViewer'

works Module

“Panels to interact with the AbiPy tasks.

class abipy.panels.works.WorkPanel(work, **params)[source]

Bases: NodeParameterized

Panel to interact with an AbiPy Work

name = 'WorkPanel'