Skip to content

Commit

Permalink
Auto stash before merge of "main" and "origin/main"
Browse files Browse the repository at this point in the history
Did a lot of restructuring.
  • Loading branch information
kumaranu committed May 17, 2024
1 parent 6d05583 commit dfeb6bd
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 122 deletions.
Empty file added src/__init__.py
Empty file.
37 changes: 0 additions & 37 deletions src/calc_properties.py

This file was deleted.

11 changes: 0 additions & 11 deletions src/calcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,3 @@ def calc():
device=device
)
return mlcalculator

'''
h2 = Atoms(numbers=[1, 1], positions=[[0.0, 0.0, 0.0], [0.0, 0.0, 1.0]])
mlcalculator.calculate(h2)
print(mlcalculator.results['energy']) # mean of calculated molecular energies, shape (1,)
print(mlcalculator.results['forces']) # mean of calculated atomic forces, shape (n_atom, 3)
print(mlcalculator.results['hessian']) # mean of calculated atomic Hessian, shape (n_atom, 3, n_atom, 3)
print(mlcalculator.results['energy_disagreement']) # disagreement among calculated molecular
'''

43 changes: 0 additions & 43 deletions src/calcs1.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/check_graph_iso.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pymatgen.analysis.graphs import MoleculeGraph
from pymatgen.analysis.local_env import OpenBabelNN
from networkx.algorithms.graph_hashing import weisfeiler_lehman_graph_hash
from plot2 import gen_energy_profile
from src.mep_tests.tools.plot2 import gen_energy_profile


def add_specie_suffix(graph):
Expand Down
3 changes: 1 addition & 2 deletions src/check_neb_results.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import glob, os, sys
from ase.io import read
from calcs1 import calc
from calcs import calc
import numpy as np
from ase import Atoms
from multiprocessing import Pool
Expand Down Expand Up @@ -79,4 +79,3 @@ def process_file(i):
for result in results:
if result is not None:
print(result)

1 change: 0 additions & 1 deletion src/initialize_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,3 @@ def setup_analysis(

print(f'Forward_barrier: {ts_e - r_e}')
print(f'Reverse_barrier: {ts_e - p_e}')

Empty file added src/mep_tests/tools/__init__.py
Empty file.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
print(f'{i:03}: {INF[-1].split()[1]}')
else:
print(f'{i:03}: No NEB file.')
os.chdir('../')
os.chdir('../../../')
else:
print(f'{i:03} does not exist.')

File renamed without changes.
File renamed without changes.
File renamed without changes.
51 changes: 29 additions & 22 deletions src/plot2.py → src/mep_tests/tools/plot2.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,33 @@ def gen_energy_profile(
# if len(sys.argv) != 3:
# print("Usage: python script.py <xyz_file1> <xyz_file2>")
# sys.exit(1)
ref_dir = '/home/kumaranu/Downloads/neb_nn_inputs'
index = '001'
geodesic_xyz = os.path.join(
ref_dir,
index,
'geodesic_path.xyz',
)
neb_path_xyz = os.path.join(
ref_dir,
index,
'optimized_path_aseneb_NEBOptimizer_None.xyz'
)
ts_xyz = os.path.join(
ref_dir,
index,
'TS.xyz',
)
#ref_dir = '/home/kumaranu/Downloads/neb_nn_inputs'
#index = '001'
ref_dir = '/home/kumaranu/Downloads/neb_rgd1_inputs'
for i in range(999):
index = f'{i:03}'
# index = '679'
try:
geodesic_xyz = os.path.join(
ref_dir,
index,
'geodesic_path.xyz',
)
neb_path_xyz = os.path.join(
ref_dir,
index,
'optimized_path_aseneb_NEBOptimizer_None.xyz'
)
ts_xyz = os.path.join(
ref_dir,
index,
'TS.xyz',
)

barrier_err = gen_energy_profile(
geodesic_xyz,
neb_path_xyz,
ts_xyz,
)
barrier_err = gen_energy_profile(
geodesic_xyz,
neb_path_xyz,
ts_xyz,
)
except:
continue
2 changes: 0 additions & 2 deletions src/setup_images.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import copy
from calcs import calc
from ase.io import read, write
from typing import Any, Dict, Iterator, List, Sequence, Tuple, TypeVar, Union
Expand Down Expand Up @@ -40,4 +39,3 @@ def setup_images(
write('geodesic_path.xyz', images)

return images

4 changes: 2 additions & 2 deletions src/test1.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ def main(config_file: str) -> None:
run_neb_method(
method=input_set['method'],
optimizer=ase_optimizer,
opt_method=None,
precon=None,
optmethod=None,
logdir=inputs['input_paths']['logdir'],
xyz_r_p=inputs['input_paths']['xyz_r_p'],
xyz_ts=inputs['input_paths']['xyz_ts'],
N_intermediate=inputs['geodesic_inputs']['N_intermediate'],
n_intermediate=inputs['geodesic_inputs']['N_intermediate'],
)


Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit dfeb6bd

Please sign in to comment.