Commit Graph

112 Commits

Author SHA1 Message Date
gedeck
e9af48ffd7 Issue1071/yapf (#1078)
* Issue #1071: add yapf configuration file

* yapf formatting of Code directory

* yapf formatting of Contrib directory

* yapf formatting of Data directory

* yapf formatting of Docs directory

* yapf formatting of External directory

* yapf formatting of Projects directory

* yapf formatting of Regress directory

* yapf formatting of Scripts directory

* yapf formatting of Web directory

* yapf formatting of rdkit directory
2016-09-23 04:58:46 +02:00
Greg Landrum
2afeb3b086 Dev/cleanup bad confs (#973)
* passes all tests, but is still not 100 percent there

* generalize _centerInVolume for possible future use

* better testing of tetrahedral centers
update tests

* only test ring atoms

* handle 4-coordinate n too

* add a volume check; not all tests pass

* turn off debug printing

* rearrange the order of tests.
if this is not done, we get a seg fault when the github55 test runs.
the whole thing needs to be run under valgrind to track this down

* clear up a memory leak

* a bit more documentation
add a constant for one of the threshold values

* get more permissive on the energy tests.
Only do the extra tetrahedral tests for atoms in at least two rings.

* add a DEBUG_EMBEDDING option to make tracking down failures easier

* enable better debugging when the flag is set

* remove a FIX

* remove some debug printing from the tests
2016-07-25 14:26:19 -04:00
sriniker
7943b8c79d Improved planarity for ETKDG (#967)
* enforce planarity

* increase the force constant for the impropers

* force constant adapted

* reduced tolerance for planarity and force constants changed for some torsions

* tolerance for planarity increased a bit again

* cerr outputs removed

* planarity tolerance increased

* boost log added in planarity check
2016-06-29 05:00:30 +02:00
Paolo Tosco
088256bfb1 - fixed a typo in the Python docs 2016-05-11 23:45:37 +01:00
Paolo Tosco
779ec747ac - put SnapshotVect in the RDKit namespace 2016-05-11 23:41:31 +01:00
Paolo Tosco
2b3a818f84 - removed the dependency on Trajectory from ROMol and ForceField 2016-05-11 19:37:09 +01:00
Paolo Tosco
8b5176f8c9 - initial work to put the Trajectory code into a separate object 2016-05-09 19:05:15 +01:00
Paolo Tosco
d16b312ee6 - Completely revised coordinate ownership
- Implemented Python wrappers
- prepared relevant test cases
2016-04-24 23:30:25 +01:00
Paolo Tosco
584b77ea18 - work in progress on the Trajectory branch 2016-04-14 20:04:58 +01:00
Paolo Tosco
406ea052f5 - work in progress 2016-04-12 23:03:57 +01:00
Paolo Tosco
0c0b0a30be - started adding trajectory storage to minimizer 2016-04-12 21:30:55 +01:00
Greg Landrum
e04aed8ea8 another batch of warnings squashed 2016-03-30 13:44:21 +02:00
Greg Landrum
64c67e4900 speed up the distance calculation a bit too 2015-12-08 03:09:30 +01:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Greg Landrum
5618819c64 merge #641 2015-11-14 05:03:24 +01:00
Sereina
26ab552232 fixes based on code review 2015-10-21 14:51:53 +02:00
Brian Kelley
fb84c9f0b7 Switches to URANGE_CHECK when appropriate 2015-10-18 21:14:02 -04:00
Brian Kelley
54311dff9c Suppresses warnings in tests 2015-10-18 16:09:58 -04:00
Brian Kelley
5f59333a56 Silences unused parameters 2015-10-18 14:02:29 -04:00
Brian Kelley
403a3d6b7c Suppresses Boost warnings 2015-10-18 13:41:03 -04:00
Brian Kelley
6ebbeb3bd3 Major conversion of std::string API to const std::string & 2015-09-25 15:15:59 -04:00
Paolo Tosco
e776a11b7d - Forcefield tests now use RDKit::feq() instead of RDKit::round() 2015-05-09 18:33:03 +01:00
Paolo Tosco
623f816c33 - modified force field constraint tests to be more robust 2015-05-05 13:07:52 +01:00
Greg Landrum
7e5c37e685 update some tests to ensure success on 32bit systems 2015-05-01 16:04:17 +02:00
Paolo Tosco
b7ca51d98c - modified BFGSOpt.h to remove a while(1) {} loop which might result
into an infinite loop in linearSearch() with poor initial geometries
- added a relevant unit test in Code/ForceField/Wrap/testConstraints.py
2015-04-20 23:46:23 +01:00
Paolo Tosco
7fe0024c48 - removed the possibility of an indefinite loop in linearSearch(); now an
exception is thrown in such cases
- added a relevant unit test in testConstraints.py
2015-04-20 23:31:55 +01:00
Greg Landrum
b50260fa85 update README.md to include fingerprints 2015-04-09 04:21:38 +01:00
Riccardo Vianello
7c346d7c2e Code/RDBoost/Exceptions.h moved to Code/RDGeneral 2015-03-16 22:31:48 +01:00
Greg Landrum
6ea808b800 get this building on windows 2015-03-15 06:57:24 +01:00
Greg Landrum
f80532c0fd update the multithreaded UFF helper to not construct the force field for each conformer 2015-03-11 03:26:50 +01:00
Greg Landrum
07078af4ca support copying ForceField objects 2015-03-11 03:06:32 +01:00
Greg Landrum
5e6491322f explicitly disable copy ctor for ForceFields 2015-03-09 05:42:18 +01:00
Greg Landrum
56e2cf34b3 ForceField should use pointers to const contribs 2015-03-09 04:42:07 +01:00
Greg Landrum
210a8635bf add units to force field docs 2015-01-29 14:05:16 +01:00
Paolo Tosco
eac634383e - fixed two minor bugs in MMFF code concerning the Badger-Herschbach-Laurie
equations.
2015-01-21 22:44:11 +00:00
Brian Kelley
95a92282d1 Dictionary access is saniztized and optimized.
o rdkit gains a RDKit::common_properties namespace that contains common string value properties

 o Dict.h and below gain getPropIfPresent that attempts to retrieve a property and returns
  true/false on success or failure.  This is used to optimize access.

 o rdkit learns how to pass property keys by reference, not value.

A new namespace has been added to RDKit, common_properties
that contains the std::string values for commonly used
properties.  This helps to avoid typos in string values
but also avoids a creation of std::strings from character
values.  All accessors (has/get/clear and getPropIfPresent) now pass
the key by reference.

Additionally, getPropIfPresent removes the double lookup
of hasProp/getProp which can be a significant speedup
in the smiles and smarts parsers (10-20%)
2015-01-15 12:23:29 -05:00
Greg Landrum
40b006a8e0 fix to get tests passing in lin32. not a functional change, just tolerance values 2014-12-09 03:28:39 +01:00
ptosco
df89d39f13 - fixed a bug in UFF/TorsionConstraint.cpp and MMFF/TorsionConstraint.cpp
which caused issues with negative angles
- made also UFF/AngleConstraint.cpp and MMFF/AngleConstraint.cpp more
  robust against angle ranges involving negative values
- added relevant C++ and Python tests
2014-12-02 22:47:18 +00:00
Greg Landrum
6c373ef11f - added C++ and Python helpers to retrieve force-field parameters
(i.e., equilibrium distances/angles and force constants) from
  UFF and MMFF in response to two requests recently appeared
  on the RDKit-discuss mailing list:
  http://sourceforge.net/p/rdkit/mailman/message/32953737/
  http://sourceforge.net/p/rdkit/mailman/message/32880156/
- did some clean up on the MMFF code
- NB there are two ABI changes:
  1) StretchBendContrib(ForceField *owner,
       const unsigned int idx1, const unsigned int idx2, const unsigned int idx3,
       const MMFFStbn *mmffStbnParams, const MMFFAngle *mmffAngleParams,
       const MMFFBond *mmffBondParams1, const MMFFBond *mmffBondParams2);
     previously was:
     StretchBendContrib(ForceField *owner,
       const unsigned int idx1, const unsigned int idx2, const unsigned int idx3,
       const std::pair<bool, const MMFFStbn *> mmffStbnParams,
       const MMFFAngle *mmffAngleParams, const MMFFBond *mmffBondParams1,
       const MMFFBond *mmffBondParams2);
  2) std::pair<double, double> calcStbnForceConstants(const MMFFStbn *mmffStbnParams);
     previously was:
     std::pair<double, double> calcStbnForceConstants
       (const std::pair<bool, const MMFFStbn *> mmffStbnParams);
  The two changes are NOT mandatory - however, both the StretchBendContrib constructor
  and calcStbnForceConstants(), though public, are basically "internal" method that
  most likely no-one has ever invoked. Given that the current API is MUCH better
  and cleaner, I would really advise for the new version.
2014-11-17 05:51:20 +01:00
Paolo Tosco
1c3a03961d - fixed a bug which caused the MMFF parameterization code
to segfault when a system not listed in the MMFFBndk
  table was found. THe Herschbach-Laurie fallback according
  to MMFF.V was implemented and a relevant test was added
  in testMMFFHelpers.cpp
2014-08-18 16:11:03 +01:00
Riccardo Vianello
3358ec5925 initial set of changes introducing python3 support 2014-06-17 18:26:41 +02:00
ptosco
ba4a48ce05 - fixed a bug in Code/ForceField/MMFF/testMMFFForceField.cpp
- fixed a bug in Code/GraphMol/ForceFieldHelpers/MMFF/AtomTyper.cpp
  which caused misassignment of atom types in CYGUAN01 upon shuffling
  the order of atoms in the validation SDF files
- added checks for acos and asin function parameters to be within
  a (-1, 1) range
2014-06-01 16:23:03 +01:00
ptosco
8ed92e222a - fixed a weakness in the angular restraint code which misbehaved
in case ranges involving negative angles were given as input
2014-05-10 20:53:17 +01:00
Greg Landrum
f5cf3322fe code cleanup: removing compiler warnings 2014-05-08 06:06:07 +02:00
ptosco
13bb831dd5 - removed a few spurious, though non harmful, "const" keywords from
Code/ForceField/MMFF/Params.h, Code/ForceField/UFF/Params.h,
  Code/GraphMol/ForceFieldHelpers/MMFF/AtomTyper.cpp
  and Code/GraphMol/ForceFieldHelpers/MMFF/AtomTyper.h (I realized
  their uselessness thanks to a warning issued by Intel C++ compiler)
- refactored O3A code
- added the possibility to set weighted constraints on selected
  atom pairs
- added an option to carry out local-only optimization
2014-04-15 22:13:54 +01:00
ptosco
5b2f6763a5 - Added the std::fstream::binary flag in testMMFFForceField.cpp
whose absence might cause intermittent problem in parsing the
  logs on Windows due to tellg/seekg not correctly handling CR/LF
- Fixed the code for assigning the HOCN MMFF94 atom type
  (thanks to Toby Wright for reporting this)
- Added a missing copyright notice in testMMFFForceField.h
2014-04-14 23:57:22 +01:00
Greg Landrum
2114db0941 Fixes #204
This covers at least the specific instances from the bug report.
Still need to figure out a general way to identify these automatically
to make sure all are fixed.
2014-02-05 06:38:05 +01:00
ptosco
8b17ef13fd - modified Code/GraphMol/AddHs.cpp so that hydrogens are not
removed when the heavy atom they are connected to is not
  in its default valence state, while it has one of the
  acceptable valence states (otherwise it still has to be
  removed for sanitization purposes)
- updated the MMFF validation suite SMILES accordingly
2014-02-01 13:05:10 +01:00
ptosco
dded46bf0d - removed a spurious #ifdef [...] #endif from
Code/ForceField/MMFF/testMMFFForceField.h
- re-prepared the SDF files from their MOL2 counterparts present in the
  original  MMFF validation suites. For this purpose a C++ program was
  written which only uses information in MOL2 files and in .fc files
  provided by Halgren. The C++ program does not depend on RDKit.
- re-prepared the SMILES files from their SDF counterparts using
  a Python script which calls MolToSmiles()
- found an issue which affects 2 files in the test suite, namely
  ERULE_05 and PO02A (only the hypervalent notation). The issue is
  connected with removal of hydrogens bonded to phosphorous and
  appears to be fixed by the modifications in Code/GraphMol/AddHs.cpp
  and Code/GraphMol/SmilesParse/SmilesWrite.cpp. This issue is
  independent of the changes ini the SDF files; indeed, it has
  always been present, and had been previously addressed by
  manual correction of the two SMILES strings
2014-01-27 19:05:49 +01:00
ptosco
bc88b4393d - Fixed a bug in Code/GraphMol/MolAlign/testMolAlign.cpp which caused
data races in the multithreaded test
- Removed a spurious #include in Code/ForceField/Wrap/ForceField.cpp
- Restored caching in Code/GraphMol/Descriptors/Crippen.cpp
2014-01-24 14:20:34 +01:00