Skip to content

Commit

Permalink
Kinbot Update
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinp0 committed Nov 26, 2023
1 parent 98c2269 commit bcb2724
Show file tree
Hide file tree
Showing 4 changed files with 647 additions and 12 deletions.
19 changes: 13 additions & 6 deletions arc/job/adapters/scripts/kinbot_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,25 @@ def save_yaml_file(path: str,
f.write(yaml_str)

def save_output_file(path,
key = None,
val = None,
content_dict = None,
key=None,
val=None,
content_dict=None,
):
"""
Save the output of a job to the YAML output file.
Args:
path (str): The base directory path where the YAML file should be saved.
key (str, optional): The key for the YAML output file.
val (Union[float, dict, np.ndarray], optional): The value to be stored.
content_dict (dict, optional): A dictionary to store.
"""
yml_out_path = os.path.join(path, 'output.yml')
# Extract the directory from the path
directory = os.path.dirname(path)

# Append 'output.yml' to this directory
yml_out_path = os.path.join(directory, 'output.yml')

# Rest of the code remains the same...
content = read_yaml_file(yml_out_path) if os.path.isfile(yml_out_path) else dict()
if content_dict is not None:
content.update(content_dict)
Expand All @@ -147,7 +154,7 @@ def generate_coords(path: str, reaction_generator = None):
for r, kinbot_rxn in enumerate(reaction_generator.species.reac_obj):
step, fix, change, release = kinbot_rxn.get_constraints(step=20,
geom=kinbot_rxn.species.geom)


dict_files[str(kinbot_rxn.instance_name)] = {}

Expand Down Expand Up @@ -197,7 +204,7 @@ def main():
input_file = args.yml_path
print(input_file)
#project_directory = os.path.abspath(os.path.dirname(args.file))
file = read_yaml_file(os.path.join(str(args.yml_path), "input.yml"))
file = read_yaml_file(os.path.join(str(args.yml_path)))
input_dict = dict(file[0])
#if 'project' not in list(input_dict.keys()):
# raise ValueError('A project name must be provided!')
Expand Down
6 changes: 3 additions & 3 deletions arc/job/adapters/ts/kinbot_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def write_input_file(self,
"""
Write the input file to execute the job on the server.
"""
content = [{'mol':mol,
content = [{'mol':mol,
'families': families,
'kinbot_xyz': kinbot_xyz,
'multiplicity': multiplicity,
Expand Down Expand Up @@ -239,7 +239,7 @@ def execute_incore(self):
#self.input_file_path = str(self.local_path) + '/input.yml'
commands = ['source ~/.bashrc',
f'{KINBOT_PYTHON} {KINBOT_SCRIPT_PATH} '
f' {self.local_path}']
f' {self.local_path} + /input.yml']
command = '; '.join(commands)
output = subprocess.run(command, shell=True, executable='/bin/bash')

Expand All @@ -252,7 +252,7 @@ def execute_incore(self):
for i in range(len(output)):

temp_output = output[list(output.keys())[i]]
ts_guess = TSGuess(method=f'KinBot',
ts_guess = TSGuess(method='KinBot',
method_direction=method_direction,
method_index=method_index,
index=len(rxn.ts_species.ts_guesses),
Expand Down
Loading

0 comments on commit bcb2724

Please sign in to comment.