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.extcls_supporting_panel(as_table=True, **tabulate_kwargs)[source]¶
Return list of (ext, cls) tuples where ext is the file extension supporting the get_panel method i.e files that can be integrated with the panel dashboard and cls the python class associated to it.
- abipy.abilab.abipanel(**kwargs)[source]¶
Activate panel extensions used by AbiPy. Return panel module.
- abipy.abilab.abifile_subclass_from_filename(filename: str) ClassVar [source]¶
Returns the appropriate class associated to the given filename.
- abipy.abilab.dir2abifiles(top: str, recurse: bool = True) dict [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 notrecurse
, children directories are not analyzed.
- abipy.abilab.isabifile(filepath: str) bool [source]¶
Return True if filepath can be opened with
abiopen
.
- abipy.abilab.abiopen(filepath: str)[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.abirobot(filepaths: str | List[str]) Robot [source]¶
Factory function to create and return a Robot subclass from a list of filenames The Robot subclass is detected from the extension of the first file hence all files are assumed to have the same extension.
- Parameters:
filepaths – List of strings with the filename.
- abipy.abilab.software_stack(as_dataframe: bool = False)[source]¶
Import all the hard dependencies and some optional packages. Returns ordered dict: package –> string with version info or pandas dataframe if as_dataframe.
- abipy.abilab.abicheck(verbose: int = 0) str [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: str | None = None, force_reinstall: bool | None = 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.