diff --git a/src/test1.py b/src/test1.py index bbe4d20..f5a1f5b 100644 --- a/src/test1.py +++ b/src/test1.py @@ -1,16 +1,20 @@ - import sys import ase import toml from neb_wrapper import run_neb_method -if __name__ == "__main__": - with open(sys.argv[1], 'r') as f: +def main(config_file: str) -> None: + """ + Run NEB method using the provided configuration file. + + Args: + config_file (str): Path to the configuration file. + """ + with open(config_file, 'r') as f: inputs = toml.load(f) input_sets = inputs['input_sets'] - logdir = inputs['input_paths']['logdir'] for input_set in input_sets: optimizer_name = input_set['optimizer'] @@ -28,3 +32,11 @@ N_intermediate=inputs['geodesic_inputs']['N_intermediate'], ) + +if __name__ == "__main__": + if len(sys.argv) != 2: + print("Usage: python script.py config_file.toml") + sys.exit(1) + + config_file = sys.argv[1] + main(config_file)