Skip to content

Commit

Permalink
Merge pull request #71 from TheoChem-VU/69-read-general-orca-data-suc…
Browse files Browse the repository at this point in the history
…h-as-file-structure-input-settings-version-etc

69 read general orca data such as file structure input settings version etc
  • Loading branch information
SiebeLeDe authored Jan 2, 2024
2 parents 3d9714a + d78a0f0 commit 1805418
Show file tree
Hide file tree
Showing 14 changed files with 45,134 additions and 2 deletions.
24 changes: 22 additions & 2 deletions TCutility/results/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,22 @@
from . import result
Result = result.Result

from . import adf, dftb, ams, cache # noqa: E402
from . import adf, dftb, ams, orca, cache # noqa: E402
import os # noqa: E402


def get_info(calc_dir: str):
try:
return ams.get_ams_info(calc_dir)
except: # noqa
pass

try:
return orca.get_info(calc_dir)
except: # noqa
raise


def read(calc_dir: str) -> Result:
'''Master function for reading data from calculations. It reads general information as well as engine-specific information.
Expand All @@ -25,16 +37,24 @@ def read(calc_dir: str) -> Result:
dictionary containing information about the calculation
'''
ret = Result()
ret.update(ams.get_ams_info(calc_dir))
ret.update(get_info(calc_dir))
if ret.engine == 'adf':
ret.adf = adf.get_calc_settings(ret)
ret.properties = adf.get_properties(ret)
ret.level = adf.get_level_of_theory(ret)
elif ret.engine == 'dftb':
ret.dftb = dftb.get_calc_settings(ret)
ret.properties = dftb.get_properties(ret)
elif ret.engine == 'orca':
ret.orca = orca.get_calc_settings(ret)
ret.properties = orca.get_properties(ret)

# unload cached KFReaders associated with this calc_dir
to_delete = [key for key in cache._cache if key.startswith(os.path.abspath(calc_dir))]
[cache.unload(key) for key in to_delete]
return ret


if __name__ == '__main__':
res = read('/Users/yumanhordijk/Library/CloudStorage/OneDrive-VrijeUniversiteitAmsterdam/RadicalAdditionBenchmark/data/abinitio/P_C2H2_NH2/OPT_pVTZ')
print(res.molecule)
Loading

0 comments on commit 1805418

Please sign in to comment.