108 Commits

Author SHA1 Message Date
Ricardo Rodriguez
92d5d2c657 Refactor to stop using iterator definitions in types.h (#9275)
* clean up iterator defs in types.h

* do not use auto for inline constexpr

* restore undef max,min

* restore types.h declarations
2026-05-21 19:19:38 +02:00
Eisuke Kawashima
e89c9f656a style: apply readability-braces-around-statements (#8136)
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2026-02-09 12:10:50 +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
Ricardo Rodriguez
a4b63d7df5 Minor refactor of the python wrappers (#8847)
* refactor python wrappers

* fix FilterHierarchyMatcher converted already registered warning
2025-10-05 09:42:31 +02:00
Greg Landrum
ebd7dad122 Switch a bunch of C++ tests to use catch2 (#8625) 2025-07-18 11:50:38 +02:00
Andrey Alekseenko
b90b937c9f Fix buffer size in pickersCLI.cpp (#8282)
Was a bit too diabolical.

`fgets` reads size-1 bytes and writes `\0` after it, so we should be fine with `sizeof(buffer)` here, which also more resilient to future errors than any duplicated value.
2025-02-21 06:04:15 +01:00
Hussein Faara
44364fd982 remove no-op macros and dead code (pt 4) (#8037)
* remove no-op macros and dead code (pt 4)

* review comments
2025-01-26 07:49:50 +01:00
Eisuke Kawashima
41a2a79fa8 fix: apply modernize-use-nullptr (#8134)
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-01-09 07:56:10 +01:00
Ricardo Rodriguez
1201f214c4 One final round of mem errors (#7943)
* fix descriptors

* fix filtercatalog wrapping

* fix Chem reaction enumeration

* register shared_ptr

* change order of declarations

* fixleaks in SimDivPickers

* Manage ptr arrays in ForceField/BFGSOpt
2024-10-29 06:46:43 +01:00
Ric
76dc14cf0a fix check (#7002) 2023-12-22 05:02:38 +01:00
Paolo Tosco
2b4202867e Add Python modules to generate stubs and automatically patch docstrings (#6919)
* - added gen_rdkit_stubs Python module to generate rdkit-stubs
- added patch_rdkit_docstrings Python module to patch existing C++ sources to fix docstrings missing self parameter and add named parameters taken from C++ signatures where possible
- added rdkit-stubs/CMakeLists.txt to build rdkit-stubs as part of the RDKit build
- added an option to CMakeLists.txt to enable building rdkit-stubs as part of the RDKit build (defaults to OFF)

* fixed CMakeLists.txt, rdkit-stubs/CMakeLists.txt and a doctest

* - added missing cmp_func parameter
- fixed case with overloads with optional parameters
- do not trim params if expected_param_count == -1
- add dummy parameter names if we could not find any
- keep into account member functions when making up parameter names
- address __init__ and make_constructor __init__ functions
- fix incorrectly assigned staticmethods

* patched sources

* address residual few remarks

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2023-11-30 04:54:18 +01:00
Greg Landrum
2957ab4576 switch to catch2 v3 (#6898)
* switch to catch2 v3
Fixes #6894

* fix a couple of problems noticed in the CI builds

* more warning cleanup

* changes in response to review
2023-11-15 06:45:42 +01:00
Ric
880a8e5725 Reformat Python code for 2023.03 release (#6294)
* run yapf

* run isort

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2023-04-28 06:53:56 +02:00
Greg Landrum
0147cd8201 Fixes #5210 (#5408)
* revert duplicate chunk in release notes

* replace deprecated ifdefs
This one gets rid of USE_BUILTIN_POPCNT and RDK_THREADSAFE_SS
use RDK_OPTIMIZE_POPCNT or RDK_BUILD_THREADSAFE_SSS instead

* get rid of BUILD_COORDGEN_SUPPORT from ROMol.i

* fix a stupid typo

* update release notes
2022-07-11 11:20:03 +02:00
Greg Landrum
594c58f86c make the catch tests build faster (#5284)
* reorg the catch tests
the goal here is to make the builds faster

* make that easier
2022-05-17 04:39:33 +02:00
Eisuke Kawashima
27f711a658 Run clang-tidy (readability-braces-around-statements) (#4977)
https://github.com/rdkit/rdkit/pull/3024#discussion_r526549843
2022-03-10 08:00:10 +01:00
Eisuke Kawashima
b53ee20b49 Fix Flake8 erorrs (#4252)
* Fix PEP8 [E101](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [E502](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [E703](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [E711](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [E712](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [E713](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [E722](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [W605](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)
2022-03-10 06:55:18 +01:00
Greg Landrum
235df5c592 enable the multithreaded LeaderPicker on linux (#5043)
* enable the multithreaded leaderpicker on linux

* response to review
2022-02-25 07:25:48 -05:00
Eisuke Kawashima
11532089de Run clang-format against cpp (#4358) 2021-10-20 04:25:27 +02:00
Eisuke Kawashima
b9a5be5a2d miscellaneous updates (#4284)
* Remove accidentally tracked files and unset x flag

* Ignore ComicNeue

* Unify test tag to `reader`

* Trivial destructors

* Bump CMAKE_CXX_STANDARD to 14 (#4165)
2021-07-13 06:57:29 +02:00
Eisuke Kawashima
013ba4f21d Run clang-tidy (modernize-use-override) (#4251) 2021-07-01 05:18:56 +02:00
Eisuke Kawashima
78aac3c1bc Run clang-format against header files (#4143) 2021-06-08 07:57:51 +02:00
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
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
Eisuke Kawashima
75f03412ef Modernize deprecated header inclusion (#3137) 2020-05-04 10:40:57 +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
Paolo Tosco
2370f241a9 Removed dllexport from a function that lives in the anonymous namespace (#3027) 2020-03-23 15:07:51 +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
ec366c1ab7 Dev/pvs studio cleanups2 (#2877)
* a round of cleanups courtesy of PVS studio

* add a test to make sure that a warning is a false alarm

* bug fix

* Fix a UFF bug

* more PVS studio cleanups

* next round of PVS studio cleanups

* completely remove the chances for that bug

* changes in response to review

* add an additional test
+ a bit of reformatting that snuck in
2020-01-22 15:10:58 +01:00
Greg Landrum
a75018fe38 Cleanups and additional tests to improve test coverage (#2852)
* disable builds of the StructChecker code by default

* operator"" _smarts() doesn't need to catch sanitization errors

* remove unused function

* turn back on some tests that shouldn't have been disabled

* Remove unused code from SMARTS parser and simplify a bit

SmilesParseOps::AddFragToMol is now used only from the SMARTS parser, so we can simplify the API

* Removes obsolete special case code for SMARTS

This was relevant when organic atoms in SMARTS queries were stored as two-part queries.

* improve SMARTS testing

make sure we can generate SMARTS from all the examples and then parse that again.

* Fixes #2814

* Fixes #2815

* some additional smarts tests to improve coverage

* test copy ctor and getPos

* remove obsolete test_list files

* include tests for the morgan invariant generators

* more cleanups and coverage improvements

* remove files that were mistakenly added
2020-01-09 16:07:55 -05:00
Eisuke Kawashima
5cd27a242f Fix typo (#2862)
* Fix typo

* Reflect the comments

* Fix more typos
2019-12-31 06:43:27 +01:00
Eisuke Kawashima
7c6d9cf4e9 Unset executable flag (#2833) 2019-12-19 08:29:32 +01:00
Paolo Tosco
d714f5128f Fixes #2839 (#2840)
* - fixes #2839

* clang format
2019-12-11 16:22:53 +01:00
Paolo Tosco
fea3f00c3f - removed RDKIT_SIMDIVPICKERS_EXPORT which should not be there (#2740)
and prevents DLLs from building on Windows
2019-10-28 17:18:32 -04:00
Greg Landrum
5de8007b43 Merge branch 'e-kwsm-misc' 2019-10-25 04:49:23 +02:00
Greg Landrum
6cfc8f36a7 [WIP] Add Leader picker implementation (#2724)
* initial commit of Roger's contrib

* add the new file to the headers list

* clang-format

* stub of the python wrapper

* code added for testing

* code added for testing

* add LeaderPicker.seq.h

* default pickSize value

* first crude python wrapper

* Add C++ tests for the LeaderPicker
combine the thread and non-thread versions

* that was not really a test

* support providing a functor from Python

* no longer need the .seq header

* temporarily disable the threaded version to allow CI runs to pass

* some refactoring and cleanup
2019-10-24 13:14:15 +02:00
Eisuke Kawashima
185ec927ab Unset executable flag 2019-10-10 20:18:43 +09: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
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
Greg Landrum
699f0b8c5b fix a problem with the random pickers test (#2310) 2019-03-04 22:34:25 -05:00
Greg Landrum
4d14a819e6 Fixes #2245 (#2250)
* not yet done

* update docs, python tests, and the release notes

* updates in response to review
2019-01-31 00:03:39 -05: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
Dan N
8bed437c5f Addresses several minor warning messages during the build (#1935)
* Address minor compilation warning messages

Addresses trivial compilation warning messages:

    [ 11%] Building CXX object Code/GraphMol/CMakeFiles/GraphMol.dir/AddHs.cpp.o
    rdkit/Code/GraphMol/AddHs.cpp:497:9: warning: unused variable 'dblBond' [-Wunused-variable]
      Bond *dblBond = nullptr;
            ^
    1 warning generated.

    [ 11%] Building CXX object Code/GraphMol/CMakeFiles/GraphMol.dir/Chirality.cpp.o
    rdkit/Code/GraphMol/Chirality.cpp:1738:62: warning: unused parameter 'mol' [-Wunused-parameter]
    bool isBondCandidateForStereo(const Bond *bond, const ROMol &mol) {
                                                                 ^
    1 warning generated.

    [ 44%] Building CXX object Code/GraphMol/CMakeFiles/graphmolMolOpsTest.dir/molopstest.cpp.o
    rdkit/Code/GraphMol/molopstest.cpp:4694:12: warning: unused variable 'nm' [-Wunused-variable]
        ROMol *nm = MolOps::renumberAtoms(*m, nVect);
               ^
    rdkit/Code/GraphMol/molopstest.cpp:6941:16: warning: unused variable 'm' [-Wunused-variable]
            RWMol *m = SmilesToMol(smiles);
                   ^
    2 warnings generated.

    [ 42%] Building CXX object Code/GraphMol/CMakeFiles/graphmoltestPicklerGlobalSetting.dir/testPicklerGlobalSettings.cpp.o
    rdkit/Code/GraphMol/testPicklerGlobalSettings.cpp:257:14: warning: unused parameter 'argc' [-Wunused-parameter]
    int main(int argc, char *argv[]) {
                 ^
    rdkit/Code/GraphMol/testPicklerGlobalSettings.cpp:257:26: warning: unused parameter 'argv' [-Wunused-parameter]
    int main(int argc, char *argv[]) {
                             ^
    2 warnings generated.

    [ 55%] Building CXX object Code/GraphMol/FilterCatalog/CMakeFiles/FilterCatalog.dir/FunctionalGroupHierarchy.cpp.o
    rdkit/Code/GraphMol/FilterCatalog/FunctionalGroupHierarchy.cpp:176:20: warning: unused variable 'NUM_FUNCS' [-Wunused-const-variable]
    const unsigned int NUM_FUNCS =
                       ^
    1 warning generated.

    [ 84%] Building CXX object Code/GraphMol/StructChecker/CMakeFiles/StructChecker.dir/ReCharge.cpp.o
    rdkit/Code/GraphMol/StructChecker/ReCharge.cpp:405:17: warning: unused variable 'atom' [-Wunused-variable]
        const Atom &atom = *Mol.getAtomWithIdx(i);
                    ^
    1 warning generated.

    [ 84%] Building CXX object Code/GraphMol/StructChecker/CMakeFiles/StructChecker.dir/Tautomer.cpp.o
    rdkit/Code/GraphMol/StructChecker/Tautomer.cpp:61:12: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
        if (-1 == ti || -1 == tj) continue;
            ~~ ^  ~~
    rdkit/Code/GraphMol/StructChecker/Tautomer.cpp:61:24: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
        if (-1 == ti || -1 == tj) continue;
                        ~~ ^  ~~
    2 warnings generated.

    [ 88%] Building CXX object Code/GraphMol/RGroupDecomposition/CMakeFiles/testRGroupDecomp.dir/testRGroupDecomp.cpp.o
    rdkit/Code/GraphMol/RGroupDecomposition/testRGroupDecomp.cpp:428:9: warning: unused variable 'res' [-Wunused-variable]
        int res = decomp.add(*mol);
            ^
    1 warning generated.

    [ 96%] Building CXX object Code/SimDivPickers/CMakeFiles/testSimDivPickers.dir/testPickers.cpp.o
    rdkit/Code/SimDivPickers/testPickers.cpp:19:10: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
      return abs((double)i - (double)j);
             ^
    rdkit/Code/SimDivPickers/testPickers.cpp:19:10: note: use function 'std::abs' instead
      return abs((double)i - (double)j);
             ^~~
             std::abs
    1 warning generated.

* Close open file handles during build set-up

Under Python3, the update_pains.py file generated warning
messages like:

    == Done updating pains files
    /Code/GraphMol/FilterCatalog/update_pains.py:140: ResourceWarning:
unclosed file <_io.TextIOWrapper
name='/Code/GraphMol/FilterCatalog/../../../Data/Pains/wehi_pains.csv'
mode='r' encoding='UTF-8'>
      for smiles, name in csv.reader(open(PAINS_CSV)):
    /Code/GraphMol/FilterCatalog/update_pains.py:169: ResourceWarning:
unclosed file <_io.TextIOWrapper
name='/Code/GraphMol/FilterCatalog/pains_a.in' mode='r'
encoding='UTF-8'>
      t = open(filename).read()
    /Code/GraphMol/FilterCatalog/update_pains.py:169: ResourceWarning:
unclosed file <_io.TextIOWrapper
name='/Code/GraphMol/FilterCatalog/pains_b.in' mode='r'
encoding='UTF-8'>
      t = open(filename).read()
    /Code/GraphMol/FilterCatalog/update_pains.py:169: ResourceWarning:
unclosed file <_io.TextIOWrapper
name='/Code/GraphMol/FilterCatalog/pains_c.in' mode='r'
encoding='UTF-8'>
      t = open(filename).read()
2018-06-26 13:57:22 -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
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