Skip to content

Commit

Permalink
1. LGTM fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jvalegre committed Jan 24, 2022
1 parent 080d8e8 commit 4b35552
Show file tree
Hide file tree
Showing 18 changed files with 618 additions and 2,758 deletions.
Binary file modified Example_workflows.zip
Binary file not shown.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
[![Build Status](https://img.shields.io/travis/com/jvalegre/aqme?label=Linux%20CI&logo=Travis)](https://travis-ci.com/github/jvalegre/aqme)
[![Tests](https://img.shields.io/static/v1?label=Tests&message=104&color=green&logo=Travis)](https://travis-ci.com/github/jvalegre/aqme)
[![Codecov](https://img.shields.io/codecov/c/github/jvalegre/aqme?label=Codecov&logo=codecov)](https://codecov.io/gh/jvalegre/aqme)

[![CodeFactor](https://img.shields.io/codefactor/grade/github/jvalegre/aqme?label=Codefactor%20grade&logo=codefactor)](https://www.codefactor.io/repository/github/jvalegre/aqme/overview/master)
[![Codacy](https://img.shields.io/codacy/grade/047e9c6001a84713a82e180669e14c98?label=Codacy%20grade&logo=codacy)](https://www.codacy.com/manual/jvalegre/aqme?utm_source=github.com&utm_medium=referral&utm_content=jvalegre/aqme&utm_campaign=Badge_Grade)
[![Codacy](https://img.shields.io/codacy/grade/047e9c6001a84713a82e180669e14c98?label=Codacy%20grade&logo=codacy)](https://www.codacy.com/gh/jvalegre/aqme/dashboard?utm_source=github.com&utm_medium=referral&utm_content=jvalegre/aqme&utm_campaign=Badge_Grade)
[![lgtm](https://img.shields.io/lgtm/grade/python/github/jvalegre/aqme?label=LGTM%20grade&logo=lgtm)](https://lgtm.com/projects/g/jvalegre/aqme/context:python)

![Size](https://img.shields.io/github/repo-size/jvalegre/aqme?label=Size)
![PyPI](https://img.shields.io/pypi/v/aqme?label=PyPI&logo=pypi)
![PyPI Downloads](https://img.shields.io/pypi/dm/aqme?label=PyPI%20downloads&logo=pypi&style=social)
![Size](https://img.shields.io/github/languages/code-size/jvalegre/aqme)
[![PyPI](https://img.shields.io/pypi/v/aqme?color=blue&label=PyPI&logo=pypi)](https://pypi.org/project/aqme)

# Automated Quantum Mechanical Environments (AQME)

Expand Down Expand Up @@ -68,7 +68,7 @@ Descriptor generator from multiple input types such as SMILES, log files, xyz, e

## Quickstart
### Using AQME in Jupyter Notebooks
There are multiple ready-to-use workflows presented as jupyter notebooks in the 'Example_workflows' folder. Some examples are:
There are multiple ready-to-use workflows presented as jupyter notebooks in the 'Example_workflows.zip' file. Some examples are:
* QCORR_workflows.ipynb (QCORR analysis of Gaussian output files):
1) Analyze optimized QM ground and transition states and create json files of normally terminated files with no errors, extra imaginary frequencies, duplicates, etc.
2) Use json files to generate single-point energy corrections with multiple levels of theory, charge and multiplicity through for loops:
Expand Down
6 changes: 1 addition & 5 deletions aqme/aqme.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,13 @@

import os
import time
import json
import pandas as pd
from pathlib import Path
from aqme.argument_parser import parser_args

from aqme.mainf import (
csearch_main,
geom_rules_main,
qprep_main,
move_sdf_main,
graph_main,
geom_par_main,
nmr_main,
Expand All @@ -46,9 +43,8 @@
cclib_main,
cmin_main,
)
from aqme.utils import Logger, get_filenames
from aqme.utils import Logger
from aqme.qcorr import qcorr, json2input
from aqme.qprep import qprep


def main():
Expand Down
213 changes: 0 additions & 213 deletions aqme/cheshire_lookup.py

This file was deleted.

8 changes: 5 additions & 3 deletions aqme/cmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# in conformer minimization with xTB and ANI #
#####################################################.

from operator import itemgetter
import os
import sys
import numpy as np
Expand All @@ -13,7 +12,6 @@
from rdkit.Geometry import Point3D
import time
from aqme.argument_parser import set_options
from aqme.filter import CompoundFilter, EnergyFilter, RMSDFilter
from aqme.utils import (
set_metal_atomic_number,
Logger,
Expand Down Expand Up @@ -53,12 +51,15 @@ def __init__(
w_dir_initial=os.getcwd(),
varfile=None,
charge_default=0,
program=None,
**kwargs,
):

self.mols = mols
self.name = name
self.w_dir_initial = w_dir_initial
self.charge_default = charge_default
self.program = program

if "options" in kwargs:
self.args = kwargs["options"]
Expand Down Expand Up @@ -640,7 +641,8 @@ def mult_min(name, args, program, charge, log, w_dir_initial):
name_mol = os.path.basename(name).split("_" + args.CSEARCH)[0]

# bar.next()
obj = cmin(inmols, name_mol, w_dir_initial, args.varfile, charge, program)
obj = cmin(mols=inmols, name=name_mol, w_dir_initial=w_dir_initial, varfile=args.varfile,
charge_default=charge, program=program)
total_data = obj.compute_cmin()

return total_data
14 changes: 6 additions & 8 deletions aqme/crest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
#######################################################################

# Python Libraries
import sys, os
import os
from rdkit.Chem import rdMolTransforms
import numpy as np
import glob
from optparse import OptionParser
import subprocess
import rdkit
from rdkit.Chem import AllChem
Expand Down Expand Up @@ -125,7 +123,7 @@ def run_xtb(
+ ","
+ str(dihedral[4])
)
xtb_result = subprocess.run(command)
subprocess.run(command)


def crest_opt(mol, name, dup_data, dup_data_idx, sdwriter, args, log):
Expand Down Expand Up @@ -223,7 +221,7 @@ def crest_opt(mol, name, dup_data, dup_data_idx, sdwriter, args, log):
command.append("--cbonds")
command.append(str(cbonds))

crest_result = subprocess.run(command)
subprocess.run(command)

if cregen:
xyzcregenensemble = xyzoutall.split(".xyz")[0] + "_cregen.xyz"
Expand Down Expand Up @@ -255,7 +253,7 @@ def crest_opt(mol, name, dup_data, dup_data_idx, sdwriter, args, log):
"--ewin",
str(cregen_ewin),
]
cregen_result = subprocess.run(command)
subprocess.run(command)

# converting multiple xyz to single
command_run_1 = [
Expand Down Expand Up @@ -292,7 +290,7 @@ def crest_opt(mol, name, dup_data, dup_data_idx, sdwriter, args, log):

dup_data.at[dup_data_idx, "crest-conformers"] = len(xyz_files)

for f in glob.glob(os.getcwd() + "/" + name + "*.xyz"):
os.remove(f)
# for f in glob.glob(os.getcwd() + "/" + name + "*.xyz"):
# os.remove(f)

return 1
2 changes: 0 additions & 2 deletions aqme/csearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@
import subprocess
import time
from pathlib import Path
import concurrent.futures as futures # RAUL: This is for the main

import numpy as np
import pandas as pd
from rdkit.Chem import AllChem as Chem

from rdkit.Chem import rdMolTransforms, PropertyMol, rdDistGeom, Lipinski
from progress.bar import IncrementalBar # RAUL: This is for the main

from aqme.filter import filters, ewin_filter, pre_E_filter, RMSD_and_E_filter
from aqme.tmbuild import template_embed
Expand Down
Loading

0 comments on commit 4b35552

Please sign in to comment.