data_management.helper_fxns =========================== .. py:module:: data_management.helper_fxns .. autoapi-nested-parse:: This file contains helper functions used throughout the various parsing scripts in this directory. Functions --------- .. autoapisummary:: data_management.helper_fxns.find_files data_management.helper_fxns.lookup_extension data_management.helper_fxns.sanitize_basis_name data_management.helper_fxns.desanitize_basis_name data_management.helper_fxns.write_warning Module Contents --------------- .. py:function:: find_files(source_root, extensions, recursive=False) Recursively find all files in the given directory with the provided extensions. :param source_root: Root directory containing relevant files. :type source_root: str :param extensions: File extensions to search for. :type extensions: list of str :param recursive: Whether or not to recursively search in subdirectories, defaults to False :type recursive: bool :return: Dictionary of file extensions mapping to lists of full paths to files found with the respective extension :rtype: dict of lists .. py:function:: lookup_extension(format) Looks up the extension for a basis set file format. :param format: BSE basis set file format identifier. :type format: str :return: Extension for the file format. :rtype: str .. py:function:: sanitize_basis_name(bs_name) Sanitizes the basis set name. For example, replace numbers with the corresponding word and hyphens, plus-signs, and other symbols with underscores. :param bs_name: Basis set name :type bs_name: str :return: Sanitized basis set name :rtype: str .. py:function:: desanitize_basis_name(bs_name) "Desanitizes" the basis set name. For example, replace "_star" with an asterisk character '*'. :param bs_name: Sanitized basis set name :type bs_name: str :return: Unsanitized basis set name :rtype: str .. py:function:: write_warning(fout, script_name, prefix='') Writes a warning saying the file was auto-generated by the given script and will be overwritten the next time it is run. :param fout: Text file opened for output. :type fout: :class:io.TextIOBase :param script_name: Name of the script that generates the file. :type script_name: str :param prefix: An optional, additional prefix to be added to every line of the warning comment. This is a quick an dirty fix to output this warning to non-C++ files, where comments may be different. Defaults to "". :type prefix: str