-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0184a7
commit aada201
Showing
4 changed files
with
48 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,23 @@ | ||
import cctk | ||
import cctk, sys, yaml, tqdm | ||
|
||
ensemble = cctk.GaussianFile.read_file("test/static/gaussian_file.out").ensemble | ||
si_file = cctk.SIFile(ensemble, ["title"] * len(ensemble)) | ||
# usage: python generate_si.py config.txt output.txt | ||
# config should be tab-separated list of titles and filenames | ||
|
||
si_file.write_file("si.txt") | ||
ensemble = cctk.Ensemble() | ||
titles = list() | ||
|
||
with open(sys.argv[1], "r+") as f: | ||
for line in tqdm.tqdm(f.readlines()): | ||
try: | ||
title, path = line.rsplit(' ', 1) | ||
gf = cctk.GaussianFile.read_file(path.strip()) | ||
m, p = gf.get_molecule(properties=True) | ||
p["route_card"] = gf.route_card | ||
p["imaginaries"] = gf.imaginaries() | ||
ensemble.add_molecule(m, p) | ||
titles.append(title.strip()) | ||
except Exception as e: | ||
print(f"skipping {line} - error {e}") | ||
|
||
si_file = cctk.SIFile(ensemble, titles) | ||
si_file.write_file(sys.argv[2]) |