data_management.generate_densities
Reads files with atomic densities and write to cpp files.
Usage
usage: generate_densities.py [-h] [-r] [-a ATOMS_DIR] atomic_density_dir src_dir
positional arguments:
atomic_density_dir Source directory for basis set files. If combined with the "-r" flag, this directory will be recursively searched for basis sets.
src_dir Destination directory for generated source files.
options:
-h, --help show this help message and exit
-r, --recursive Toggle on recursive search through the basis set source directory. Default OFF.
-a ATOMS_DIR, --atoms_dir ATOMS_DIR
The path to where ElementNames.txt can be found.
This script creates the following files based on the include and source directories given. The directories are not created by this script and must be present before running it.
+---include
| nwx_atomic_densities.hpp
|
+---src
| \---atomic_densities (this directory must be made manually before run this python script)
| add_density.cmake
| <all_basis_set_files>
| nwx_atomic_densities.cpp
Functions
|
|
|
|
|
Writes basis set data to C++ files. |
|
Parse atomic density files in XML format. |
|
Parse atomic density files in .dat format. |
|
Parse atomic density files of the specified format. |
|
Entry point function to generate atomic density files. |
|
Parse command line arguments. |
Module Contents
- data_management.generate_densities.make_square_arr(a: list, spacer='\n')
- data_management.generate_densities._write_den_files(out_file: str, bs_name: str, basis_set: dict, tab: str = ' ') None
- data_management.generate_densities._write_densities(src_dir: str, bases: dict, tab=' ') None
Writes basis set data to C++ files.
- Parameters:
src_dir (str) – Source directory for source files.
bases (dict) – Collection of basis sets parsed from files
tab – String representing a tab, defaults to “ ” :type tab: str, optional
- data_management.generate_densities._parse_densities_xml(filepaths, sym2Z) dict
Parse atomic density files in XML format. Deprecated as new atomic density format is adopted. Y. Z. 02/23/23
- Parameters:
filepaths (list of str) – Full paths to atomic density files.
sym2Z (dict) – Mapping from lowercased atomic symbols to atomic numbers
- Returns:
Collection of atomic densities sorted by basis set and element
- Return type:
dict
- data_management.generate_densities._parse_densities_dat(filepaths, sym2Z) dict
Parse atomic density files in .dat format.
- Parameters:
filepaths (list of str) – Full paths to atomic density files.
sym2Z (dict) – Mapping from lowercased atomic symbols to atomic numbers
- Returns:
Collection of atomic densities sorted by basis set and element
- Return type:
dict
- data_management.generate_densities._parse_densities(filepaths, sym2Z, extension='.dat') dict
Parse atomic density files of the specified format.
- Parameters:
filepaths (list of str) – Full paths to atomic density files.
sym2Z (dict) – Mapping from lowercased atomic symbols to atomic numbers
extension (str, optional) – File format extension to parse, defaults to”.dat”
- Raises:
RuntimeError – Unsupported atomic density file format.
- Returns:
Collection of atomic densities sorted by basis set and element
- Return type:
dict
- data_management.generate_densities.main(args: argparse.Namespace) None
Entry point function to generate atomic density files.
- Parameters:
args (argparse.Namespace) – Command line argument namespace
- data_management.generate_densities.parse_args() argparse.Namespace
Parse command line arguments.
- Returns:
Values of command line arguments.
- Return type:
argparse.Namespace