Commit Graph

34 Commits

Author SHA1 Message Date
Niels Maeder
db93262a3e Add safeSetattr to more params / options objects (#8842)
* add safeSetattr to varios params objects

* added safeSetattr to further params / options
2025-10-08 16:15:20 +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
Eisuke Kawashima
26033b6578 style: apply modernize-use-override (#8137)
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-04-25 12:24:58 +02:00
Riccardo Vianello
d6e8e473c1 fix GCC 13.2 warnings about redundant move in return statement (#7029) 2024-01-09 09:29:33 +01:00
Ric
891d597dc0 Fixes #6666 (#6667)
* fix issue

* revert pointer to ref in copy constructors
2023-08-29 17:29:01 +02:00
Paolo Tosco
350370abe3 - Changed all unsigned to unsigned int for clarity (#6646)
- Switched from dynamic to static allocation for an instance of `MCSParameters`
- Switched to using `auto` where possible
- Added a few `CHECK_INVARIANT` where appropriate before dereferencing pointers
- Moved some inline comments to the previous line to improve readability
- Added a early check for `CompleteRingsOnly` in `checkBondRingMatch()` to improve computational efficiency
- Removed `RingMatchTableSet` entirely as 1) it is unnecessary since its functionality is already provided by `RingInfo` 2) it abused the `userData` pointer. This allows cleaning up and simplifying the code, particularly the Python wrappers which had a significant amount of added complexity to support it
- Removed all the code that was deprecated several releases ago
- Reimplemented ringFusionCheck() from scratch to address several bug reports; also switched from std::set to boost::dynamic_bitset for better efficiency
- Replaced boost::tie with boost::make_iterator_range
- Modernized `for` loops where possible
- Removed entirely the QueryRings structure as its functionality is already available in RingInfo
- Removed entirely the _DFS() function since the same algorithm can be implemented in a simpler and more efficient way using RingInfo (from 2m28.441s to 2m9.859s for the same task)
- Replaced std::vector<bool> with boost::dynamic_bitset
- Replaced C-style casts with C++ casts
- Replaced some size_t with unsigned int
- Refactored checkIfRingsAreClosed() such that checkNoLoneRingAtoms() is not needed anymore
- Added a test for slow runtimes with CompleteRingsOnly
- Setting Timeout to 0 means no timeout, as it should be
- Removed unused `steps` variable from `MaximumCommonSubgraph::growSeeds`
- Storing both Atom and Bond pointers and their indices on Seed and MCS data structures is time-consuming and a potential source of incons
istencies; storing pointers is sufficient
- Promoted `MaximumCommonSubgraph::match` from `private` to `public`
- `NewBonds` was declared `mutable`, but `Seed::fillNewBonds()` was incorrectly declared as `non-const`, which caused the need for an ugly
(and unnecessary) `const_cast`.
I have now removed the `const_cast` and correctly declared functions that alter `NewBonds` as `const`, since `NewBonds` is explicitly `mut
able`
- Removed some useless random scoping that was peppering the MCS code
- Removed a significant amount of duplicate code from the Python wrappers by inheriting from a base `PyMCSWrapper` class
- Fixed #6082
- Fixed #5510
- Fixed #5457
- Fixed #5440
- Fixed #5411
- Fixed #3965
- Fixed #6578

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2023-08-25 06:09:19 +02:00
Braxton
2235a790c0 3D MCS - Minimal version, no refactoring (#3749)
* 3D MCS

* Move test data to dedicated directory

* 3D MCS: changes based on code review

* Replace conformer generation code in MCS 3D test with mol blocks
2021-01-26 04:50:05 +01:00
Paolo Tosco
7fc8feee9e Addresses #3693 (#3695)
* addresses #3693

* change in response to review

* applied clang -format

* changes in response to discussion
2021-01-07 18:25:08 +01:00
Paolo Tosco
be0f5b01f4 fixes #3635 (#3638) 2020-12-17 05:47:13 +01:00
Paolo Tosco
ebd384347c Use operator() and __call__() consistently across RDKit (#3295)
* Changed the callback() and compare() functions to operator() (C++)
and __call__() (Python) for consistency. The old functions are
deprecated and will be removed in Release 2021.01

* changes in response to review
2020-07-23 14:15:58 +02:00
Paolo Tosco
a6cafc4635 Added support for Python FMCS functors (#3023)
* Added support for Python FMCS functors

* - changes in response to review
2020-03-23 11:20:57 +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
Paolo Tosco
c6503e9f8e Use query molecule rather than ambiguous SMARTS for MCS matching (#2759)
* - MatchFusedRings does not imply CompleteRingsOnly anymore

* - use a more specific query molecule rather than an ambiguous SMARTS string in MCSResult

* - changes in response to review
2019-12-16 04:57:54 +01:00
Paolo Tosco
ab021aa960 Add consideration of ring fusion to the MCS algorithm (#2731)
* - Adds consideration of ring fusion to the MCS algorithm

* - removed some commented out lines
2019-10-25 04:35:10 +02:00
Steve Roughley
710bdfa60b Added AtomComparator.AtomCompareAnyHeavyAtom and test cases to FMCS code (#2656)
* Added AtomComparator.AtomCompareAnyHeavyAtom and test cases to FMCS code

* Added AtomComparator.AtomCompareAnyHeavyAtom

* Added AtomComparator.AtomCompareAnyHeavyAtom - fixed test typo

* Added AtomComparator.AtomCompareAnyHeavyAtom and test cases to FMCS code (2)

* Added AtomComparator.AtomCompareAnyHeavyAtom - fixed test cases

* Added AtomComparator.AtomCompareAnyHeavyAtom and test cases

* Update Code/GraphMol/FMCS/FMCS.cpp

Co-Authored-By: Greg Landrum <greg.landrum@gmail.com>

* Reverted tabs to 4 spaces

* Update FMCS.cpp
2019-10-03 17:19:22 +02:00
Greg Landrum
50d2328251 Fixes #2034 (#2035)
* Fixes #2034

* update release notes to describe that
2018-09-17 06:50:54 +02:00
Greg Landrum
7c0bb0b743 clang-tidy output 2017-04-22 17:09:24 +02:00
Greg Landrum
4001b2ba0e Add the option to match formal charges to FMCS (#1311)
* very basics of charge checking in

* add the new parameters to the python wrapper. more testing please

* Additional testing.

* update which unittest methods are used
2017-02-28 08:49:28 -05:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Brian Kelley
403a3d6b7c Suppresses Boost warnings 2015-10-18 13:41:03 -04:00
Greg Landrum
e6414e772a release the GIL before MCS 2015-08-28 15:59:33 +02:00
Greg Landrum
56d1e78b3b cleanup the python->C++ call; add support for the seed argument; add a test for the seed argument 2015-08-25 14:40:24 +02:00
Alexander Savelyev
b0177a4ea1 restore java and python wrappers. New parameter (matchChiralTag) was added. New function findFMCS_P() receives json parameters 2015-04-10 16:24:58 +03:00
Alexander Savelyev
c6be709dad fix fmcs comparator functions 2015-03-30 18:26:48 +03:00
Greg Landrum
7cb35fd5a4 Fixes #397 2014-12-09 06:39:33 +01:00
Greg Landrum
0480778575 add some docs 2014-08-24 07:01:41 +02:00
Greg Landrum
a02b7227f3 support the matchValences argument from python 2014-08-09 07:12:46 +02:00
Greg Landrum
7a2687e0c1 reformat code 2014-07-22 03:34:19 +02:00
Greg Landrum
f4da8d91d8 support completeRingsOnly and ringMatchesRingOnly from Python 2014-07-01 06:19:40 +02:00
Greg Landrum
c9b91cd744 code formatting changes (indentation and untabify) 2014-07-01 05:48:51 +02:00
Greg Landrum
ae0388cfba start to support atom and bond comparators 2014-06-09 23:43:44 +02:00
Greg Landrum
2e76e787ff start supporting arguments to FindMCS 2014-04-07 11:17:19 +02:00
Greg Landrum
deb3f65976 very crude first pass 2014-04-07 10:20:34 +02:00
Greg Landrum
183f1c8e5b add stubs for python wrapper 2014-04-07 09:56:52 +02:00