abipy.scripts package

Empty file, needed by sphinxarg.ext so that scripts can be imported.

Submodules

abipy.scripts.abicheck module

This script checks that the options in manager.yml, scheduler.yml, and the environment on the local machine are properly configured.

abipy.scripts.abicheck.show_managers(options)[source]

Print table with manager files provided by AbiPy.

abipy.scripts.abicheck.get_epilog()[source]
Return type:

str

abipy.scripts.abicheck.get_parser(with_epilog=False)[source]
abipy.scripts.abicheck.main()[source]
abipy.scripts.abicheck.make_scf_nscf_inputs(paral_kgb=0)[source]

Returns two input files: GS run and NSCF on a high symmetry k-mesh.

abipy.scripts.abicheck.run_flow(options)[source]

Run test flow, return exit code.

abipy.scripts.abicomp module

Script to analyze/compare results stored in multiple netcdf/output files. By default the script displays the results/plots in the shell. Use –ipython to start an ipython terminal or -nb to generate an ipython notebook.

abipy.scripts.abicomp.remove_disordered(structures, paths)[source]

Remove disordered structures and print warning message.

abipy.scripts.abicomp.df_to_clipboard(options, df)[source]

Copy dataframe to clipboard if options.clipboard.

abipy.scripts.abicomp.abicomp_structure(options)[source]

Compare crystalline structures. Use –group to compare for similarity.

abipy.scripts.abicomp.compare_structures(options)[source]

Inspired to a similar function in pmg_structure.

abipy.scripts.abicomp.abicomp_spg(options)[source]

Compare the space group found by Abinit with the spglib results for a set of crystalline structure(s) read from FILE(s).

abipy.scripts.abicomp.abicomp_mp_structure(options)[source]

Compare the crystalline structure(s) read from FILE with the one(s) reported in the materials project database.

abipy.scripts.abicomp.abicomp_cod_structure(options)[source]

