Commit Graph

35 Commits

Author SHA1 Message Date
Ric
703fe5a225 Remove boost::foreach from public headers (#3820)
* remove include from headers

* update implementation files

* completely remove BOOST_FOREACH (#7)

* convert those changes to use auto

* get rid of all usage of BOOST_FOREACH

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2021-02-17 14:15:48 +01:00
Brian Kelley
bd00fda39e Fixes crashes when using bad smiles in the cached smiles holders (#3798)
* Fixes #3797

* Update Code/GraphMol/SubstructLibrary/SubstructLibrary.cpp

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>

* Update test to include positive and negative results

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2021-02-15 10:49:19 +01:00
Paolo Tosco
8030c36e5b Minor tweaks to SubstructLibrary (#3564)
* - added some missing const keywords
- added an addFingerprint overload to allow passing pointers
- added a test

* changes in response to review

* removed print

* added missing shared_ptr declaration

* added PatternNumBitsHolder serialization

* - merged with upstream changes and resolved conflicts
- got rid of PatternNumBitsHolder and leveraged the serialization version to get the PatternHolder to be backwards-compatible

* built substructLibV1.pkl with an older version of boost

* reverted serialization version to 1
only write numBits if != 2048 and only read numBits if it exists in the archive

* bogus commit just to trigger a rebuild
2020-12-09 19:42:38 -05:00
Paolo Tosco
c5dc6cc258 A few improvements to SubstructLibrary (#3557)
* - enable SubstructLibrary to build without threading support
- enforce consistency across single- and multi-threaded runs
- improve performance on single-threaded runs avoiding overhead of spawning threads
- consolidate internalCountMatches and internalGetMatches into one function to reduce code duplication
- fix a bug in Python CountMatches whjich would run on 1000 threads

* reverted Code/GraphMol/SubstructLibrary/Wrap/SubstructLibraryWrap.cpp as it is now in its own PR (#3558)

* - added missing cast
- removed unnecessary std::make_move_iterator
- added Brian's test

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2020-11-18 16:07:34 -05:00
Paolo Tosco
b2c3cd935a fixes bug in SubstructLibrary Python wrappers (see #3557) (#3558) 2020-11-09 10:08:26 -05:00
Cédric Bouysset
04a2be149f add newlines for code blocks + typo (#3475) 2020-10-13 05:09:34 +02:00
Greg Landrum
c0a62388a2 switch to using target_compile_definitions instead of add_definitions (#3350)
* switch to using target_compile_definitions instead of add_definitions

* missed one
2020-08-21 04:49:07 +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
Eisuke Kawashima
e86e2c1d5d Modernization: use nullptr (#3143) 2020-05-25 09:40:01 +02:00
Greg Landrum
45bf58754a Cleanup some cmake dependencies (#3077)
* change minimal cmake version to a consistent 3.5

* progress towards a cleanup

* get the basic python deps working

* two more libs

* another round of changes
all tests pass at this point

* next round of changes
all tests pass at this point

* close to done
all tests pass

* very close

* almost done

* shift the RDBoost dependencies around a bit

* remove an extraneous python linkage
this is trying to get the mac builds working again

* Only link to python if it was built shared (#3091)

* change in response to review

Co-Authored-By: Ric <ricrogz@users.noreply.github.com>

* move that suppression of the maybe-uninitialized warning to BoostStartInclude.h

Co-authored-by: Brian Kelley <fustigator@gmail.com>
Co-authored-by: Ric <ricrogz@users.noreply.github.com>
2020-04-17 14:34:23 +02:00
Brian Kelley
8fb99abc88 Fix/add patterns reset holders (#3033)
* Reset the mol and fp holders after calling AddPatterns

* Add test for seg fault
2020-03-25 06:36:00 +01:00
Brian Kelley
4c0a99f2ad Add multithreaded pattern/fp generator (#2973)
* Add threaded pattern generator to help speed up library creation

* Add size to FPHolderBase

* Add more complete python wrapper, fix leak in doctest

* Add basic usage test for addPatterns, fix I/O leak

* Add basic test for trusted smiles

* Actually add the new code

* Export addPatterns on windows

* Try fixing the cartridge build

* Change pattern_factory to PatternFactory

* Change boost::ref to std::ref
2020-03-04 09:41:03 -05: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
ecb8ecd8e9 Expose SubstructLibrary serialization stream (#2853)
* Exposes the stream interface for the substruct library

* Update SubstructLibraryWrap.cpp

* Adds docs

* Fix doctests

* Fixes another doc test

* More doc test fixes
2020-01-08 07:44:37 +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
09426cb664 add define for RDK_USE_BOOST_SERIALIZATION (#2859)
* add define for RDK_USE_BOOST_SERIALIZATION

* cleanup older explicit defines
2019-12-27 07:16:30 -05:00
Brian Kelley
c3db12e097 Fixes #2830 (#2831)
* Fixes #2830

* Reenable tests

* Response to review

* Add more tests and C++ tests
2019-12-15 06:42:31 +01:00
Greg Landrum
7e6600f3be Fixes #2516 (#2519)
* RDStreams now installed properly

* skip Wrap directories if RDK_BUILD_PYTHON_WRAPPERS is not set

Fixes #2516
2019-06-28 09:57:00 -04:00
Greg Landrum
ec31bea97b clang-tidy-7 pass (#2408) 2019-04-16 12:05:47 -04:00
Paolo Tosco
60ce95f07f - small fixes to get DLLs to build on Windows (#2356) 2019-03-18 05:33:39 +01:00
Greg Landrum
24f1737839 Remove a bunch of Python2-related warts (#2315)
* remove all of the "from __future__" imports

* remove the first batch of rdkit.six imports/uses

* next step of rdkit.six removal

* removing xrange, range, and some maps

* next round of removals

* next round of cleanups

* fix inchi test

* last bits of "from rdkit.six" are gone

* and the last of the six stuff is gone

* strange importlib problem
2019-03-06 20:43:49 -05:00
Brian Kelley
57a891bff2 Add serialization to SubstructLibrary (#2295)
* WIP - Substruct Library Serialization

* Add serialization to SubstructLibrary

* Add SubstructLibraryDefs

This holds the definition of whether the substruct 
library is serializable

* Wrap serialization in python

* Remove .h file, add .h.in file

* Configure header file into source dir

* Use RDConfig.h to configure serialization

* Move serialization code to seperate header file

* Fixes for review comments

* Removes some code redundancy

* Make pickling mols less memory intensive

* Check if molholders come back as the right types
2019-03-02 16:31:40 +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
Ric
91008ff11d Address compile warnings & trivial improvements (#2097)
* Address compile warnings & trivial improvements

* revert unwanted initializers; use RDUNUSED_PARAM for unused params

* revert fix in testRDFcustom; marked with 'TO DO' comment
2018-10-12 06:39:32 -04: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
Greg Landrum
2738c35178 Fixes #1903 (#1971)
* Fixes #1903

* update SWIG bindings too
2018-07-25 09:14:17 +02:00
Brian Kelley
5df4496696 Fix embarassing bug, check the counter each iteration not just after searching (#1939) 2018-06-29 09:02:34 -07: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
108d84ab1e Switch from boost::thread to std::thread (#1745)
* boost::thread mostly gone... still need to get rid of once
everything compiles

* replace boost::call_once

* remove link-time dependency on boost::thread

* first pass at using async

* switch to using async everywhere
2018-02-22 03:43:07 +01:00
Greg Landrum
636a0f6e69 Cleanup a bunch of compiler warnings (#1697)
* remove a bunch of compiler warnings

* remove some more warnings on windows (there are still plenty to go...)
2017-12-22 12:59:52 +01:00
Brian Kelley
1bef493512 Dev/substructlibrary docs (#1620)
* Adds substruct library documentation

* Adds testing of (fixed) documentation code

* Fixes typos and emphasizes the speed of trusted smiles

* Removes colons from parameters in docstrings, was causing warnings
2017-11-27 19:34:18 +00:00
Greg Landrum
1efa8e696e another clang-format run 2017-10-12 06:42:15 +02:00
Greg Landrum
f94e277856 another pass of clang modernize 2017-10-12 06:35:51 +02:00
Brian Kelley
90e9fd3459 Removes trailing spaces after \ to fix windows compilation errors (#1516) 2017-08-06 16:38:15 -04:00
Brian Kelley
d8722b1c64 First entry of the SubstructLibrary module (#1493)
* First entry of the SubstructLibrary module

* Switch to shared_ptrs for memory safety

* run clang-format and add a test

* only build when threadsafe_sss is enabled, only test when test_multithreaded is enabled

* Adds PRECONDITION

* Adds exceptions for out of range errors

* Changes getQueryBits to makeQueryBits for clarity

* Adds API point to add Binary and Smiles directly

* Replaces 0 with NULL for clarity.

* Removes debugging code.

* Makes endIdx non-inclusive

* Adds substruct searching options

* Adds preconditions

* Small documentation cleanup and removes a line of code.

* Add DataStructs library dependency

* Actually uses passed in parameters

* Adds TrustedSmiles/Binary inputs

* Adds more api testing options/trusted smiles and binary inputs

* Finalizes API adds docs and doctests

* Minor copyright fixes and such
2017-07-19 10:39:42 +02:00