abilab

abilab Module

This module gathers the most important classes and helper functions used for scripting.

abipy.abilab.abiopen_ext2class_table()[source]

Print the association table between file extensions and File classes.

abipy.abilab.abifile_subclass_from_filename(filename)[source]

Returns the appropriate class associated to the given filename.

abipy.abilab.dir2abifiles(top, recurse=True)[source]

Analyze the filesystem starting from directory top and return an ordered dictionary mapping the directory name to the list of files supported by abiopen contained within that directory. If not recurse, children directories are not analyzed.

abipy.abilab.isabifile(filepath)[source]

Return True if filepath can be opened with abiopen.

abipy.abilab.abiopen(filepath)[source]

Factory function that opens any file supported by abipy. File type is detected from the extension

Parameters

filepath – string with the filename.

abipy.abilab.display_structure(obj, **kwargs)[source]

Use Jsmol to display a structure in the jupyter notebook. Requires nbjsmol notebook extension installed on the local machine. Install it with pip install nbjsmol. See also https://github.com/gmatteo/nbjsmol.

Parameters
  • obj – Structure object or file with a structure or python object with a structure attribute.

  • kwargs – Keyword arguments passed to nbjsmol_display

abipy.abilab.mjson_load(filepath, **kwargs)[source]

Read JSON file in MSONable format with MontyDecoder. Return dict with python objects.

abipy.abilab.mjson_loads(string, **kwargs)[source]

Read JSON string in MSONable format with MontyDecoder. Return dict with python objects.

abipy.abilab.mjson_write(d, filepath, **kwargs)[source]

Write dictionary d to filepath in JSON format using MontyDecoder

abipy.abilab.software_stack()[source]

Import all the hard dependencies. Returns ordered dict: package –> string with version info.

abipy.abilab.abicheck(verbose=0)[source]

This function tests if the most important ABINIT executables can be found in $PATH and whether the python modules needed at run-time can be imported. Return string with error messages, empty if success.

abipy.abilab.install_config_files(workdir=None, force_reinstall=False)[source]

Install pre-defined configuration files for the TaskManager and the Scheduler in the workdir directory.

Parameters
  • workdir – Directory when configuration files should be produced. Use ~/abinit/abipy/ if None

  • force_reinstall – Allow overwrite pre-existent configuration files. By default, the function raises RuntimeError if configuration files are already present.

abipy.abilab.abipy_logo1()[source]

http://www.text-image.com/convert/pic2ascii.cgi

abipy.abilab.abipy_logo2()[source]

http://www.text-image.com/convert/pic2ascii.cgi

abipy.abilab.abipy_logo3()[source]

http://www.text-image.com/convert/pic2ascii.cgi