Compare the crystalline structure(s) read from FILE with the one(s) given in the COD database (http://www.crystallography.net/cod).

abipy.scripts.abicomp.abicomp_xrd(options)[source]

Compare X-ray diffraction plots (requires FILES with structure).

abipy.scripts.abicomp.abicomp_data(options)[source]

Compare results stored in multiple files with data in tabular format.

abipy.scripts.abicomp.abicomp_png(options)[source]

Use matplotlib to plot multiple png files on a grid.

abipy.scripts.abicomp.abicomp_ebands(options)[source]

Plot electron bands on a grid.

abipy.scripts.abicomp.abicomp_edos(options)[source]

Plot electron DOSes on a grid.

abipy.scripts.abicomp.abicomp_phbands(options)[source]

Plot phonon bands on a grid.

abipy.scripts.abicomp.abicomp_phdos(options)[source]

Compare multiple PHDOS files.

abipy.scripts.abicomp.abicomp_getattr(options)[source]

Extract attribute from Abipy object for all files listed on the command line and print them. Use –list option to list the attributes available (in the first file).

abipy.scripts.abicomp.abicomp_gsr(options)[source]

Compare multiple GSR files.

abipy.scripts.abicomp.abicomp_hist(options)[source]

Compare multiple HIST files.

abipy.scripts.abicomp.abicomp_ddb(options)[source]

Compare multiple DDB files. Assume DDB files with a list of q-points in the IBZ corresponding to homogeneous sampling i.e. files that have been merged with mrgddb.

abipy.scripts.abicomp.abicomp_anaddb(options)[source]

Compare multiple anaddb.nc files.

abipy.scripts.abicomp.abicomp_phbst(options)[source]

Compare multiple PHBST.nc files.

abipy.scripts.abicomp.abicomp_sigres(options)[source]

Compare multiple SIGRES files.

abipy.scripts.abicomp.abicomp_mdf(options)[source]

Compare macroscopic dielectric functions stored in multiple MDF files.

abipy.scripts.abicomp.abicomp_optic(options)[source]

Compare results stored in OPTIC.nc files.

abipy.scripts.abicomp.abicomp_a2f(options)[source]

Compare results stored in A2f.nc files.

abipy.scripts.abicomp.abicomp_gkq(options)[source]

Compare multiple GKQ files with EPH matrix elements for a given q-point.

abipy.scripts.abicomp.abicomp_v1qavg(options)[source]

Compare multiple V1QAVG files with the average of the DFPT V1 potentials as function of q-point.

abipy.scripts.abicomp.abicomp_sigeph(options)[source]

Compare multiple SIGEPH files storing the e-ph self-energy.

abipy.scripts.abicomp.abicomp_rta(options)[source]

Compare multiple RTA files.

abipy.scripts.abicomp.abicomp_abiwan(options)[source]

Compare multiple ABIWAN files.

abipy.scripts.abicomp.abicomp_abiwan_ebands(options)[source]

Compare Wannier-interpolated band structure with ab-initio data.

abipy.scripts.abicomp.abicomp_skw_ibz_kpath(options)[source]

Compare star-function-interpolated band structure with ab-initio band structure computed along a k-path.

abipy.scripts.abicomp.abicomp_pseudos(options)[source]

“Compare multiple pseudos and print table to terminal.

abipy.scripts.abicomp.abicomp_psps(options)[source]

“Compare multiple PSPS.nc files.

abipy.scripts.abicomp.abicomp_gwr(options)[source]

Compare multiple GWR files.

abipy.scripts.abicomp.abicomp_gs_scf(options)[source]

Compare ground-state SCF cycles.

abipy.scripts.abicomp.abicomp_dfpt2_scf(options)[source]

Compare DFPT SCF cycles.

abipy.scripts.abicomp.abicomp_text(options)[source]

Compare 2+ text files in the browser

abipy.scripts.abicomp.abicomp_time(options)[source]

Analyze/plot the timing data of single or multiple runs.

abipy.scripts.abicomp.get_epilog()[source]
abipy.scripts.abicomp.get_parser(with_epilog=False)[source]
abipy.scripts.abicomp.serve_kwargs_from_options(options)[source]
abipy.scripts.abicomp.main()[source]

abipy.scripts.abidoc module

Interface to the database of ABINIT input variables

abipy.scripts.abidoc.print_vlist(vlist, options)[source]
abipy.scripts.abidoc.get_epilog()[source]
Return type:

str

abipy.scripts.abidoc.get_parser(with_epilog=False)[source]
abipy.scripts.abidoc.main()[source]

abipy.scripts.abigui module

Script to start the panel-based AbiPy web GUI.

abipy.scripts.abigui.main()[source]

abipy.scripts.abiml module

Script to perform several types of calculations with ASE and ML potentials.

abipy.scripts.abiml.set_default(ctx, param, filepath)[source]

To have config file for a single command: Based on https://stackoverflow.com/questions/46358797/python-click-supply-arguments-and-options-from-a-configuration-file

abipy.scripts.abiml.herald(f)[source]
abipy.scripts.abiml.add_constraint_opts(f)[source]

Add CLI options to constrain atoms.

abipy.scripts.abiml.add_relax_opts(f)[source]

Add CLI options for structural relaxations with ASE.

abipy.scripts.abiml.add_phonopy_opts(f, supercell=(2, 2, 2))[source]

Add CLI options for phonopy_calculations.

abipy.scripts.abiml.add_neb_opts(f)[source]

Add CLI options for NEB calculations with ASE.

abipy.scripts.abiml.add_nprocs_opt(f)[source]

Add CLI options for multiprocessing.

abipy.scripts.abiml.add_workdir_verbose_opts(f)[source]

Add workdir and verbose options to CLI subcommand.

abipy.scripts.abiml.add_nn_name_opt(f)[source]

Add CLI options to select the NN potential.

abipy.scripts.abiml.add_nn_names_opt(f)[source]

Add CLI options to select multiple NN potentials.

abipy.scripts.abiml.phddb_add_phonopy_opts(f)[source]

Change default value of supercell.

abipy.scripts.abinp module

This script provides a simplified interface to the AbiPy factory functions. For a more flexible interface, please use the AbiPy objects to generate input files and workflows.

abipy.scripts.abinp.vasp_dict_set_cls(s)[source]

Return a subclass of DictSect from string s. If s == “__all__”, return list with all VaspInputSet subclasses supported by pymatgen.

Return type:

Union[Type, list[str]]

abipy.scripts.abinp.finalize(obj, options)[source]
abipy.scripts.abinp.build_abinit_input_from_file(options, **abivars)[source]

Build and return an AbinitInput instance from filepath.

abivars are optional variables that will be added to the input.

abipy.scripts.abinp.abinp_validate(options)[source]

Validate Abinit input file.

abipy.scripts.abinp.abinp_autoparal(options)[source]

Compute autoparal configurations.

abipy.scripts.abinp.abinp_abispg(options)[source]

Call Abinit with chkprim = 0 to find space group.

abipy.scripts.abinp.abinp_ibz(options)[source]

Get k-points in the irreducible weights.

abipy.scripts.abinp.abinp_phperts(options)[source]

Get list of phonon perturbations.

abipy.scripts.abinp.abinp_gs(options)[source]

Build Abinit input for ground-state calculation.

abipy.scripts.abinp.abinp_ebands(options)[source]

Build Abinit input for band structure calculations.

abipy.scripts.abinp.abinp_phonons(options)[source]

Build Abinit input for phonon calculations.

abipy.scripts.abinp.abinp_g0w0(options)[source]

Generate input files for G0W0 calculations.

abipy.scripts.abinp.abinp_anaph(options)[source]

Build Anaddb input file for the computation of phonon bands DOS.

abipy.scripts.abinp.abinp_vasp(options)[source]

Build VASP input files from a FILE defining the structure.

abipy.scripts.abinp.abinp_wannier90(options)[source]

Build wannier90 template input file from Abinit input/output file. possibly with electron bands.

abipy.scripts.abinp.abinp_lobster(options)[source]

Build and print Lobster input file from directory with files file (for pseudos) and GSR.nc output file (multidatasets are not allowed). Supports also directory with vasprun.xml and POTCAR file.

abipy.scripts.abinp.abinp_slurm(options)[source]

Print template for Slurm submmission script

abipy.scripts.abinp.get_epilog()[source]
abipy.scripts.abinp.get_parser(with_epilog=False)[source]

Build parser.

abipy.scripts.abinp.main()[source]

abipy.scripts.abiopen module

This script opens one of the output files produced by Abinit (usually in netcdf format but other files are supported as well). By default the script starts an interactive ipython session so that one can interact with the file and call its methods. Alternatively, it is possible to generate automatically a jupyter notebook to execute code.

abipy.scripts.abiopen.make_and_open_notebook(options)[source]

Generate a jupyter notebook and open it in the browser. Return system exit code.

Raises:

RuntimeError if jupyter is not in $PATH

abipy.scripts.abiopen.get_epilog()[source]
Return type:

str

abipy.scripts.abiopen.get_parser(with_epilog=False)[source]
abipy.scripts.abiopen.serve_kwargs_from_options(options)[source]
abipy.scripts.abiopen.main()[source]
abipy.scripts.abiopen.handle_ase_traj(options)[source]

Handle ASE trajectory file.

abipy.scripts.abiopen.handle_ase_md_log(options)[source]

Handle ASE MD log file.

abipy.scripts.abiopen.handle_csv(options)[source]

Handle CSV file.

abipy.scripts.abiopen.handle_json(options)[source]

Handle JSON file.

abipy.scripts.abiopen.handle_flowsdb_file(options)[source]

Handle flows.db file.

abipy.scripts.abips module

Script to download and install pseudopotential tables from the web.

abipy.scripts.abips.abips_list(options)[source]

List installed pseudopotential repos.

Return type:

list

abipy.scripts.abips.abips_avail(options)[source]

Show available pseudopotential repos.

Return type:

int

abipy.scripts.abips.abips_install(options)[source]

Install pseudopotential repositories by name(s). Use avail command to get repo names.

Return type:

int

abipy.scripts.abips.abips_show(options)[source]

Show info on pseudopotential table(s).

Return type:

int

abipy.scripts.abips.abips_element(options)[source]

Find all pseudos in the installed tables for the given element (symbol or znucl).

Return type:

int

abipy.scripts.abips.abips_mkff(options)[source]

Call Abinit to compute PSPS.nc files from a list of pseudos and show results.

Return type:

int

abipy.scripts.abips.get_epilog()[source]
Return type:

str

abipy.scripts.abips.get_parser(with_epilog=False)[source]
abipy.scripts.abips.main()[source]

abipy.scripts.abirun module

The abirun.py script allows the user to submit the calculations contained in an AbiPy Flow. It provides a command line interface as well graphical interfaces.

abipy.scripts.abirun.straceback()[source]

Returns a string with the traceback.

Return type:

str

abipy.scripts.abirun.parse_strings(s)[source]

Parse comma separated values. Return None if s is None.

abipy.scripts.abirun.flowdir_wname_tname(dirname)[source]

” Given a initial directory dirname containing a node of the Flow, this function locates the directory of the flow (e.g. the directory with the pickle file) and returns the name of the work and/or of the node.

Return: flowdir, wname, tname

where flowdir is the directory containing the pickle file, wname and tname are the basenames of the work/task.

If dirname contains the pickle file we have (wname, tname) == (None, None) If dirname is a work –> wname is it’s basename and tname is None If dirname is a task –> os.path.join(flowdir, wname, tname) == task.workdir.

abipy.scripts.abirun.select_nids(flow, options)[source]

Return the set of node ids selected by the user via the command line interface.

Return type:

set

abipy.scripts.abirun.cli_abiopen(options, filepath)[source]

Code taken from abiopen.py.

abipy.scripts.abirun.flow_debug_reset_tasks(flow, nids=None, verbose=0)[source]

Analyze error files produced by reset tasks for possible error messages

Parameters:
  • nids – List of node identifiers. By defaults all nodes that have been resetted are analyzed.

  • verbose – Verbosity level.

Return type:

None

abipy.scripts.abirun.flow_watch_status(flow, delay=5, nids=None, verbose=0, func_name='show_func')[source]

Enter an infinite loop and delay execution for the given number of seconds. (default: 5 secs).

Parameters:
  • delay – delay execution for the given number of seconds. (default: 5 secs).

  • nids – List of node identifiers. By defaults all nodes that have been resetted are analyzed.

  • verbose – Verbosity level.

  • func_name – Name of the function used to show the status of the flow.

abipy.scripts.abirun.get_epilog()[source]
Return type:

str

abipy.scripts.abirun.get_parser(with_epilog=False)[source]
abipy.scripts.abirun.serve_kwargs_from_options(options)[source]
Return type:

dict

abipy.scripts.abirun.main()[source]

abipy.scripts.abislurm module

This script retrieve information on Slurm jobs.

abipy.scripts.abislurm.get_epilog()[source]
Return type:

str

abipy.scripts.abislurm.get_parser(with_epilog=False)[source]
abipy.scripts.abislurm.main()[source]

abipy.scripts.abistruct module

Script to analyze/export/visualize the crystal structure saved in the netcdf files produced by ABINIT.

abipy.scripts.abistruct.save_structure(structure, options)[source]

Save structure to file.

Return type:

None

abipy.scripts.abistruct.check_ordered_structure(structure)[source]

Print a warning and sys.exit 1 if structure is disordered.

Return type:

None

abipy.scripts.abistruct.get_epilog()[source]
Return type:

str

abipy.scripts.abistruct.get_parser(with_epilog=False)[source]
abipy.scripts.abistruct.serve_kwargs_from_options(options)[source]
Return type:

dict

abipy.scripts.abistruct.main()[source]

abipy.scripts.abiview module

This script visualizes results with external graphical applications. or convert data from Abinit files (usually netcdf) to other formats.

abipy.scripts.abiview.handle_overwrite(path, options)[source]

Exit 1 if file path exists and not options.force else return path.

abipy.scripts.abiview.df_to_clipboard(options, df)[source]

Copy dataframe to clipboard if options.clipboard.

Return type:

None

class abipy.scripts.abiview.NegateAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Bases: Action

abipy.scripts.abiview.abiview_structure(options)[source]

Visualize the structure with the specified visualizer. Requires external app or optional python modules (mayavi, vtk)

abipy.scripts.abiview.abiview_input(options)[source]

Read input file from netcdf file and print it to terminal.

abipy.scripts.abiview.abiview_hist(options)[source]

Visualize structural relaxation/molecular-dynamics run from data stored in the HIST.nc file. Requires mayavi.

abipy.scripts.abiview.abiview_data(options)[source]

Extract data from a generic text file with results in tabular format and plot data with matplotlib. Multiple datasets are supported. No attempt is made to handle metadata (e.g. column name)

abipy.scripts.abiview.abiview_dirviz(options)[source]

Visualize directory tree with graphviz.

Return type:

int

abipy.scripts.abiview.abiview_ebands(options)[source]

Plot electronic bands if file contains high-symmetry k-path or DOS if k-sampling. Accept any file with ElectronBands e.g. GSR.nc, WFK.nc, …

Return type:

int

abipy.scripts.abiview.abiview_effmass(options)[source]

Compute electron effective masses with finite differences using energies along a k-path Accept any file with ElectronBands e.g. GSR.nc, WFK.nc, …

Return type:

int

abipy.scripts.abiview.abiview_skw(options)[source]

Interpolate energies in k-space along a k-path with the star-function method. Note that the interpolation will likely fail if there are symmetric k-points in the input set of k-points so it is highly recommended to call this method with energies obtained in the IBZ. Accept any file with ElectronBands e.g. GSR.nc, WFK.nc, …

Return type:

int

abipy.scripts.abiview.abiview_fs(options)[source]

Extract eigenvalues in the IBZ from file and visualize Fermi surface with the external application specified via –appname

Return type:

int

abipy.scripts.abiview.abiview_ifermi_fs(options)[source]

Use ifermi package to visualize the Fermi surface. Requires netcdf file with energies in the IBZ. See <https://fermisurfaces.github.io/IFermi/>

Return type:

int

abipy.scripts.abiview.abiview_ddb(options)[source]

Invoke anaddb to compute phonon bands and DOS from the DDB, plot the results.

Return type:

int

abipy.scripts.abiview.abiview_ddb_vs(options)[source]

Compute speed of sound by fitting phonon frequencies along selected directions.

Return type:

int

abipy.scripts.abiview.abiview_ddb_ir(options)[source]

Compute infra-red spectrum from DDB. Plot results.

Return type:

int

abipy.scripts.abiview.abiview_ddb_asr(options)[source]

Compute phonon band structure from DDB with/without acoustic sum rule. Plot results.

Return type:

int

abipy.scripts.abiview.abiview_ddb_dipdip(options)[source]

Compute phonon band structure from DDB with/without dipole-dipole interaction. Plot results.

Return type:

int

abipy.scripts.abiview.abiview_ddb_quad(options)[source]

Compute phonon band structure from DDB with/without quadrupole terms. Plot results.

Return type:

int

abipy.scripts.abiview.abiview_ddb_isodistort_ph(options)[source]

Compute ph-freqs for given q-point (default: Gamma), produce CIF files for unperturbed and distorded structure that can be used with ISODISTORT (https://stokes.byu.edu/iso/isodistort.php) to analyze the symmetry of phonon modes. See README.me file produced in output directory.

Return type:

int

abipy.scripts.abiview.abiview_ddb_qpt(options)[source]

Compute ph-frequencies at the selected q-point without passing through the Fourier interpolation of the interatomic force constants.

Return type:

int

abipy.scripts.abiview.abiview_ddb_ifc(options)[source]

Visualize interatomic force constants in real space.

Return type:

int

abipy.scripts.abiview.abiview_phbands(options)[source]

Plot phonon bands. Accept any file with PhononBands e.g. PHBST.nc, …

Return type:

int

abipy.scripts.abiview.abiview_denpot(options)[source]

Visualize netcdf DEN/POT files with –appname (default: Vesta). NB: Appplication must be installed and in $PATH.

Return type:

int

abipy.scripts.abiview.abiview_lobster(options)[source]

Analyze lobster output files in directory.

Return type:

int

abipy.scripts.abiview.abiview_xrd_traj(options)[source]

Compare XRD spectra using the first and the last structure read from a trajectory file.

Return type:

int

abipy.scripts.abiview.get_epilog()[source]
Return type:

str

abipy.scripts.abiview.get_parser(with_epilog=False)[source]
abipy.scripts.abiview.main()[source]

abipy.scripts.oncv module

Script to generate/analyze/plot ONCVPSP pseudopotentials.

abipy.scripts.oncv.oncv_notebook(options)[source]

Generate jupyter notebook to plot data. Requires oncvpsp output file.

abipy.scripts.oncv.oncv_gnuplot(options)[source]

Plot data with gnuplot.

abipy.scripts.oncv.oncv_print(options)[source]

Parse oncvps output file and print results to terminal.

Return type:

int

abipy.scripts.oncv.oncv_plot(options)[source]

Plot data with matplotlib. Requires oncvpsp output file.

Return type:

int

abipy.scripts.oncv.oncv_plot_pseudo(options)[source]

Plot data with matplotlib. Requires pseudopotential file (UPF2 or pawxml).

Return type:

int

abipy.scripts.oncv.oncv_compare(options)[source]

Compare multiple oncvpsp output files.

Return type:

int

abipy.scripts.oncv.oncv_run(options)[source]

Run oncvpsp, generate djrepo file, plot results. Requires oncvps input file.

abipy.scripts.oncv.oncv_ghost(options)[source]

Scan directories for oncvpsp output files and build dataframe with ghost position

Return type:

int

abipy.scripts.oncv.oncv_gui(options)[source]

Start a panel web app to generate pseudopotentials.

abipy.scripts.oncv.get_epilog()[source]
Return type:

str

abipy.scripts.oncv.get_parser(with_epilog=False)[source]
abipy.scripts.oncv.main()[source]