diff --git a/scripts/compilation/qp_create_ninja.py b/scripts/compilation/qp_create_ninja.py index 545c75c0..0c4a2e4c 100755 --- a/scripts/compilation/qp_create_ninja.py +++ b/scripts/compilation/qp_create_ninja.py @@ -474,21 +474,27 @@ def ninja_readme_rule(): For not dealted the readme when ninja -t clean and the generator option """ l_string = ["rule build_readme", - " command = cd $module_abs ; update_README.py", + " command = cd $module_abs ; update_README.py $module_root", " generator = 1", ""] return l_string -def ninja_readme_build(path_module): +def ninja_readme_build(path_module, d_irp): """ Rule for creation the readme """ - path_irp_man = join(path_module.abs, "irpf90.make") + + dict_root = module_instance.dict_root + dict_root_module_path = dict_module_genelogy_path(dict_root) + root_module = dict_root_module_path[module] + + l_depend = d_irp[path_module]["l_depend"] path_readme = join(path_module.abs, "README.rst") l_string = ["build {0}: build_readme {1}".format(path_readme, - path_irp_man), + " ".join(l_depend)), + " module_root = {0}".format(root_module.abs), " module_abs = {0}".format(path_module.abs), " module_rel = {0}".format(path_module.rel), ""] @@ -533,7 +539,7 @@ def get_dict_binaries(l_module, mode="production"): Example : The module Full_CI can produce the binary SCF so you dont need to compile at all the module Hartree-Fock - But you need to change the path acordingle + But you need to change the path acordingly Full_CI/Hartree-Fock/SCF """ d_binaries = defaultdict(list) @@ -824,6 +830,7 @@ if __name__ == "__main__": # d o t _ t r e e & r e a d m e # # ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ # l_string += ninja_dot_tree_build(module, l_module) + l_string += ninja_readme_build(module, d_irp) # ~#~#~#~#~#~#~#~#~#~#~#~#~ # # M o d u l e _ t o _ i r p # @@ -860,8 +867,6 @@ if __name__ == "__main__": l_string += ninja_irpf90_make_build(module_to_compile, l_children, d_irp) - l_string += ninja_readme_build(module_to_compile) - l_string += ninja_binaries_build(module_to_compile, l_children, d_binaries) diff --git a/scripts/module/update_README.py b/scripts/module/update_README.py index 1293f6f2..b55c932a 100755 --- a/scripts/module/update_README.py +++ b/scripts/module/update_README.py @@ -13,6 +13,26 @@ URL = "http://github.com/LCPQ/quantum_package/tree/master/src/" import os import subprocess from collections import namedtuple +import sys + +""" +NEED to call in a module +First arg can be the root parent +""" +try: + ROOT_module = os.path.realpath(sys.argv[1]) +except: + ROOT_module = os.getcwd() + +if ROOT_module != os.getcwd: + change = True +else: + change = False + +MODULE_NAME = os.path.basename(os.getcwd()) + +print MODULE_NAME +print ROOT_module header = """ .. Do not edit this section. It was auto-generated from the @@ -71,7 +91,8 @@ def update_needed(data): def extract_doc(item): """Extracts the documentation contained in IRPF90_man file""" - with open("IRPF90_man/%s.l" % (item), 'r') as f: + path = os.path.join(ROOT_module, "IRPF90_man/%s.l" % (item)) + with open(path, 'r') as f: l_line = f.readlines() result = [] @@ -97,15 +118,24 @@ def update_documentation(data): # If the file does not exist, don't do anything - with open('tags', 'r') as f: - l_info = [IRP_info(*i.split()) for i in f.readlines() - if "/" not in i.split()[1]] + path = os.path.join(ROOT_module, "tags") + + with open(path, 'r') as f: + dump = f.readlines() + + l_info = [] + for i in dump: + name, f, ligne = i.split() + + if not change and "/" not in i: + l_info.append(IRP_info(name, f, ligne)) + elif change and MODULE_NAME in i: + l_info.append(IRP_info(name, f.split("/")[-1], ligne)) l_line = [] - module_name = os.path.basename(os.getcwd()) for irp in l_info: - url = os.path.join(URL, module_name, irp.file) + url = os.path.join(URL, MODULE_NAME, irp.file) doc = extract_doc(irp.name) l_line += ["`{0} <{1}#L{2}>`_".format(irp.name, url, irp.line), doc, diff --git a/src/AO_Basis/README.rst b/src/AO_Basis/README.rst index a2f39f8d..da1ba1dc 100644 --- a/src/AO_Basis/README.rst +++ b/src/AO_Basis/README.rst @@ -46,135 +46,135 @@ Documentation .. Do not edit this section. It was auto-generated from the .. by the `update_README.py` script. -`ao_coef `_ +`ao_coef `_ AO Coefficients, read from input. Those should not be used directly, as the MOs are expressed on the basis of **normalized** AOs. -`ao_coef_normalized `_ +`ao_coef_normalized `_ Coefficients including the AO normalization -`ao_coef_normalized_ordered `_ +`ao_coef_normalized_ordered `_ Sorted primitives to accelerate 4 index MO transformation -`ao_coef_normalized_ordered_transp `_ +`ao_coef_normalized_ordered_transp `_ Transposed ao_coef_normalized_ordered -`ao_expo `_ +`ao_expo `_ AO Exponents read from input -`ao_expo_ordered `_ +`ao_expo_ordered `_ Sorted primitives to accelerate 4 index MO transformation -`ao_expo_ordered_transp `_ +`ao_expo_ordered_transp `_ Transposed ao_expo_ordered -`ao_l `_ +`ao_l `_ ao_l = l value of the AO: a+b+c in x^a y^b z^c -`ao_l_char `_ +`ao_l_char `_ ao_l = l value of the AO: a+b+c in x^a y^b z^c -`ao_l_char_space `_ +`ao_l_char_space `_ Undocumented -`ao_md5 `_ +`ao_md5 `_ MD5 key characteristic of the AO basis -`ao_nucl `_ +`ao_nucl `_ Index of the nuclei on which the ao is centered -`ao_num `_ +`ao_num `_ Number of atomic orbitals -`ao_num_align `_ +`ao_num_align `_ Number of atomic orbitals -`ao_overlap `_ +`ao_overlap `_ Overlap between atomic basis functions: :math:`\int \chi_i(r) \chi_j(r) dr)` -`ao_overlap_abs `_ +`ao_overlap_abs `_ Overlap between absolute value of atomic basis functions: :math:`\int |\chi_i(r)| |\chi_j(r)| dr)` -`ao_overlap_x `_ +`ao_overlap_x `_ Overlap between atomic basis functions: :math:`\int \chi_i(r) \chi_j(r) dr)` -`ao_overlap_y `_ +`ao_overlap_y `_ Overlap between atomic basis functions: :math:`\int \chi_i(r) \chi_j(r) dr)` -`ao_overlap_z `_ +`ao_overlap_z `_ Overlap between atomic basis functions: :math:`\int \chi_i(r) \chi_j(r) dr)` -`ao_power `_ +`ao_power `_ Powers of x,y and z read from input -`ao_prim_num `_ +`ao_prim_num `_ Number of primitives per atomic orbital -`ao_prim_num_max `_ +`ao_prim_num_max `_ Undocumented -`ao_prim_num_max_align `_ +`ao_prim_num_max_align `_ Undocumented -`l_to_charater `_ +`l_to_charater `_ character corresponding to the "L" value of an AO orbital -`n_aos_max `_ +`n_aos_max `_ Number of AOs per atom -`n_pt_max_i_x `_ +`n_pt_max_i_x `_ Undocumented -`n_pt_max_integrals `_ +`n_pt_max_integrals `_ Undocumented -`nucl_aos `_ +`nucl_aos `_ List of AOs attached on each atom -`nucl_list_shell_aos `_ +`nucl_list_shell_aos `_ Index of the shell type Aos and of the corresponding Aos Per convention, for P,D,F and G AOs, we take the index of the AO with the the corresponding power in the "X" axis -`nucl_n_aos `_ +`nucl_n_aos `_ Number of AOs per atom -`nucl_num_shell_aos `_ +`nucl_num_shell_aos `_ Index of the shell type Aos and of the corresponding Aos Per convention, for P,D,F and G AOs, we take the index of the AO with the the corresponding power in the "X" axis diff --git a/src/Bitmask/README.rst b/src/Bitmask/README.rst index ae339939..f8d44248 100644 --- a/src/Bitmask/README.rst +++ b/src/Bitmask/README.rst @@ -42,7 +42,7 @@ Needed Modules .. image:: tree_dependency.png -* `MOs `_ +* `MO_Basis `_ Documentation ============= diff --git a/src/MO_Basis/README.rst b/src/MO_Basis/README.rst index 784ac176..5cbe0165 100644 --- a/src/MO_Basis/README.rst +++ b/src/MO_Basis/README.rst @@ -38,7 +38,7 @@ Needed Modules .. image:: tree_dependency.png -* `AOs `_ +* `AO_Basis `_ * `Electrons `_ Documentation @@ -47,16 +47,16 @@ Documentation .. Do not edit this section. It was auto-generated from the .. by the `update_README.py` script. -`ao_to_mo `_ +`ao_to_mo `_ Transform A from the AO basis to the MO basis -`cholesky_mo `_ +`cholesky_mo `_ Cholesky decomposition of AO Density matrix to generate MOs -`mix_mo_jk `_ +`mix_mo_jk `_ subroutine that rotates the jth MO with the kth MO to give two new MO's that are '+' = 1/sqrt(2) (|j> + |k>) @@ -65,70 +65,70 @@ Documentation by convention, the '-' MO is in the greater index (max(j,k)) -`mo_as_eigvectors_of_mo_matrix `_ +`mo_as_eigvectors_of_mo_matrix `_ Undocumented -`mo_as_eigvectors_of_mo_matrix_sort_by_observable `_ +`mo_as_eigvectors_of_mo_matrix_sort_by_observable `_ Undocumented -`mo_coef `_ +`mo_coef `_ Molecular orbital coefficients on AO basis set mo_coef(i,j) = coefficient of the ith ao on the jth mo mo_label : Label characterizing the MOS (local, canonical, natural, etc) -`mo_coef_transp `_ +`mo_coef_transp `_ Molecular orbital coefficients on AO basis set -`mo_density_matrix `_ +`mo_density_matrix `_ Density matrix in MO basis -`mo_density_matrix_virtual `_ +`mo_density_matrix_virtual `_ Density matrix in MO basis (virtual MOs) -`mo_label `_ +`mo_label `_ Molecular orbital coefficients on AO basis set mo_coef(i,j) = coefficient of the ith ao on the jth mo mo_label : Label characterizing the MOS (local, canonical, natural, etc) -`mo_occ `_ +`mo_occ `_ MO occupation numbers -`mo_overlap `_ +`mo_overlap `_ Undocumented -`mo_sort_by_observable `_ +`mo_sort_by_observable `_ Undocumented -`mo_to_ao `_ +`mo_to_ao `_ Transform A from the MO basis to the AO basis -`mo_to_ao_no_overlap `_ +`mo_to_ao_no_overlap `_ Transform A from the MO basis to the S^-1 AO basis -`mo_tot_num `_ +`mo_tot_num `_ Total number of molecular orbitals and the size of the keys corresponding -`mo_tot_num_align `_ +`mo_tot_num_align `_ Aligned variable for dimensioning of arrays -`s_mo_coef `_ +`s_mo_coef `_ Product S.C where S is the overlap matrix in the AO basis and C the mo_coef matrix. -`save_mos `_ +`save_mos `_ Undocumented diff --git a/src/Nuclei/README.rst b/src/Nuclei/README.rst index e96fd490..9f0b15d9 100644 --- a/src/Nuclei/README.rst +++ b/src/Nuclei/README.rst @@ -23,68 +23,68 @@ Documentation .. Do not edit this section. It was auto-generated from the .. by the `update_README.py` script. -`element_name `_ +`element_name `_ Array of the name of element, sorted by nuclear charge (integer) -`nucl_charge `_ +`nucl_charge `_ Nuclear charges -`nucl_coord `_ +`nucl_coord `_ Nuclear coordinates in the format (:, {x,y,z}) -`nucl_coord_transp `_ +`nucl_coord_transp `_ Transposed array of nucl_coord -`nucl_dist `_ +`nucl_dist `_ nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors -`nucl_dist_2 `_ +`nucl_dist_2 `_ nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors -`nucl_dist_vec_x `_ +`nucl_dist_vec_x `_ nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors -`nucl_dist_vec_y `_ +`nucl_dist_vec_y `_ nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors -`nucl_dist_vec_z `_ +`nucl_dist_vec_z `_ nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors -`nucl_label `_ +`nucl_label `_ Nuclear labels -`nucl_num `_ +`nucl_num `_ Number of nuclei -`nucl_num_aligned `_ - Number of nuclei +`nucl_num_aligned `_ + Number of nuclei algined -`nuclear_repulsion `_ +`nuclear_repulsion `_ Nuclear repulsion energy -`positive_charge_barycentre `_ +`positive_charge_barycentre `_ Centroid of the positive charges