Commit Graph

69 Commits

Author SHA1 Message Date
Eisuke Kawashima
75f03412ef Modernize deprecated header inclusion (#3137) 2020-05-04 10:40:57 +02:00
Greg Landrum
9991c5247a cleanup of the SMILES/SMARTS parsing and writing code (#2912)
* first cleanup

* next round of changes. all tests pass

* Fixes #2909

* Fixes #2910

* further cleanup

* some cleanup/refactoring of the Dict class

* remove now extraneous calls to hasProp() before clearProp()

* minor refactoring of RDProps.h

* Switch from using our own version of round() to std::round()

* replace some boost::math stuff with the equivalents from std::

* cleanups in SmartsWrite

* refactor out a bunch of duplicated code

* fix an instance of undefined behavior

* changes in response to review
2020-01-29 15:13:39 +01:00
Greg Landrum
d41752d558 run clang-tidy with readability-braces-around-statements (#2899)
* run clang-tidy with readability-braces-around-statements
clang-format the results
clean up all the parts that clang-tidy-8 broke

* fix problem on windows
2020-01-25 14:19:32 +01:00
Greg Landrum
853c24d11c Fixes #2775 (#2776) 2019-11-14 16:58:30 +01:00
Greg Landrum
253f172353 Allow identification of chemistry problems (#2587)
* add AtomValenceException

* refactor a bit and add KekulizeException

* add copy ctor and copy() method

* add detectChemistryProblems

* add getType() method
want to be able to get the type of the exception without requiring doing a bunch of dynamic casts

* first pass at exception inheritance/translation
needs some cleanup and expansion, but this does pass all tests.

* cleanup and finish the python wrappers for the new exceptions

* make sure things are truly polymorphic

* wrap shared_ptrs of the new exception types

* expose DetectChemistryProblems()

* get the java wrappers building again

* transfer those changes to the c# wrapper

* add detectChemistryProblems()
and deal with the fun fun exception inheritance things that ensue

* response to review
2019-08-28 14:15:55 -07:00
Greg Landrum
7ffd863c9b A collection of bug fixes (#2608)
* Fixes #2602

* Fixes #2605

* Remove vestigial isEarlyAtom() definition in Kekulize.cpp

* Fixes #2606

* Fixes #2607

adds allowed valence 2 for Sn and Pb

* Fixes #2610

* update in response to review
2019-08-15 04:53:23 +02:00
Greg Landrum
d8c49e6dab Code cleanups from PVS/Studio (#2531)
* first round of cleanups based on PVS-studio suggestions

* a couple more

* a few more cleanups

* another round of cleanups

* undo one of those cleanups
we want the integer rounding behavior here

* add a comment to make that clear

* Fix for filter catalog PRECONDITION redundancy
2019-07-13 07:25:37 +02:00
Greg Landrum
3ce2016039 Fixes #2452 (#2507) 2019-06-24 23:07:19 -04:00
Greg Landrum
334b1558bc Fixes #2258 (#2286) 2019-02-22 07:30:31 -07:00
Greg Landrum
915cf08faa run clang-format with c++-11 style over that 2017-04-22 17:19:10 +02:00
Greg Landrum
7c0bb0b743 clang-tidy output 2017-04-22 17:09:24 +02:00
Greg Landrum
d3ad7d2770 Fixes #1387 (#1392)
* backup

* Fixes #1387
this passes the bug tests, but needs the full tests run

* all tests pass

* remove some droppings left from an earlier attempt at a fix

* remove some additional printing

* cleanup
2017-04-07 11:57:43 -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
2debdfde0d Adds RDAny (smaller generic holder) Updates all used dictionaries (#896)
* Adds RDAny (smaller generic holder) Updates all used dictionaries

This is an API compliant version of the current rdany system,
but uses a lot less memory in practice.

* Removes code duplication

* Converts CHECK_INVARIANT to TEST_ASSERT

* Fixes DoubleTag issue

* Adds Bool to DoubleMagic implementation

* Removes reference to property pickler
2016-05-29 17:04:21 +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
Paolo Tosco
deb01fa717 Merge remote-tracking branch 'upstream/master' 2015-10-18 22:03:19 +01:00
Brian Kelley
5f59333a56 Silences unused parameters 2015-10-18 14:02:29 -04:00
Paolo Tosco
eaa187b03d - added ResonanceMolSupplier
- added overloaded SubstructMatch() version supporting ResonanceMolSupplier
- added relevant Python wrappers
- added C++/Python tests
2015-10-04 23:21:28 +01:00
Brian Kelley
d50fd264f6 Change to const std::string & API 2015-09-25 15:15:21 -04:00
Paolo Tosco
5dfbecd6d0 - fixed missed kekulization of aromatic carbocations such as cyclopropenyl
and tropylium
2015-07-17 01:00:34 +01:00
Greg Landrum
797db2fa82 remove Atom::setMass() 2015-03-22 17:57:04 +01:00
Greg Landrum
37673af15a remove dativeFlag from atoms 2015-03-22 17:48:06 +01: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
5b7b3b3d3d fix problem with Atom->needsUpdatePropertyCache() and noImplicit 2014-12-29 08:00:40 +00:00
Nadine Schneider
0bbf3ec79b Add function to test if UpdatePropertyCache is necessary 2014-12-19 13:59:42 +01:00
Greg Landrum
c26cbc26cb switch to using references to smart pointers for the Match functions;
really ought to re-examine when/how we are passing smart pointers
 around in general, but that is a bigger job.
Ref: http://herbsutter.com/2013/06/05/gotw-91-solution-smart-pointer-parameters/
2014-05-10 06:21:27 +02:00
Greg Landrum
9f4471f872 more on #204
A few other cleanups
2014-02-06 06:43:28 +01:00
Greg Landrum
924fc373ef Fixes #165 2013-12-31 07:52:08 +01:00
Greg Landrum
eec7c1c089 make sure there is ring info available 2013-12-03 04:12:46 +01:00
Greg Landrum
53ea3259c9 small SSS optimization 2013-12-02 06:21:32 +01:00
Greg Landrum
46b80e92a6 Merge branch 'mmpa_update_14Aug2013' 2013-09-18 01:56:15 +02:00
Greg Landrum
585385a166 remove extraneous print 2013-08-23 07:31:21 +02:00
Greg Landrum
7e1843a2c5 initial set of tests in 2013-08-09 14:07:20 +02:00
Greg Landrum
3c835f61bb initial pass 2013-08-09 10:14:33 +02:00
Greg Landrum
a4734bbd43 start using the alternate getProp form 2013-07-20 07:26:06 -04:00
Greg Landrum
b5fe1f3f8c add return vals for getProps on ROMol, Atom, and Bond;
use a variable to store computed prop names
2013-07-20 06:07:19 -04:00
Greg Landrum
b4f2ec374e Fixes: #61 2013-07-04 18:00:09 +02:00
Greg Landrum
50bc499c20 fix for sf.net bug 274 2012-12-15 03:29:03 +00:00
Greg Landrum
175338d061 fix sf.net issue261: add isotope information to debugMol() 2012-12-04 05:40:55 +00:00
Greg Landrum
16e2a04d2c patch from Roger Sayle to improve valence handling of
transition metals and lanthanides
2012-10-10 10:14:42 +00:00
Greg Landrum
e7d25d7973 tests passing except reactions 2012-04-21 04:40:55 +00:00
Greg Landrum
e38ef02346 initial pass at changing atom-atom matching behavior;
fix for issue 3495370
2012-03-02 07:20:16 +00:00
Greg Landrum
813f4863ed fix and test Issue 3480481 2012-02-18 05:34:34 +00:00
Greg Landrum
29312e73e1 minor updates 2012-01-03 07:50:53 +00:00
Greg Landrum
f3fbef45c5 update copyright statements 2010-09-26 17:04:37 +00:00
Greg Landrum
116c036c07 doc updates for writers to indicate that "-" writes to stdout;
rename computedProps property to __computedProps
2010-09-19 13:13:10 +00:00
Greg Landrum
052ec66542 cleanups:
remove x bit from headers and sources;
remove a couple empty files from Code/GraphMol
2010-09-08 04:25:57 +00:00
Greg Landrum
1d7168f0ab cleanup 2010-06-03 15:49:32 +00:00
Greg Landrum
214f1c5c20 primarily minor code cleanups. 2010-05-26 18:27:40 +00:00