Commit Graph

41 Commits

Author SHA1 Message Date
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
Eisuke Kawashima
5cd27a242f Fix typo (#2862)
* Fix typo

* Reflect the comments

* Fix more typos
2019-12-31 06:43:27 +01: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
ecf5a67acc Fixes #2437 (#2438)
* Fixes #2437

getting the canonical atom ranking no longer results in molecules have a
RingInfo structure that's been initialized but contains nothing.

* update expected results for the MMPA tests
2019-05-10 08:25:31 +02:00
Brian Kelley
373a89021e Change boost int types to std types (#2233) 2019-01-22 17:45:03 +01:00
Brian Kelley
87dda6acd2 Fixes #1735 (#1743)
* Fixes #1735

I’m unsure if this is the correct solution, it appears
empty molecules never initialize their rings.

* Return immediately when ranking empty molecules

* Make github issue the correct one

* Always resize results to the number of atoms
2018-02-15 05:39:02 +01:00
Greg Landrum
ba12d98ad0 Removes ATOM/BOND_SPTR in boost::graph in favor of raw pointers (#1713)
* Removes ATOM/BOND_SPTR in boost::graph in favor of raw pointers

* Actually delete atoms and bonds...

* RWMol::clear now calls destroy to handle atom/bond deletion

* Changes broken Atom lookup for windows/gcc

* Adds tests for running with valgrind

* Adds test designed for valgrind and molecule deletions

* Removes RNG, actually tests bond deletions

* update swig wrappers

* deal with most recent changes on the main branch
2018-01-07 14:19:47 -05:00
Greg Landrum
f94e277856 another pass of clang modernize 2017-10-12 06:35:51 +02:00
Greg Landrum
87786c08b5 Merge branch 'master' into modern_cxx
# Conflicts:
#	.travis.yml
#	Code/GraphMol/FileParsers/MolFileParser.cpp
#	Code/GraphMol/FileParsers/MolFileStereochem.cpp
#	Code/GraphMol/ForceFieldHelpers/UFF/testUFFHelpers.cpp
#	Code/GraphMol/MolAlign/testMolAlign.cpp
#	Code/GraphMol/MolDraw2D/MolDraw2D.cpp
#	Code/GraphMol/MolDraw2D/Wrap/rdMolDraw2D.cpp
#	Code/GraphMol/QueryOps.cpp
#	Code/GraphMol/ROMol.cpp
#	Code/GraphMol/SmilesParse/test.cpp
#	Code/GraphMol/Trajectory/Trajectory.cpp
#	Code/GraphMol/Wrap/Atom.cpp
#	Code/GraphMol/Wrap/Bond.cpp
#	Code/GraphMol/new_canon.cpp
#	Code/RDGeneral/testDict.cpp
#	Code/SimDivPickers/Wrap/MaxMinPicker.cpp
2017-10-05 05:58:38 +02:00
Greg Landrum
4862c920a5 Fixes github1567 (#1576)
* Fixes #1567

* update expected results

* some cleanup and documentation
2017-09-19 08:04:18 -04: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
e625c58bab Add cis/trans tags to double bonds (#1316)
* add cis and trans to bond stereo

* compiles, does not work

* tests all pass

* Whitespace cleanup to recent changes.

* C++ test case for Bond::setStereo using Bond::STEREOCIS and Bond::STEREOTRANS

* Adding a PRECONDITION to Bond::setStereo to make sure the stereo atoms
are already specified if CIS or TRANS is being specified.

E/Z is technically defined by the topology of the molecule so the
stereo atoms are redundant (easier to understand and use!), but
ultimately redundant with the graph. However, CIS and TRANS is _only_
defined in this usage as the orientation of the atoms in the
getStereoAtoms vector.

* Exposing Bond::setStereo to Python and adding test cases to make sure
it can be used to set CIS/TRANS stereochemistry.

* verify substructure matching works

* Adding Bond::setStereoAtoms to C++ Bond class.

This allows setting the atoms to be considered for CIS or TRANS
directly without a much more costly determination of ranking that E/Z
requires.

* Wrap Bond::SetStereoAtoms into python with a new type of test case.

* docs
2017-02-26 08:15:44 -05: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
e37296d7c7 post review 2015-11-14 08:08:14 +01:00
Greg Landrum
5618819c64 merge #641 2015-11-14 05:03:24 +01:00
Nadine Schneider
624dd72ad6 new canon: fix in special symmetry invariant 2015-11-06 18:05:04 +01:00
Brian Kelley
5f59333a56 Silences unused parameters 2015-10-18 14:02:29 -04:00
Nadine Schneider
0a9680edac new canon: tune special graph invariant 2015-06-15 15:43:02 +02:00
Nadine Schneider
1e62f1a083 New canonicalization: two small fixes 2015-04-21 13:24:53 +02:00
Nadine Schneider
0b8b6a3690 Some performance fixes for the new canonicalization
- handling molecules/proteins with multiple fragments
- add criteria for using special symmetry invariant
2015-04-15 18:42:29 +02:00
Greg Landrum
97c0bcc202 safety first 2015-04-10 09:47:17 +02:00
Nadine Schneider
69ceace885 Bugfix in SpecialChiralityAtomCompareFunctor and additional tests
Conflicts:

	Code/GraphMol/hanoitest.cpp
2015-04-10 09:47:09 +02:00
Nadine Schneider
7ddff9c71c Some performance fixes 2015-03-20 18:19:08 +01:00
Nadine Schneider
95dae49968 Some bugfixes in new_canon
- Order of comparison in SpecialChiralityAtomCompareFunctor
- Handling of Bond::STEREOANY in the bondholder vector
2015-03-20 16:38:23 +01:00
Nadine Schneider
b8492cb698 Bugfix in canonicalisation of fragments 2015-03-20 16:38:23 +01:00
Nadine Schneider
e013399bb9 Bugfixes and new invariant for chiralAtoms 2015-03-06 15:47:08 +01:00
Nadine Schneider
0d90e31c46 New canon: new atom invariant also including neighbors 2015-02-12 18:08:03 +01:00
Nadine Schneider
465c7cb4c6 new_canon: Delete numRingMember invariant 2015-02-12 18:06:27 +01:00
Nadine Schneider
fca7e16078 Introduce new atom invariant for highly symmetric molecules/graphs 2015-02-12 13:03:36 +01:00
Nadine Schneider
8101c2e349 Fix in bondnolders 2015-02-12 09:42:36 +01:00
Nadine Schneider
2442d7cff3 Fix memleaks 2015-02-12 09:38:57 +01:00
Nadine Schneider
2b021d99e3 Update new_canon
-delete unnecessary calls of basecomp
-replace the reversing of vectors by introducing a compare greater function
-replace hasProp by getPropIfPresent
-remove code duplicates
2015-02-03 16:33:57 +01:00
Nadine Schneider
d82f30f5d4 Optimization canon 2015-02-02 12:53:19 +01:00
Greg Landrum
002d6f7cb0 minor optimization 2015-01-16 14:26:22 +01:00
Greg Landrum
1f4c2e915c fix a nasty canonicalization problem:
need to be sure to sort neighbors by their ranks in a *decreasing* order
2015-01-07 20:46:08 +01:00
Greg Landrum
633957a7fa further optimization work 2015-01-06 05:57:57 +01:00
Greg Landrum
6ea9029577 fragment smiles construction added. NOTE that bond symbols are no longer used in the canonicalization 2015-01-04 08:32:28 +01:00
Greg Landrum
52d44a1e47 At this point all C++ tests pass except the two postponed smiles tests dealing with fragment-smiles creation and the smiles test for issue 1844617 (this still needs to be tracked down and fixed).
The commit is just from an untabify run
2014-12-31 07:12:33 +00:00
Greg Landrum
ab0f1dcf60 rename to new_canon (probably should come up with a better name, but this will do for now) 2014-12-22 07:56:26 +00:00