Skip to content

Commit

Permalink
cleanup includes amat.tmp files (#9)
Browse files Browse the repository at this point in the history
* cleanup_all removes amat.tmp files which can be quiet large (several Mb)
* update README
  • Loading branch information
fabothch authored Mar 15, 2021
1 parent 40f38ee commit 8eee434
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 16 deletions.
21 changes: 19 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
|GitHub release|
|GitHub release| |DOI|

.. |GitHub release| image:: https://img.shields.io/github/v/release/grimme-lab/CENSO
:target: https://github.com/grimme-lab/CENSO/releases/latest

.. |DOI| image:: https://img.shields.io/badge/DOI-10.1021/acs.jpca.1c00971-blue
:target: https://doi.org/10.1021/acs.jpca.1c00971


====================================================================
CENSO - Commandline ENergetic SOrting of Conformer Rotamer Ensembles
====================================================================
Expand Down Expand Up @@ -78,7 +82,7 @@ settings and provide paths to the external programs e.g. `xtb`, `crest`, `orca`
Documentation:
==============

Can be found following: https://fbohle.gitbook.io/censo/
Can be found following: https://xtb-docs.readthedocs.io/en/latest/CENSO_docs/censo.html

**Interactive Documentation can be accessed:**

Expand Down Expand Up @@ -205,6 +209,19 @@ a replacement solvent. E.g. if CCl4 is not available choose CHCl3.
The solvent file is directly used in `CENSO` and typos will cause calculations to crash!
Adding a new solvent is as easy as adding a new dictionary to the file.

Cite
----

General reference:

S. Grimme, F. Bohle, A. Hansen, P. Pracht, S. Spicher, and M. Stahn
*J. Phys. Chem. A* **2021**, XXXX, XXX, XXX-XXX.

DOI: `10.1021/acs.jpca.1c00971 <https://doi.org/10.1021/acs.jpca.1c00971>`_.

Reference is available in `bibtex format <./docs/reference.bib>`_.


License
-------

Expand Down
14 changes: 7 additions & 7 deletions censo_qm/censo.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,41 +200,41 @@ def main(argv=None):
print(f"{'Input':20}: {ensembledata.nconfs_per_part['starting']:{conflength}} -")
if config.part0:
print(
f"{'Part0_all':20}: {ensembledata.nconfs_per_part['part0']:{conflength}} {ensembledata.part_info['part0']:.2f}s"
f"{'Part0_all':20}: {ensembledata.nconfs_per_part['part0']:{conflength}} {ensembledata.part_info['part0']:.2f} s"
)
timings += ensembledata.part_info["part0"]
if config.part1:
print(
f"{'Part1_initial_sort':20}: {ensembledata.nconfs_per_part['part1_firstsort']:{conflength}} -"
)
print(
f"{'Part1_all':20}: {ensembledata.nconfs_per_part['part1_firstsort']:{conflength}} {ensembledata.part_info['part1']:.2f}s"
f"{'Part1_all':20}: {ensembledata.nconfs_per_part['part1_firstsort']:{conflength}} {ensembledata.part_info['part1']:.2f} s"
)
timings += ensembledata.part_info["part1"]
if config.part2:
print(
f"{'Part2_opt':20}: {ensembledata.nconfs_per_part['part2_opt']:{conflength}} -"
)
print(
f"{'Part2_all':20}: {ensembledata.nconfs_per_part['part2']:{conflength}} {ensembledata.part_info['part2']:.2f}s"
f"{'Part2_all':20}: {ensembledata.nconfs_per_part['part2']:{conflength}} {ensembledata.part_info['part2']:.2f} s"
)
timings += ensembledata.part_info["part2"]
if config.part3:
print(
f"{'Part3_all':20}: {ensembledata.nconfs_per_part['part3']:{conflength}} {ensembledata.part_info['part3']:.2f}s"
f"{'Part3_all':20}: {ensembledata.nconfs_per_part['part3']:{conflength}} {ensembledata.part_info['part3']:.2f} s"
)
timings += ensembledata.part_info["part3"]
if config.part4:
print(
f"{'Part4':20}: {'':{conflength}} {ensembledata.part_info['part4']:.2f}s"
f"{'Part4':20}: {'':{conflength}} {ensembledata.part_info['part4']:.2f} s"
)
timings += ensembledata.part_info["part4"]
if config.optical_rotation:
print(
f"{'Part5':20}: {'':{conflength}} {ensembledata.part_info['part5']:.2f}s"
f"{'Part5':20}: {'':{conflength}} {ensembledata.part_info['part5']:.2f} s"
)
timings += ensembledata.part_info["part5"]
print("".ljust(int(PLENGTH / 2), "-"))
print(f"{'All parts':20}: {'':{conflength}} {timings:.2f}s")
print(f"{'All parts':20}: {'':{conflength}} {timings:.2f} s")
print("\nCENSO all done!")
return 0
7 changes: 6 additions & 1 deletion censo_qm/cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""
import os

__version__ = "1.0.6"
__version__ = "1.0.7"

DESCR = f"""
______________________________________________________________
Expand All @@ -20,6 +20,11 @@
| F. Bohle and S. Grimme |
| |
|______________________________________________________________|
Please cite:
S. Grimme, F. Bohle, A. Hansen, P. Pracht, S. Spicher, and M. Stahn
J. Phys. Chem. A 2021, XXXX, XXX, XXX-XXX.
DOI: https://doi.org/10.1021/acs.jpca.1c00971
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
Expand Down
21 changes: 16 additions & 5 deletions censo_qm/inputhandling.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import time
import math
import sys
import glob
from copy import deepcopy
from collections import OrderedDict
from .cfg import (
Expand Down Expand Up @@ -1760,6 +1761,11 @@ def __init__(self):
"func3":False,
"basis3":False,
# "consider_sym": False, # --> reset all rrho values!
# funcJ
# basisJ
# funcS
# basisS
# sm4_ j s
}


Expand Down Expand Up @@ -1914,11 +1920,16 @@ def cleanup_run(self, complete=False):
if os.path.isdir(os.path.join(self.cwd, "conformer_rotamer_check")):
print("Removing conformer_rotamer_check")
shutil.rmtree(os.path.join(self.cwd, "conformer_rotamer_check"))
# for file in files_in_cwd:
# if 'mat.tmp' in file:
# print(f"Removing: {file}")
# os.remove(os.path.join(self.cwd,file))
# remove *mat.tmp files
# get files like amat.tmp from COSMO calculation (can be several Mb)
files_in_sub_cwd = glob.glob(self.cwd + '/**/**/**/*mat.tmp', recursive=True)
size = 0
for tmpfile in files_in_sub_cwd:
if any(x in tmpfile for x in ['a3mat.tmp', 'a2mat.tmp', 'amat.tmp']):
if os.path.isfile(tmpfile):
size += os.path.getsize(tmpfile)
#print(f"Removing {tmpfile} {os.path.getsize(tmpfile)} byte")
os.remove(tmpfile)
print(f"Removed {size/1024} Mb")
# ask if CONF folders should be removed

def get_method_name(
Expand Down
3 changes: 2 additions & 1 deletion censo_qm/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@ def run_in_parallel(
# put item on queue
q.put(item)
time.sleep(0.02)
njobs = q.qsize()
time.sleep(0.02)
if changed:
ENVIRON['PARNODES'] = str(omp)
njobs = q.qsize()

if instructdict.get("onlyread", False):
print(f"\nReading data from {njobs} conformers calculated in previous run.")
else:
Expand Down
13 changes: 13 additions & 0 deletions docs/reference.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@article{doi:10.1021/acs.jpca.1c00971,
author = {Grimme, Stefan and Bohle, Fabian and Hansen, Andreas and Pracht, Philipp and Spicher, Sebastian and Stahn, Marcel},
title = {Efficient Quantum Chemical Calculation of Structure Ensembles and Free Energies for Nonrigid Molecules},
journal = {The Journal of Physical Chemistry A},
volume = {0},
number = {0},
pages = {null},
year = {0},
doi = {10.1021/acs.jpca.1c00971},
note ={PMID: 33688730},
URL = {https://doi.org/10.1021/acs.jpca.1c00971},
eprint = {https://doi.org/10.1021/acs.jpca.1c00971}
}

0 comments on commit 8eee434

Please sign in to comment.