Commit Graph

380 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
f0bb85dfdb Fixes #1049 (#1050)
* fixes #1049
That was almost too easy

* elaborate the test a bit
2016-09-01 09:22:17 +02:00
Greg Landrum
8009b867b5 Fixes #1034: squiggle bonds are now preserved if no sanitization is done (#1043)
* backup commit

* typo

* forgot the test file

* also test that atom chirality is handled properly
2016-08-30 16:02:31 +02:00
Greg Landrum
7a49dd3bb9 fixes #1023 (#1027) 2016-08-18 16:29:29 -04:00
Brian Kelley
ddf7c73b50 Adds Atom atom map and rlabel apis (#1004)
* Adds Atom atom map and rlabel apis

* Moves RLabels to their own namespace, adds other properties.

* Removes namespaces, liberally adds Atom to function names.

* move detail::computedPropName to RDKit::detail::computedPropName
2016-08-11 04:46:41 +02:00
Brian Kelley
900fc391aa Fixes middle-justified symbols in sd files, adds M_CHG tests (#1002)
* Adds boost::trim, M  CHG tests

* stoi is a c++11 feature

* Actually test charges
2016-08-02 14:41:08 +02:00
Paolo Tosco
63b6bdef46 - RCSB SDF files which feature right-justified element names can now be parsed (#994)
- added a relevant test
2016-07-27 14:49:52 +02:00
Greg Landrum
339fa081e5 Merge fix/github908 branch 2016-07-27 04:49:55 +02:00
Greg Landrum
91212a4eb3 A variety of drawing-related changes (#986)
* Fixes #982
also changes bond-wedging algorithm to favor lighter non-ring bonds

* prefer wedging bonds to lower-degree atoms

* Fixes #983

* small fixes
- Fix a problem where a chiral atom is selected to draw a wedge to instead of a ring atom
- Fix a problem where two calls to PrepareMolForDrawing() led to two wedged bonds from an atom.

* Fixes #985

This isn't the most satisfying solution (the wedged bonds are sometimes a bit too large), but it gives reasonable results on the test cases I've tried.
2016-07-25 17:28:41 -04:00
Paolo Tosco
dd871c3536 Modifications to enable building with MinGW compilers (#960)
* - added -DBOOST_SYSTEM_NO_DEPRECATED to definitions for MINGW builds
- modified a few #ifdef's to discriminate better between MINGW and MSVC
- added a ios::binary to Code/GraphMol/FileParsers/testMolSupplier.cpp
  (I already had to add some of those in the past to avoid the CR+LF issues on Windows)
- modified Code/GraphMol/FMCS/MaximumCommonSubgraph.cpp and
  Code/GraphMol/FMCS/FMCS.h because checking the function pointer does not
  work with DLLs as the function pointer changes upon different calls
- builds under MinGW with -DRDK_USE_BOOST_SERIALIZATION=OFF and
  RDK_BUILD_THREADSAFE_SSS=OFF

* - added the possibility to define MSVC_RUNTIME_DLL to point to the
  absolute path of an appropriate MSVC runtime DLL to enable
  multi-threaded builds with MinGW
- modified C++ and Python tests of the multi-threaded conformation
  embedder as under 32-bit MinGW lower numeric precision introduces minimal
  coordinate differences with result in ~1-kcal energy difference.
  Therefore the energy criterion has been made more lenient, and a
  coordinate MSD criterion has been introduce to compare substantial
  identity of conformations

* - reverted Code/GraphMol/DistGeomHelpers/Wrap/testDistGeom.py and Code/GraphMol/DistGeomHelpers/testDgeomHelpers.cpp
  to the upstream/master version
2016-06-25 09:12:40 +02:00
Brian Kelley
552a78ed3a Dev/moldescriptors callables (#944)
* Adds a generic Property Calculation API

     Property mw(Property::MW);
     Property logp(Property::ALOGP);

     // User based function
     struct MyPropertyFunction : public PropertyFxn {
       double compute(const ROMol &mol) const {
         return rdcast<double>(mol.getNumAtoms());
       }
       bool isAdditive() const { return true; }
     }

     // Make the a num atom property
     boost::shared_ptr<PropertyFxn> atomfxn(new MyPropertyFxn);
     Property numAtoms("NumAtoms", atomfxn);

     double alogp = logp.computeProperty(mol);
     double nAtoms = numAtoms.computeProperty(mol);

And a ProperFilter API

     // Molecular weight filter 0 ... 500.
     PropertyFilter mw(PropertyFilter::MW, 0., 500.);
     
     // log p Filter -5 ... 5
     PropertyFilter logp(PropertyFilter::ALOGP, -5.0, 5.0);

     // User based function
     struct MyPropertyFunction : public PropertyFxn {
       double compute(const ROMol &mol) const {
         return rdcast<double>(mol.getNumAtoms());
       }
     }

     // add num atom property 0. ... 50.
     boost::shared_ptr<PropertyFxn> atomfxn(new MyPropertyFxn);
     PropertyFilter natoms("NumAtoms", 0., 50., atomfxn);

     if (natoms.accepts(mol)) {
      // molecule is ok
     } else {
      // molecules is bad
     }

* Adds missing includes

* Fixes g++ access to class based enums

* Updates to new API, adds better property registry

* Adds a generic Property Calculation API

     Property mw(Property::MW);
     Property logp(Property::ALOGP);

     // User based function
     struct MyPropertyFunction : public PropertyFxn {
       double compute(const ROMol &mol) const {
         return rdcast<double>(mol.getNumAtoms());
       }
       bool isAdditive() const { return true; }
     }

     // Make the a num atom property
     boost::shared_ptr<PropertyFxn> atomfxn(new MyPropertyFxn);
     Property numAtoms("NumAtoms", atomfxn);

     double alogp = logp.computeProperty(mol);
     double nAtoms = numAtoms.computeProperty(mol);

And a ProperFilter API

     // Molecular weight filter 0 ... 500.
     PropertyFilter mw(PropertyFilter::MW, 0., 500.);
     
     // log p Filter -5 ... 5
     PropertyFilter logp(PropertyFilter::ALOGP, -5.0, 5.0);

     // User based function
     struct MyPropertyFunction : public PropertyFxn {
       double compute(const ROMol &mol) const {
         return rdcast<double>(mol.getNumAtoms());
       }
     }

     // add num atom property 0. ... 50.
     boost::shared_ptr<PropertyFxn> atomfxn(new MyPropertyFxn);
     PropertyFilter natoms("NumAtoms", 0., 50., atomfxn);

     if (natoms.accepts(mol)) {
      // molecule is ok
     } else {
      // molecules is bad
     }

* Adds missing includes

* Fixes g++ access to class based enums

* Updates to new API, adds better property registry

* Fixes merge error

* Removes unused unordered_map include

* Adds calcClogP calcMR as functions.

* PropertyFxn ->PropertyFunctor, adds Queries::Query based queries.

* Adds Python PropertyFunctors (can’t be used as queries yet)

* Exposes PropertyRangeQueries

* Adds doc strings

* Throws error if stereo is not assigned.

* Adds molecule annotation.
2016-06-22 08:07:56 +02:00
Paolo Tosco
e7ac394709 - finishing touches 2016-05-15 22:08:30 +01:00
Paolo Tosco
e76e06bb23 - added support for the gzip'd stream test
- fixed a few things in Code/GraphMol/FileParsers/testMolSupplier.cpp
2016-05-15 21:36:09 +01:00
Paolo Tosco
53a9db3dda - linked against boost_iostreams 2016-05-14 18:31:10 +01:00
Brian Kelley
34fef8baaf Rollup of warning squashing (with some tests diagnostics thrown in) 2016-04-30 13:25:48 -04:00
Paolo Tosco
f80a736468 - further improvement to avoid exception on Linux with Python 3.x
- extension of the fix to all other flush() and close() methods
2016-04-02 23:19:11 +01:00
Paolo Tosco
7b5c41b734 - fixed the crash in testGithub497() on Windows with Python 3.x and MSVC 2015 2016-04-02 14:50:12 +01:00
Paolo Tosco
fee571a392 - attempt to fix a crash on Windows with Python 3.x when running
testGithub497()
2016-04-02 01:22:55 +01:00
Greg Landrum
7ca16e6d54 Merge pull request #828 from greglandrum/fix/github188
Fixes #188
2016-04-01 16:11:48 +02:00
Greg Landrum
2e961be508 rename method to getText() 2016-03-31 05:17:41 +02:00
Greg Landrum
baa2b9b217 first version 2016-03-30 16:08:05 +02:00
Greg Landrum
d30bf4a6df the fix for #188 also
fixes #192
2016-03-29 13:19:10 +02:00
Greg Landrum
53b6e52765 ok, this time it is a proper fix 2016-03-29 13:09:22 +02:00
Greg Landrum
9a13afba24 Fixes #188 2016-03-29 10:58:56 +02:00
Greg Landrum
55e2f7c821 document a magic constant 2016-02-15 15:02:54 +01:00
Greg Landrum
added01998 Prefer wedging bonds to Hs when possible
Fixes #772
2016-02-15 14:32:30 +01:00
Greg Landrum
2ca85c775f Fixes #741 2016-02-13 05:38:03 +01:00
Brian Kelley
6d5b7a0305 Adds more extensive tests (recursion, multithreading) 2016-01-20 17:09:58 -05:00
Brian Kelley
2102582f86 Protect Locales in Mol and PDB writer 2016-01-20 17:09:58 -05:00
Brian Kelley
ae13f0a93a Adds tests for locale switching 2016-01-20 17:09:58 -05:00
Greg Landrum
41f4e6c5b2 hack to build on windows 2015-12-21 17:35:16 +01:00
Greg Landrum
1f04eaed26 speed up molblock generation 2015-12-21 07:48:39 +01:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Greg Landrum
e37296d7c7 post review 2015-11-14 08:08:14 +01:00
Brian Kelley
210f2951e0 Silences warnings in tests 2015-10-18 21:20:11 -04:00
Brian Kelley
a81b7b4dae Removes always true invariants 2015-10-18 21:16:51 -04: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
daa7e62258 Fixes signed conversion issues (use rdcast) 2015-10-18 15:16:38 -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
a146c3826a Remove unused variables/functions and register keyword 2015-10-18 10:01:00 -04:00
Riccardo Vianello
78d7f6c1d9 Fix regressions occurring when building with msvc9 2015-10-14 09:43:16 +02:00
Brian Kelley
12d562399a Merge branch 'master' into fix/const-string-ref 2015-10-13 07:08:00 -04:00
Brian Kelley
626d277ee6 Fixes sprintf not found on some gcc compiles 2015-10-12 08:43:41 -04:00
Brian Kelley
6ebbeb3bd3 Major conversion of std::string API to const std::string & 2015-09-25 15:15:59 -04:00
Brian Kelley
d50fd264f6 Change to const std::string & API 2015-09-25 15:15:21 -04:00
Greg Landrum
68f58ebd50 Merge branch 'master' into fasta_help_Sept2015 2015-09-21 10:01:13 +02:00
Greg Landrum
d3bf352940 add test for #611 2015-09-10 16:01:15 +02:00
Greg Landrum
136de13e8d Fixes #611 (testing still required) 2015-09-10 15:52:20 +02:00