diff --git a/etc/qp.rc b/etc/qp.rc index b2992780..adabc404 100644 --- a/etc/qp.rc +++ b/etc/qp.rc @@ -190,18 +190,21 @@ _qp_Complete() ;; esac;; set_file) - # Array to store directory names - dirs="" + # Caching the search results to reduce repeated find calls + if [[ -z "$QP_FILE_CACHE" || "$CACHE_DIR" != "$PWD" ]]; then + CACHE_DIR="$PWD" + QP_FILE_CACHE=$(find . -type f -name .version -exec dirname {} \; | sed 's/\/\.version$//') + fi - # Find directories containing "ezfio/.version" file recursively - for i in $(find . -name ezfio | sed 's/ezfio$/.version/') - do - dir_name=${i%/.version} # Remove the ".version" suffix - dir_name=${dir_name#./} # Remove the leading "./" - dirs+="$dir_name " - done + # Support for relative paths + prefix=$(dirname "${cur}") + if [[ "$prefix" != "." ]]; then + dirs=$(echo "$QP_FILE_CACHE" | grep "^$prefix") + else + dirs="$QP_FILE_CACHE" + fi - COMPREPLY=( $(compgen -W "$dirs" -- ${cur} ) ) + COMPREPLY=( $(compgen -W "$dirs" -- "$cur") ) return 0 ;; plugins) diff --git a/scripts/qp_import_trexio.py b/scripts/qp_import_trexio.py index d75d0074..630ffb5e 100755 --- a/scripts/qp_import_trexio.py +++ b/scripts/qp_import_trexio.py @@ -3,11 +3,11 @@ convert TREXIO file to EZFIO Usage: - qp_import_trexio [-o EZFIO_DIR] FILE + qp_import_trexio [-o EZFIO_DIR] [-p] FILE Options: - -o --output=EZFIO_DIR Produced directory - by default is FILE.ezfio + -o --output=EZFIO_DIR Produced directory + by default is FILE.ezfio """ @@ -195,7 +195,7 @@ def write_ezfio(trexio_filename, filename): prim_factor = trexio.read_basis_prim_factor(trexio_file) for i,p in enumerate(prim_factor): coefficient[i] *= prim_factor[i] - ezfio.set_ao_basis_primitives_normalized(False) + ezfio.set_ao_basis_primitives_normalized(True) ezfio.set_basis_prim_coef(coefficient) elif basis_type.lower() == "numerical": diff --git a/src/trexio/export_trexio_routines.irp.f b/src/trexio/export_trexio_routines.irp.f index 0eec68bd..5bc44880 100644 --- a/src/trexio/export_trexio_routines.irp.f +++ b/src/trexio/export_trexio_routines.irp.f @@ -272,9 +272,9 @@ subroutine export_trexio(update,full_path) allocate(factor(shell_num)) ! if (ao_normalized) then -! factor(1:shell_num) = shell_normalization_factor(1:shell_num) + factor(1:shell_num) = shell_normalization_factor(1:shell_num) ! else - factor(1:shell_num) = 1.d0 +! factor(1:shell_num) = 1.d0 ! endif rc = trexio_write_basis_shell_factor(f(1), factor) call trexio_assert(rc, TREXIO_SUCCESS) @@ -291,11 +291,11 @@ subroutine export_trexio(update,full_path) call trexio_assert(rc, TREXIO_SUCCESS) allocate(factor(prim_num)) - if (primitives_normalized) then +! if (primitives_normalized) then factor(1:prim_num) = prim_normalization_factor(1:prim_num) - else - factor(1:prim_num) = 1.d0 - endif +! else +! factor(1:prim_num) = 1.d0 +! endif rc = trexio_write_basis_prim_factor(f(1), factor) call trexio_assert(rc, TREXIO_SUCCESS) deallocate(factor)