def test_get_all_basis_names_fail(tmp_path): """Test get_all_basis_names with bad data dir """ tmp_path = str(tmp_path) # Needed for python 3.5 with pytest.raises(FileNotFoundError, match=r'JSON file .* does not exist'): bse.get_all_basis_names(tmp_path)
# into the directory $NWCHEM_TOP/src/basis/libraries.bse # to use, set the env. variable NWCHEM_BASIS_LIBRARY=$NWCHEM_TOP/src/basis/libraries.bse/ # Requires the installation of the python env. from # https://github.com/MolSSI-BSE/basis_set_exchange # See https://molssi-bse.github.io/basis_set_exchange/ # # names changed # def2-universal-jfit was weigend_coulomb_fitting # dgauss-a1-dftjfit was dgauss_a1_dft_coulomb_fitting # dgauss-a2-dftjfit was dgauss_a2_dft_coulomb_fitting # import basis_set_exchange as bse from datetime import datetime today = datetime.now().isoformat(timespec='minutes') print(today) all_bs = bse.get_all_basis_names() md = bse.get_metadata() for bas_name in all_bs: #get version and list of elements version_bs = md[bas_name]['latest_version'] elements_list = md[bas_name]['versions'][version_bs]['elements'] #open file # get rid of asterisks file_name = bas_name.replace("*", "s") #get rid of parenthesis file_name = file_name.replace("(", "") file_name = file_name.replace(")", "") #replace commas with underscore file_name = file_name.replace(",", "_") #replace whitespace with underscore file_name = file_name.replace(" ", "_")