Commit Graph

200 Commits

Author SHA1 Message Date
Greg Landrum
6e838e3df3 Fixes #2479 (#2482)
* Fixes #2479

* a bit of cleanup

* catch some additional fun edge cases

* change in response to review
2019-06-07 12:44:51 -04:00
Paolo Tosco
1435510221 - fixes annoying warnings on MSVC (#2454) 2019-05-19 11:51:20 +02:00
Greg Landrum
17828cc2c9 make iostreams optional 2019-05-08 17:33:17 +02:00
Greg Landrum
ec31bea97b clang-tidy-7 pass (#2408) 2019-04-16 12:05:47 -04:00
Greg Landrum
b337415094 Fix github #2311 (#2394)
* Fixes #2311
at least I hope it does

* Stop using deprecated boost functionality

* allow the Murtagh module to import even if the code isn't built
update the associated tests

* update release notes

* typo

* fix integer division
2019-04-04 10:20:56 +02:00
Brian Kelley
75096ac33c [WIP] property custom handlers (#2293)
Allow custom type-handlers in the RDProps interface
2019-03-28 17:21:00 +01:00
Dan N
257945e2ba Update the type hint in types.h for _MolFileRLabel (#2365)
_MolFileRLabel are unsigned int, not int.
2019-03-24 07:59:58 +01:00
Dan N
9fe1094521 Addresses a build warning from a deprecated boost header (used internally in boost) (#2357) 2019-03-19 11:45:02 -04:00
Paolo Tosco
60ce95f07f - small fixes to get DLLs to build on Windows (#2356) 2019-03-18 05:33:39 +01:00
Ric
6224a42516 Build warnings revisited (#2318)
* unused vars in bison parser cleanup

* initialization order in TopologicalTorsionGenerator

* unused params in SLN bison

* sln flex unused params

* throwing destructor in TDTWriter

* signed comparison in substructmethods

* unused input param in smiles/smarts bison

* unused ms param in sln bison

* signed comparison in FingerprintGenerator

* store return of fscanf in StructCheckerOptions

* unreferenced var in catch

* uninitialized value in FileParserUtils

* avoid override overload warning in MolDraw2DSVG

* non-final overrides in Validate.h

* unused static var in Avalon

* unused vars in catch blocks

* make AvalonTools avalonSimilarityBits & avalonSSSBits const int

* assert fscanf result in StructCheckerOptions
2019-03-08 16:42:54 +01:00
Greg Landrum
6bd17e94ed Fixes #2308 (#2309)
* Fixes #2308

* move the definition to the .cpp file.
add a few more tests
2019-03-04 22:33:43 -05:00
Brian Kelley
ada0ef5e75 Fix to serialize binary strings (#2264)
* Fix to serialize binary strings

* Use stringstream instead of files for pickle tests
2019-02-13 18:10:47 +01:00
Greg Landrum
cb35234f8c keep extra information about bonds from Mol files (#2260) 2019-02-11 15:19:37 -05: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
Greg Landrum
c59d586431 Fixes #2040 (#2085)
* does not yet really work

* tests pass

* store the info about the attachment points in case we want to use it later.

* add a couple more tests; changes in response to review
2018-10-08 22:27:48 +02:00
Greg Landrum
37f3443899 move rdInfoLog to stderr (#2073) 2018-10-02 11:43:08 -04:00
Brian Kelley
e92ee9724b Fix memory leak in Dict operator= (#2061)
* Fix memory leak in Dict operator=

* Reenable old tests

* Don't overwrite nonPodData until the last moment

* Fix previous bug.  Need to check other._hasNonPodData, not our own
2018-09-28 14:03:04 +02:00
Greg Landrum
f0c0e6a035 Resolve #1269 (#1991)
* this is not anything like done

* Adjust reduceProductToSidechains() to the change

* reformatting

* switch to using global properties
2018-09-04 10:24:27 -04:00
Greg Landrum
2738c35178 Fixes #1903 (#1971)
* Fixes #1903

* update SWIG bindings too
2018-07-25 09:14:17 +02:00
Greg Landrum
4613d1a123 Fixes #1950 (#1958)
* Fixes #1950

* Changes from review:
- replace MolAtomList with MolAtomQuery
- support MRV SMA as well
2018-07-17 09:11:02 -04:00
Greg Landrum
77078eac66 Add an auto-populated file with cmake config options (#1874)
* this is a rough first pass, needs to be finished and is a strong argument for changing the names of some of the #defines that are currently used

* rationalize the rest of the #defines
add something to the release notes about this
2018-06-09 05:41:28 +02:00
Paolo Tosco
a179dc9514 Fixes locale handling on Windows (#1892)
* - fixes locale handling on Windows

* - removed comment which is no longer relevant
2018-06-09 04:29:36 +02: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
e36e4ee620 patch from Roger (#1856) 2018-05-10 05:03:57 +02:00
Greg Landrum
0959261f37 Fixes #1454 (#1838)
* Fixes #1454; still needs a bit more thinking though

* forgot the necessary version bump

* review related cleanup and a fix to allow the SWIG wrappers to be built
2018-05-07 09:48:47 -04:00
Dan W
3c3106bd7b Allow types.h to be included in applications that use /D_USE_MATH_DEFINES (#1846)
* spelling

* Allow types.h to be included in applications that set _USE_MATH_DEFINES

Our application defines _USE_MATH_DEFINES on the visual studio
compiler command line, so every compilation includes the macro
definition. Including types.h (or anything other RDKit header,
basically) causes compilation to fail with a "doubly defined
macro" error message.

This commit defines the macro locally and only if it is not already
defined
2018-05-05 04:47:24 +02:00
Greg Landrum
5cf8a6a9b7 Support for a JSON-based molecule interchange format (#1798)
* expose addRing to python

* backup commit

* basics of atom and bond loading

* basics of atom and bond loading

* do bond stereo too

* Loads of cleanups
Read conformers and molecule properties
Better tests
update one of the test values so that we aren't always testing ccw

* enable auto-download of rapidjson distrib

* reader now mostly done (still missing atomic/bond properties)

* a bit of optimization

* a bit of cleanup

* a bit more optimization

* backup

* test zero-order bonds

* prep work for writer (not done)

* add isotope support

* backup

* getting there with the writing

* progress on writing; still need to do the RDKit part though

* can now roundtrip, including chirality.
double bond stereo needs to wait for backend fixes

* add a timing test for benchmarking

* add a timing test for benchmarking

* add another template

* add parse params; optionally set bond types to aromatic; add python wrapper

* disable benchmark run by default

* write conformers

* refactoring

* docs

* port to commonchem

* switch representation

* start reading and writing properties

* fix a memory problem

* set a common_property for gasteiger charges

* parse partial charges

* add partial charge writing

* reformatting

* add support for disabling parts of the parsing

* remove the "name" property from files

* editing

* more post-review changes

* make the molinterchange build optional

* make them really optional
2018-04-02 05:12:03 +02:00
Greg Landrum
890886d770 speedup the NumBitsInCommon operation (#1785)
* patch to speedup tanimoto calculation

* make it build on windows

* cleanup a bit

* followup from review
2018-04-02 05:01:07 +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
6aba6c9db8 Fixes #1728 (#1731)
* Fixes #1728

* make me work on the mac
2018-02-10 06:16:44 +01:00
Brian Kelley
5fe9bbb780 Adds ability to read and parse marvin smarts in mol blocks 2017-12-22 08:20:31 -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
Brian Kelley
2fbf74c06e Fixes double free for Dict::update (#1571)
* Fixes double free for Dict::udpate

* fix a leak

* Dict.update now behaves like python's update (i.e. replaces existing values)
2017-09-16 04:44:50 +02:00
Brian Kelley
58ede0f81b Dev/rgroup decomp freefunction (#1557)
* Adds RGroupDecomp free function and python wrapper

* Fixes subtle bug, adds new RGroupDecomp API

* Updates results for the subtle bug fix.  Verified results were correct.

* Removes smilesCaching.

* Changes RGroupDecompose ordering, adds docstrings and more tests
2017-09-12 17:41:21 +02:00
Brian Kelley
7488840ac4 Fix/urange check (#1506)
* Fixes atom documentation

* Fixes #1461

This is a complicated one.  Basically URANGE_CHECK when
used on unsigned integers has a problem when the size of
the range it’s checking is 0.  The standard operations is
to check

URANGE(num, size-1)

Which (for unsigned integers) obviously rolls over.

This fixes all usage cases to be

URANGE(num+1, size)

And fixes the bugs found.  (addBond and the mmff tests)

* Fixes #1461 - Updates URANGE_CHECK to be 0<=x<hi
2017-09-11 21:17:33 +02:00
Brian Kelley
3d75f5c78f Fixes blanking of non-query atom data when QueryAtomData was being pi… (#1541)
* Fixes blanking of non-query atom data when QueryAtomData was being pickled

* Adds old version pickle test for properties

* Makes pickle py2 and py3 compatible
2017-09-07 20:43:08 +02:00
Greg Landrum
67bc7a647c merge on master; modernization needs to be repeated 2017-09-05 17:09:50 +02:00
Greg Landrum
12342c5643 merge to master 2017-07-21 04:50:35 +02:00
Greg Landrum
74ef00ec13 Remove xlocale header (#1501)
* do not include xlocale.h, as it was removed in glibc 2.26

According to
https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27
the defines were a subset of locale.h, that we include anyway

* Apparently, clang still needs the header

* include string header
2017-07-20 05:58:35 +02:00
Brian Kelley
6a76fc9381 Dev/add update props api (#1479)
* Adds RDProps updateProps API point

* AdjustQuery now copies over original atom data to the query ato

* Preserves existing data on the replacing atom

* Exposes preserveProps to Python replaceAtom/Bond
2017-07-10 04:38:59 +02:00
Brian Kelley
b76af93513 Dev/add update props api (#1479)
* Adds RDProps updateProps API point

* AdjustQuery now copies over original atom data to the query ato

* Preserves existing data on the replacing atom

* Exposes preserveProps to Python replaceAtom/Bond
2017-07-10 04:36:12 +02:00
Greg Landrum
d719159cdd get rid of a warning message 2017-07-03 05:14:18 +02:00
Alain Vaucher
5bdf2a3cf4 Add INTERFACE library, rdkit_base, against which all other rdkit libraries will link 2017-07-01 13:40:34 +02: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
Brian Kelley
287b3a1b36 Fix/rogers fixes (#1293)
* Fixes older apple/gcc builds spewing too many warning

* Fixes typo

* Removes  -Wno-unused-local-typedef from CMakeLists.txt
2017-02-27 16:28:12 +01:00
Brian Kelley
e70599a12e Dev/pickle properties (#1277)
* Adds pickling of properties (optional)

* Ignores RDKit::Dict::Pairs - previously private

* Fixes AllProps definition

* Fixes BondProps seperation

* Fixes reaction pickling - Adds ability to pickle atom + QueryAtom

* Bumps pickle version

* Removes fugly post-increments

* Changes Default to NoProps

* Tests more options for pickling

* Runs clang format

* Adds get/setDefaultPropertyPickleOptions, exposes to python

* turns tests back on.

* Fixes enum (clang was allowing c++11 semantics)

* Adds global settings test

* Code/GraphMol/testPicklerGlobalSettings.cpp
2017-02-09 16:06:01 +01:00