29 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
Brian Kelley
a7deb6fb8d Implements #8222 adds react_idx (index of reactant) to product atoms (#8231)
* Implements #8222 adds react_idx (index of reactant) to product atoms

* Remove react_idx from mol enumerator products

* Response to review, add test to ensure product only atoms aren't tagged

* Reenable tests
2025-02-06 17:07:55 +01:00
Greg Landrum
fa048eacc5 Replace GetImplicitValence() and GetExplicitValence() with GetValence() (#7926) 2025-01-28 21:09:03 +01:00
Ricardo Rodriguez
ea7f51f3b1 Fix some mem errors in 2024.09.1 (#7867) 2024-10-03 16:05:43 +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
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
Hussein Faara
fb6219c77e MolEnumerator: use repeat counts for SRUs when present #6429 (#6938)
* MolEnumerator: use repeat counts for SRUs when present #6429

This fixes the reported bug by parsing the SRU label to infer the rnage
of allowed repetitions.

* fix build failure from wrong field initialization order

* fix build error from -Werror=sign-compare

* add tests for molblock
2023-11-28 06:52:37 +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
Hussein Faara
abe991afda Used const reference to prevent copying in PositionVariationOp::getVariationCounts() (#6906) (#6907) 2023-11-14 12:29:59 +01:00
Greg Landrum
b325b3a9bb Support TautomerQuery and MolBundle queries in the cartridge (#6393)
* framework for extended query.

serialization works
to/from text doesn't work

* first pass at getting substructure search working

basic tests

improved error handling (try not to take down the server thread!)

* add serialization to MolBundle

* we really need to pickle mol properties

* basic support for molbundle

including substructure search

* tautomer and molbundle queries to JSON

* remove debug msg

* cleanup debug
initial index steps (not tested)

* remove indexing stuff since it wasn't working

will try to come back to that

* add xqm to update script

* add c++ testing for molbundle serialization

* add serialization of molbundles to python interface

* support expanding molbundles to arrays of tautomer queries

* edge cases

Signed-off-by: greg landrum <greg.landrum@gmail.com>

* change in response to review

* a bunch of updates

* make sure the mol props needed for XQMs are being serialized

* update update script

* fix binary string output from ExtendedQueryMols in python

* tautomer queries should serialize properties

* more testing never hurts

* combo of generic groups and generalized queries works

* Update Code/PgSQL/rdkit/adapter.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

* Update Code/PgSQL/rdkit/adapter.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

* Update Code/PgSQL/rdkit/adapter.cpp

Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>

* Fix weird quotes?

---------

Signed-off-by: greg landrum <greg.landrum@gmail.com>
Co-authored-by: Paolo Tosco <paolo.tosco.mail@gmail.com>
2023-08-23 06:32:06 +02:00
Greg Landrum
7576ab9092 Fixes #6432 (#6433) 2023-06-03 06:37:15 +02: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
0f88141c09 Propagate query features from reacting molecules to products (#6021)
* add tests

* remove a compiler warning

* Fixes #6015
Fixes #6014  (since it was due to #6015)

* fix a leak
2023-01-28 04:47:46 +01:00
Eisuke Kawashima
77db9ede80 fix doxygen comments (#5254) 2022-07-11 13:55:35 +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
Greg Landrum
fd1752e006 disable Info and Debug logs by default (#5065)
* disable the info and debug logs by default

* adjust tests to the newly disabled logs

* add LogStateSetter

* namespace reorg

* add some tests

* remove vestigial code

* switch to using std::vector
2022-03-12 10:04:28 +01: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
Greg Landrum
db15b372a1 Fix some problems turned up by ossfuzz (#4927)
* resolves oss-fuzz #24399

* clean up some undefined behavior

* fix some UB in mergeQueryHs

* be more defensive

* defensive programming

* fix a _cxsmilesBondIdx bug

* more defensive programming
2022-01-22 04:30:06 +01:00
Greg Landrum
22da97b836 Add support for SRUs to MolEnumerator (#4563)
* preliminary first pass at SRU enumeration

* handle HH

* working
plus add a missing file... <doh!>

* passes basic tests for enumeration of multiple non-overlapping SRUs

* more SRU testing

* explore combining the SRU enumeration with enumerate()

* first step towards RepeatUnit in the python interface

* first pass at directly connected SRUs

* Fixes #4561

* make sure we don't try to enumeration SRU + LINKNODE
update python docs

* exception for ladders

* get a bit smarter about rejecting linknode enumerations

* turns out we actually *can* do ladders pretty easily

* update java wrappers

* make sure we can input from CXSMILES too

* some cleanup/documentation

* some refactoring

* response to review
2021-09-28 16:37:39 +02:00
Greg Landrum
31f42429ff Fixes #4382 and #4381: two Enumeration related bugs (#4383)
* Fixes #4382

* Fixes #4381
2021-08-05 05:10:53 +02:00
Eisuke Kawashima
78aac3c1bc Run clang-format against header files (#4143) 2021-06-08 07:57:51 +02:00
Greg Landrum
2e3f31990d Allow batch editing of molecules: removal only (#3875)
* backup

* simple first pass, passes all tests

* cleanup a bunch of existing uses

* ensure that we can safely add atoms/bonds while in edit mode

* add context manager on python side

* handle exceptions properly in those

* changes in response to review
2021-03-11 05:10:43 +01:00
Greg Landrum
5ab7952303 Fixes #3844: MolEnumerator and link nodes (#3845)
* backup

* Fixes #3844
2021-02-24 05:15:24 +01:00
Greg Landrum
36dea7d737 support enumerating from lists of enumerators (#3664)
support enumerating all supported operations for a molecule
2020-12-25 05:14:46 +01:00
Greg Landrum
53782cc751 Support rendering LinkNodes (#3662)
* break out the LinkNode processing code

* initial version of linknode rendering

* add another test and fix a minor issue

* boost::format

* fix a bad merge
2020-12-21 15:29:17 +01: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
9bcd28a4ff MolEnumerator::enumerate() should call updatePropertyCache() (#3420) 2020-09-23 17:28:45 -04: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
73d26036de Support enumerating some mol file features into MolBundles (#3257)
* backup

* compiles

* progress, but not there yet

* basics now working

* start towards adding another test

* test having two variation points

* add actual enumeration and the corresponding tests

* docs and cleanup

* cleanups to get the mac build working

* attempt to get win32 dll builds to work

* dlls are fun

* Add FixedMolSizeMolBundle class

* changes in response to review

Also: add warnings for bad input in ParseV3000Array

* a bit of refactoring

* additional testing

* does not work, backup

* LINKNODES work now

* cleanup

* allow silencing reaction validation warnings during initialization

* docs

* fix (and test) handling of empty enumerations

* silence warnings when doing alchemy

* first pass at a Python wrapper for the enumerator

* Add Java wrappers for MolBundle and the MolEnumerator

* cleanup some comment formatting
2020-07-11 12:54:23 +02:00