mirror of
https://github.com/LCPQ/quantum_package
synced 2024-12-22 04:14:07 +01:00
Remove check_dependencies.sh, is no handle by module_handler.py
This commit is contained in:
parent
fdc415b4a2
commit
df086e5edd
1
scripts/.gitignore
vendored
1
scripts/.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
*.pyc
|
||||
*.pyo
|
||||
docopt.py
|
@ -1,64 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# usage:
|
||||
# check_dependencies.sh MOs AOs Electrons
|
||||
#
|
||||
# Checks that the list of dependencies given in
|
||||
# argument is consistent. If the dependencies
|
||||
# are OK the exit code is 0, otherwise it is 1.
|
||||
# If no argument is given, the dependencies are
|
||||
# read in the Makefile.
|
||||
# Thu Apr 3 01:44:23 CEST 2014
|
||||
|
||||
if [[ -z ${QPACKAGE_ROOT} ]]
|
||||
then
|
||||
print "The QPACKAGE_ROOT environment variable is not set."
|
||||
print "Please reload the quantum_package.rc file."
|
||||
exit -1
|
||||
fi
|
||||
source ${QPACKAGE_ROOT}/scripts/qp_include.sh
|
||||
|
||||
if [[ -z $1 ]]
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ $1 == "-" ]]
|
||||
then
|
||||
|
||||
COMMAND_LINE=$(module_handler.py print_genealogy NEEDED_MODULES)
|
||||
else
|
||||
COMMAND_LINE=$(unique_list $@)
|
||||
fi
|
||||
|
||||
for d in $COMMAND_LINE
|
||||
do
|
||||
if [[ ! -d ${QPACKAGE_ROOT}/src/$d ]]
|
||||
then
|
||||
echo Error: Directory $d does not exist
|
||||
exit 2
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
DEPS_LONG=""
|
||||
for i in $COMMAND_LINE
|
||||
do
|
||||
DEPS_LONG+=" $i "
|
||||
DEPS_LONG+=$(module_handler.py print_genealogy "${QPACKAGE_ROOT}/src/${i}/NEEDED_MODULES")
|
||||
done
|
||||
|
||||
DEPS=$(unique_list $DEPS_LONG)
|
||||
|
||||
if [[ ! "$COMMAND_LINE" == "$DEPS" ]]
|
||||
then
|
||||
DEPS=$(${QPACKAGE_ROOT}/scripts/check_dependencies.sh ${DEPS})
|
||||
fi
|
||||
echo "$DEPS"
|
||||
|
||||
if [[ "$COMMAND_LINE" == "$DEPS" ]]
|
||||
then
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
@ -14,7 +14,5 @@ source ${QPACKAGE_ROOT}/scripts/qp_include.sh
|
||||
|
||||
check_current_dir_is_module
|
||||
|
||||
OUTPUT=$(${QPACKAGE_ROOT}/scripts/check_dependencies.sh $@)
|
||||
echo ${OUTPUT} > NEEDED_MODULES
|
||||
|
||||
|
||||
OUTPUT=$(module_handler.py check_dependencies $@)
|
||||
echo $@ > NEEDED_CHILDREN_MODULES
|
@ -126,7 +126,7 @@ debug "Makefile created"
|
||||
|
||||
# Create the NEEDED_MODULES file
|
||||
"${QPACKAGE_ROOT}/scripts/create/create_Needed_modules.sh" ${NEEDED_MODULES} || fail "Unable to create the NEEDED_MODULES file"
|
||||
if [[ ! -f NEEDED_MODULES ]]
|
||||
if [[ ! -f NEEDED_CHILDREN_MODULES ]]
|
||||
then
|
||||
fail "NEEDED_MODULES was not created"
|
||||
fi
|
||||
|
@ -7,14 +7,16 @@ Create the NEEDED_MODULE
|
||||
of a NEEDED_CHILDREN_MODULES file
|
||||
|
||||
Usage:
|
||||
module_handler.py print_genealogy [<NEEDED_CHILDREN_MODULES>]
|
||||
module_handler.py create_png [<NEEDED_CHILDREN_MODULES>]
|
||||
module_handler.py print_genealogy [<NEEDED_CHILDREN_MODULES>]
|
||||
module_handler.py check_dependencies [<module_name>...]
|
||||
module_handler.py create_png [<NEEDED_CHILDREN_MODULES>]
|
||||
|
||||
Options:
|
||||
print_genealogy Print the genealogy of the NEEDED_CHILDREN_MODULES
|
||||
aka (children, subchildren, etc)
|
||||
if NEEDED_CHILDREN_MODULES
|
||||
try to open it in the current path
|
||||
print_genealogy Print the genealogy of the NEEDED_CHILDREN_MODULES
|
||||
aka (children, subchildren, etc)
|
||||
create_png Create a png of the file
|
||||
NEEDED_CHILDREN_MODULES The path of NEEDED_CHILDREN_MODULES
|
||||
by default try to open the file in the current path
|
||||
"""
|
||||
|
||||
from docopt import docopt
|
||||
@ -73,8 +75,9 @@ def module_genealogy(path):
|
||||
try:
|
||||
with open(path, "r") as f:
|
||||
l_children = f.read().split()
|
||||
except IOError:
|
||||
return []
|
||||
except IOError as e:
|
||||
print >> sys.stderr, e
|
||||
sys.exit(1)
|
||||
else:
|
||||
|
||||
needed_module = get_it_and_children(l_children)
|
||||
@ -169,6 +172,7 @@ def create_png(l_module):
|
||||
|
||||
# Save
|
||||
path = '{0}.png'.format("_".join(l_module))
|
||||
print "png saved in {0}".format(path)
|
||||
graph.write_png(path)
|
||||
|
||||
if __name__ == '__main__':
|
||||
@ -187,5 +191,12 @@ if __name__ == '__main__':
|
||||
l_all_needed_molule = module_genealogy(path)
|
||||
print " ".join(sorted(l_all_needed_molule))
|
||||
|
||||
if arguments["create_png"]:
|
||||
elif arguments["check_dependencies"]:
|
||||
l_module = arguments['<module_name>']
|
||||
if l_module:
|
||||
l_all_needed_molule = get_it_and_children(l_module)
|
||||
else:
|
||||
l_all_needed_molule = module_genealogy(path)
|
||||
|
||||
elif arguments["create_png"]:
|
||||
create_png_from_path(path)
|
||||
|
@ -14,7 +14,7 @@ check_current_dir_is_module
|
||||
|
||||
# Check if the NEEDED_MODULES file is consistent
|
||||
INCLUDE_DIRS="${NEEDED_MODULES} include"
|
||||
NEEDED_MODULES_OK=$( ${QPACKAGE_ROOT}/scripts/check_dependencies.sh ${NEEDED_MODULES} )
|
||||
NEEDED_MODULES_OK=$(module_handler.py check_dependencies ${NEEDED_MODULES} )
|
||||
if [[ $? -ne 0 ]]
|
||||
then
|
||||
error "
|
||||
|
@ -1 +1 @@
|
||||
AOs Bielec_integrals Bitmask CID CID_SC2_selected CID_selected CIS CISD CISD_selected CISD_SC2_selected Determinants Electrons Ezfio_files Full_CI Generators_full Hartree_Fock MOGuess MonoInts MOs MP2 Nuclei Output Selectors_full Utils Molden FCIdump Generators_CAS CAS_SD DDCI_selected MRCC Pseudo_integrals
|
||||
AOs Bielec_integrals Bitmask CAS_SD CID CID_SC2_selected CID_selected CIS CISD CISD_SC2_selected CISD_selected DDCI_selected Determinants Electrons Ezfio_files FCIdump Full_CI Generators_CAS Generators_full Hartree_Fock MOGuess MOs MP2 MRCC Molden MonoInts Nuclei Output Perturbation Properties Pseudo_integrals Selectors_full SingleRefMethod Utils Toto
|
||||
|
Loading…
Reference in New Issue
Block a user