75 Commits

Author SHA1 Message Date
Greg Landrum
e786ca231d Stop using raw pointers in the canonicalization interface (#8990)
* change count-type from pointer to ints to vector

* change type from pointer to ints to vector

* change type from pointer to ints to vector

* change type from pointer to ints to vector

* change type from pointer to ints to vector

* use std::fill only when necessary

* delete unnecessary includes

* reformat

* re-enable a test that was accidentally disabled a few years ago

* finish getting rid of the raw pointers

* include chrono

* changes from review

---------

Co-authored-by: Anna Brünisholz <anna.bruenisholz@gmail.com>
2025-12-12 14:00:23 +01:00
Ricardo Rodriguez
7b7a8a4e17 Refactor iostreams includes (#8846)
* refactor iostreams includes

* restore ostream to MonomerInfo.cpp
2025-10-08 16:08:01 +02:00
Greg Landrum
da6cd73168 Run clang-format across everything (#7849)
* run clang-format-18 across Code/*.cpp and Code/*.h

* run clang-format-18 across External
2024-09-26 13:39:02 +02:00
Greg Landrum
21b9ba1685 Fix a pathological slow case with the new getMolFrags() (#7121)
* backup

* revert changes to hanoitest.cpp

* don't just handle single-atom fragments

* polishing

* remove boost::timer

I used it to track down the problem
2024-02-06 04:23:48 +01:00
Eisuke Kawashima
11532089de Run clang-format against cpp (#4358) 2021-10-20 04:25:27 +02:00
Greg Landrum
170796a175 Fixes some problems with findPotentialStereo() (#3499)
* backup, definitely does not work

* remove obsolete test
(not even really sure anymore that's a bug)

* remove code from a false path

* at this point the code passes all tests

* backup

* handle isotopes and h counts properly

* remove some compiler warnings

* all tests passing

* Use InChI minimimum ring size for bonds

* Fixes edge-case bug in canonicalization when bond labels are provided

* cleanup, no substance here

* fixes the last set of problems I've seen

* document that this is still experimental

* remove obsolete/testing comments

* stop considering charge and H count in chirality
2020-10-17 04:35:58 +02:00
Paolo Tosco
7d0d7df5f0 Fixes a number of issues flagged by clang (#3498)
* - fixes a number of issues flagged by clang

* - removed commented line
2020-10-15 15:03:34 +02:00
Greg Landrum
19bdd21de1 Updated code for chirality perception (#3324)
* add new test (it fails, of course)

* isAtomPotentialTetrahedralCenter() there and tested
tests cases for molecular stereo written (but failing, of course)
create new_chirality.cpp, we will probably want to change this at some point
new StereoInfo structure

* more infrastructure
- isBondPotentialStereoBond()
- two getStereoInfo() functions
- associated unit tests

* backup

* oops

* backup

* switch to always using four atoms for bonds

* backup

* add new test (it fails, of course)

* isAtomPotentialTetrahedralCenter() there and tested
tests cases for molecular stereo written (but failing, of course)
create new_chirality.cpp, we will probably want to change this at some point
new StereoInfo structure

* more infrastructure
- isBondPotentialStereoBond()
- two getStereoInfo() functions
- associated unit tests

* backup

* oops

* backup

* switch to always using four atoms for bonds

* backup

* this now actually works

* doc update

* add a test to demo that ring stereo is not working

* more testing

* add a fun CIP test

* add review note

* debugging

* remove extraneous debugging
turn off tests for ring-double bond stereo

* disable the ring-stereo fix... this breaks a few tests, but we will recover

* works, needs cleanup, chirality code needs re-testing

* nothing works

* Fixes #3322

* Python and C++ tests now pass

* clang-format

* first pass at python wrappers

* improve doctest

* basic optimization...
stop with the copying

* rename

* all tests passing again

* optimization

* fix the sort in the tests

* looks like this might fix the windows-dll build problems

* update tests

* the fun never ends

* comment cleanup

* handle deliberately unspecified atoms/bonds

* add cleanIt option

* add flagPossible

* add option to use the new code to the SMILES parser

* additional testing

* additional testing

* a bit of additional testing never hurts

* changes in response to review

* fixes a bug with potential parastereo not being cleared

other changes in response to review

* update docs
2020-09-02 15:00:29 +02:00
Greg Landrum
45b9aef28b clang-tidy modernize-use-default-member-init and modernize-use-emplace (#3190)
* run clang-tidy with modernize-use-default-member-init

* results from modernize-use-emplace

* one uniform initialization per line
otherwise SWIG is unhappy

Co-authored-by: Brian Kelley <fustigator@gmail.com>
2020-05-28 09:07:58 +02:00
Greg Landrum
c346aa1492 removes usage of the deprecated random_shuffle() function in a couple of tests (#3187) 2020-05-26 08:45:57 -04: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
Brian Kelley
373a89021e Change boost int types to std types (#2233) 2019-01-22 17:45:03 +01:00
Ric
a6b26253ff Fix (most of) mem problems (#2123)
* do not use new on loggers

* del pointers in testDistGeom

* Update Dict hasNonPOD status on bulk update

* delete new Dicts in memtest1.cpp

* fixes in MolSuppliers and testFMCS

* PeriodicTable singleton as unique_ptr

* fix EEM_arrays leak

* fix leaks in testPBF

* fix ParamCollection leak in test UFF

* fix leaks in MMFF

* clear prop dict before read in in pickler

* fix leaks in testFreeSASA

* fix leaks in test3D

* modernize Dict.h & SmilesParse.cpp

* fix leaks in testQuery

* fix leaks in testCrystalFF

* fix leaks in cxsmilesTest

* fix leaks in Catalog & mol cat test

* fix leaks in ShapeUtils & tests

* fix leaks in testSubgraphs1

* fix leaks testFingerprintGenerators

* fix leaks in Catalog/FilterCatalog

* fix leaks in graphmolqueryTest

* these changes reduce bison parse leaks

* fixed leaks in testChirality.cpp

* fix leaks + 2 tests in testMolWriter

* fix 4m leaks in substructLibraryTest

* small improvements to molTautomerTest; still leaks

* fix leaks in testRGroupDecomp

* fix leaks in test; parser still leaks

* fix leaks in itertest

* fix 4m leaks in testDepictor

* fixes in smatest; still leaking due to parser

* fixes in testSLNParse; still leaking due to parser

* flex/bison: always add atoms with ownership; smarts error cleanup

* fix leaks in testReaction

* fix leaks in testSubstructMatch

* fix leaks in resMolSupplierTest

* fix leaks in testChemTransforms + bug in ChemTransforms

* fix leaks in testPickler

* fix leaks in testMolTransform

* fix leaks in testFragCatalog

* fix leak in testSLNParse. Still leaks due to Smiles

* fixed most leaks in testMolSupplier

* pre bison fix

* fix some atom & bond parse problems; others still fail

* bison smiles & smarts, atoms & bonds more or less fixed

* fix leaks in molopstest.cpp

* fix leaks in testFingerprints, MACCS.cpp & AtomPairs.cpp

* fix leaks in moldraw2Dtest1

* fix leaks in testDescriptors

* fix leaks in testInchi

* fix leaks in testUFFForceFieldHelpers

* fix leaks in hanoiTest & new_canon.h

* fix leaks in testMMFFForceField

* fix leaks in graphmolTest1

* fix leaks in testMMFFForceFieldHelpers

* fix leaks in testDistGeomHelpers

* fix leaks in testMolAlign

* initialize occupancy & temp facto with default values

* fix leak in TautomerTransform

* updated suppressions

* fix testStructChecker

* fix logging & py tests

* fix TautomerTransform class/struct issue

* remove misplaced delete in testSLNParse

* deinit in testAvalonLib1

* fix Avalon-triggered(?) bug in StructChecker/Pattern.cpp

* fix random testMolWriter/Supplier fails

- diversify output file names to avoid clashing.
- unify Writers close/destruct behavior.
- flushing/closing in tests.

* use reset in FFs Params.cpp

* comments on testMMFFForceField

* unrequired 'if's added to mol suppliers

* correct cast in FilterCatalog.h

* use unique_ptr in MACCS Patterns

* remove unrequred if in new_canon

* update & move suppressions
2018-10-29 14:33:26 +00:00
Paolo Tosco
f7c888844d moved test.h from RDBoost to RDGeneral for consistency with export.h (#2074) 2018-10-11 17:35:23 -04:00
Paolo Tosco
c08ea49bda - enable building DLLs on Windows (#1861)
* - enable building DLLs on Windows

* - export.h and test.h are now auto-generated by CMake
2018-05-16 08:42:41 +02: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
1efa8e696e another clang-format run 2017-10-12 06:42:15 +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
f7de91db05 Fixes #1423 (#1424)
* Fixes #1423

* hanoTest fails; otherwise ok

* remove a redundant dir spec on input

* address comments from review

* typo

* typo (sigh)
2017-07-02 10:27:45 +02:00
Greg Landrum
d5fd08369b Fixes #1423 (#1424)
* Fixes #1423

* hanoTest fails; otherwise ok

* remove a redundant dir spec on input

* address comments from review

* typo

* typo (sigh)
2017-06-03 09:32:07 -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
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Nadine Schneider
624dd72ad6 new canon: fix in special symmetry invariant 2015-11-06 18:05:04 +01:00
Nadine Schneider
0cf0dd37ce Bugfix in SmilesWrite and some additional tests for getMolFrags function 2015-04-16 10:53:20 +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
Nadine Schneider
0132cc72e9 Merge branch 'newCanon' into master3
Conflicts:
	Code/GraphMol/SmilesParse/test.cpp
2015-04-10 10:25:47 +02:00
Nadine Schneider
b4c230c7d0 new_canon: move hanoiSort to a seperate file 2015-04-10 09:47:17 +02:00
Nadine Schneider
ca4bcca6ae Include atom-mapping numbers if present in the canonicalization 2015-04-10 09:47:16 +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
7e59908121 SmilesWrite: introduce new function for 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
66fe6cf10f update and new canon tests 2015-02-12 13:05:59 +01:00
Nadine Schneider
d82f30f5d4 Optimization canon 2015-02-02 12:53:19 +01:00
Greg Landrum
38cab28eb6 add a couple fullerenes as renumbering tests 2015-01-28 01:26:15 +01:00
Greg Landrum
002d6f7cb0 minor optimization 2015-01-16 14:26:22 +01:00
Greg Landrum
27c6c61d9b At this point the hanoiTests pass and all 140K ZNP compounds pass the 50x torture test. 2015-01-16 05:08:36 +01:00
Greg Landrum
baf26c053c not fixed; still lots of debugging printing; backup commit 2015-01-09 06:33:49 +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
756404a0b0 re-enable some tests 2015-01-05 09:25:51 +01:00
Greg Landrum
48c5d0d6ff At this point all C++ tests pass 2015-01-03 06:42:54 +00:00
Greg Landrum
5a3e65fd30 at least the basics of stereochemistry are working
all hanoitest.cpp tests passing
chiralityTest.cpp failes still, so we are not done yet
2014-12-23 08:05:47 +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
Greg Landrum
cad05ca184 get rid of RankAtoms.cpp and
move the remaining functionality from RankAtoms.h into the new file
RDGeneral/Ranking.h
2014-12-22 07:35:58 +00:00
Greg Landrum
d11deb813b all hanoitest.cpp tests pass at this point.
The challenging dummy-atom case is commented out.
2014-12-22 06:47:15 +00:00
Greg Landrum
b286d4e601 better error reporting; but still not working 2014-08-27 04:05:45 +02:00
Greg Landrum
2f701327f2 backup 2014-08-25 05:50:50 +02:00