Add comments, suggestions and clean up to matchMinima.py, look for #M#1
Add comments, suggestions and clean up to matchMinima.py, look for #M#1magee256 wants to merge 1 commit intovtlim:masterfrom
Conversation
|
|
||
|
|
||
| #M Do what OE does and define your own molecule objects, they could even | ||
| #M extend the OE chem definitions to save you work. |
There was a problem hiding this comment.
OE seems to have a molecule object. If you wanted to you could define your own personal molecule object that inherits from the OE molecule. That would mean your new object would have all the methods and attributes an OE molecule object has, plus whatever you wanted to add. Declare it like class MyMolecule(OEMolecule):
|
|
||
| for i, sdfQuery in enumerate(sdfList): | ||
| qthry = thryList[i] | ||
| for sdfQuery, qthry in zip(sdfList,thryList): |
|
|
||
| """ | ||
|
|
||
| #M Unrelated: You're compring times spent in each minima? What for? |
There was a problem hiding this comment.
i'm taking into acct how long it takes to optimize each conformer of a molecule. then getting an average per molecule per level of theory. that's what's being compared, the diff levels of theory
There was a problem hiding this comment.
Ok so you're interested in the time it takes for optimization as well as the energy differences between levels of theory.
| molStds = [] | ||
| for j, filelist in enumerate(molist): | ||
| rels = np.asarray(filelist)/np.asarray(molist[0]) | ||
| #M I trust this is safe? |
There was a problem hiding this comment.
Does eliminating nan's like that bias your results? I assume some conformers don't finish optimization because of a timeout.
| # if len(trimE) != len(zeroes): | ||
| # print len(trimE), zeroes | ||
| # sys.exit("Error in determining reference confs for molecules.") | ||
| #M Delete unused code unless you expect to add it back in soon. Reduces clutter |
| molE = [] # all conf energies from ith mol in all files | ||
| #M Try this: | ||
| #M flipped = np.array(theArray[i]).T | ||
| #M molE.append([ nan if (x == None or x == -2) else theArray[i][j][k] for ... ]) |
| #M I take it there's no better way to do this? | ||
| #M You should take a look at: https://docs.python.org/2/library/unittest.html | ||
| #M I haven't used it myself but I really should. Also look into using assert | ||
| #M statements |
There was a problem hiding this comment.
I actually need to take this out, this was from an older version
There was a problem hiding this comment.
thanks for the other two references
|
this was helpful, thanks. broader concepts like defining a class would be useful but probably not worth spending the time on for this particular script. will keep in mind for other applications. |
|
Yeah at this point it might take a while to rewrite the script to use classes. Classes do tend to make code shorter and more organized so it's good to think about where they could be used when starting a project. |
Here's my feedback. I gave myself like an hour and a half so it might not be too thorough but I think I suggested some pretty specific improvements. A lot of it is just style based though.