Skip to content

Commit

Permalink
Merge pull request #43 from RECETOX/wverastegui/issue40
Browse files Browse the repository at this point in the history
Updated load_template function calling and read_coordinates ()
  • Loading branch information
hechth authored Nov 13, 2024
2 parents a68517a + 2ffd3ef commit ce11773
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
13 changes: 9 additions & 4 deletions codes/extract_coords_into_inp_xyz.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import os


PBS_TEMPLATE = load_template("templates", "optimization_gamess_template.pbs")
INP_TEMPLATE = load_template("templates", "gamess_input_template.inp")
XYZ_TEMPLATE = load_template("templates", "structure_input_template.xyz")
PBS_TEMPLATE = load_template("optimization_gamess_template.pbs")
INP_TEMPLATE = load_template("gamess_input_template.inp")
XYZ_TEMPLATE = load_template("structure_input_template.xyz")


def coords_as_dataframe(element_symbol: List[str], x_coord: List[str], y_coord: List[str], z_coord: List[str]) -> pd.DataFrame:
Expand Down Expand Up @@ -48,7 +48,12 @@ def read_coordinates(n_atoms: int, gamess_output: List[str], line_number: int) -
"""
start, end = compute_start_end_indices(n_atoms, line_number, 4)
data = [line.split() for line in gamess_output[start:end]]
element_symbol, x_coord, y_coord, z_coord = zip(*data)

element_symbol = [line[0] for line in data]
x_coord = [line[2] for line in data]
y_coord = [line[3] for line in data]
z_coord = [line[4] for line in data]

return element_symbol, x_coord, y_coord, z_coord


Expand Down
8 changes: 4 additions & 4 deletions codes/write_dirs_files_for_gamess_qcxms.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,13 @@ def write_gamess_input(multiplicity: int, mol: object, molname: str, mol_input_p
write_gamess_input(multiplicity, mol, molname, mol_input_path)

spectrum_input_path = spectra_dir / ("qcxms" + ".in")
qcxms_template = load_template("templates", "qcxms_input_template.in")
template = load_template("qcxms_input_template.in")
if not Path(spectrum_input_path).exists():
qcxms_params = read_parameters(args.params_filename, ["QC_Program", "QC_Level", "ntraj", "tmax", "tinit", "ieeatm"])
write_from_template(parameters=qcxms_params, template=qcxms_template, file=spectrum_input_path)
write_from_template(parameters=qcxms_params, template=template, file=spectrum_input_path)

mol_pbs_path = mol_dir / (inchikey + ".pbs")
pbs_template = load_template("templates", "optimization_gamess_template.pbs")
template = load_template("optimization_gamess_template.pbs")
if not Path(mol_pbs_path).exists():
pbs_params = read_parameters(args.params_filename, ["WALLTIME", "NCPUS", "MEM", "SCRATCH_LOCAL", "USER_EMAIL"])
write_from_template(parameters={"MOLNAME": inchikey, **pbs_params}, template=pbs_template, file=mol_pbs_path)
write_from_template(parameters={"MOLNAME": inchikey, **pbs_params}, template=template, file=mol_pbs_path)

0 comments on commit ce11773

Please sign in to comment.