65 Commits

Author SHA1 Message Date
Ricardo Rodriguez
d5aa90e18f Fix for issue #8965 (#8968)
* add a test

* change stereo bond canonicalization

* update canonicalization watch test with fixed cases

* make canonicalization test stricter (compare CIP codes)

* add reverse symmetry condition

* rewrite double bond canonicalization code

* update tests

* fix multiline comment

* update java tests

* update python test

* nix switchBondDir (unused)

* fix and rename flipBondDir

* refactor comment

* fix shadowed var name, casting

* fix neighbor sorting

* make seen_bonds a vector

* abstract setDirectionFromNeighboringBond

* handle both sides of the bond have directions

* move getNeighboringStereoBond

* check seen_bonds after popping connectedBondsQ

* use references for arguments

* add release note

* add example required by Dan

* add example requested by Dan
2026-02-26 08:58:36 +01: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
Paolo Tosco
3542b3ffbb Fixes #8569 (#8588) 2025-07-21 23:45:09 -04:00
Ricardo Rodriguez
1b0a20c372 Fix shifting of a potentially negative number (#8014)
* fix shifting a potentially negative number

* add a test

* fix signed comparison
2024-11-24 06:50:16 +01: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
tadhurst-cdd
d5d4d194ec atropisomer handling added (#6903)
* atropisomer handling added

* fixed non-used variables,  linking directives

* BOOST LIB start/stop fixes, linking fix

* Fixes for RDKIT CI errors

* minimalLib fix

* changed vector<enum> for java builds

* check for extra chars in CIP labeling

* removed wrong deprecated message

* fix ostrstream output error?

* restored _ChiralAtomRank to lowercase first letter

* changes for merged master

* Fixed catch label for new Catch package

* update expected psql results

* get swig wrappers building

* restore MolFileStereochem to FileParsers

* fix java wrapper for reapplyMolBlockWedging

* some suggestions

* move a couple functions out of Bond

* Merge branch 'master' into pr/atropisomers2

* merged master

* Renamed setStereoanyFromSquiggleBond

* atropisomers in cdxml, rationalize atrop wedging, stereoGroups in drawMol

* fix for CI build

* attempt to fix java build in CI

* attempt to fix java build in CI #2

* New routine to remove non-explicit  3D-geneated chirality

* changed to use pair for atrop atoms and related bonds

* Changes as per PR reviews

* PR review respnses

* PR review reponse - more

* Fix merge from master

* fixing java ci after merge

* Updated the help doc for atripisomers

* update the atropisomer docs

* improve the images

* add the source CXSMILES

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2023-12-22 04:58:18 +01:00
Brian Kelley
ee8c35a236 Removing stereoatoms requires removing CIS/Trans stereo flags (#6901)
* Removing stereoatoms requires removing CIS/Trans stereo flags

* Added test when removing nbrs of cis/trans bonds

---------

Co-authored-by: Brian Kelley <bkelley@relaytx.com>
2023-11-21 08:01:37 +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
Paolo Tosco
744bdb3355 windows.h header should be lowercase to avoid issues when (#5712)
cross-compiling on Linux
2022-10-31 06:43:57 +01:00
Greg Landrum
b440dc30d2 Fix a number of crashing bugs in the python wrappers (#4810)
* fix a crashing bug in SubstructLibrary

* fix a bunch of other potential seg faults
These are all places where the result from pyObjectToVect(),
which can legitimately return a nullptr, is not checked before
being dereferenced.

* document behavior
clear the result vector for the other pythonObjectToVect() overload

* change error message
in response to review
2021-12-27 16:09:06 -05:00
Greg Landrum
3193b76d8c cleanup some compiler warnings (#4521)
* cleanup some clang warnings

* get rid of some VC++ warnings
2021-09-16 04:34:40 +02:00
Greg Landrum
69b143edd0 Swap from RDUNUSED_PARAM to unnamed parameters (#4433)
* cleanup

* more cleanup
2021-08-24 17:19:46 -04: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
Greg Landrum
9892f4740b remove usage of auto_ptr (#3188) 2020-05-26 08:45:26 -04: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
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
Eisuke Kawashima
5cd27a242f Fix typo (#2862)
* Fix typo

* Reflect the comments

* Fix more typos
2019-12-31 06:43:27 +01:00
Eisuke Kawashima
dc7cc84a0c Fix typo [ci skip] 2019-10-17 17:45:50 +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
ecf5a67acc Fixes #2437 (#2438)
* Fixes #2437

getting the canonical atom ranking no longer results in molecules have a
RingInfo structure that's been initialized but contains nothing.

* update expected results for the MMPA tests
2019-05-10 08:25:31 +02: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
Noel O'Boyle
213b6317f9 Rename the #define _DEBUG to MMPA_DEBUG as _DEBUG is defined bu MSVC whenever a Debug build is specifed, but that is not the intention here. (#2140) 2018-11-15 07:47:13 +01: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
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
f35e04403a replace the usage of rdk_auto_ptr with std::unique_ptr (#1752)
That is what was being used for modern c++ anyway
2018-02-14 19:49:47 -05:00
Greg Landrum
ba12d98ad0 Removes ATOM/BOND_SPTR in boost::graph in favor of raw pointers (#1713)
* Removes ATOM/BOND_SPTR in boost::graph in favor of raw pointers

* Actually delete atoms and bonds...

* RWMol::clear now calls destroy to handle atom/bond deletion

* Changes broken Atom lookup for windows/gcc

* Adds tests for running with valgrind

* Adds test designed for valgrind and molecule deletions

* Removes RNG, actually tests bond deletions

* update swig wrappers

* deal with most recent changes on the main branch
2018-01-07 14:19:47 -05: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
Greg Landrum
67bc7a647c merge on master; modernization needs to be repeated 2017-09-05 17:09:50 +02:00
Brian Kelley
7c704c14de Adds canonicalization of atom maps (#1521)
* Adds canonicalization of atom maps

* Removes debugging statments and commented out code

* Fixed bad mapping of mmps with no cores (1-cut), remove sanitization
2017-08-12 05:36:09 +02:00
Greg Landrum
c234935b0e fix a typo 2017-04-23 05:46:54 +02:00
Greg Landrum
f6ced134f0 a number of other small changes from manually reviewing the PR 2017-04-22 17:24:57 +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
ea8d7e68f9 Dev/rdmmpa api update (#1291)
* Adds FragmentMol with minCuts specified

* Adds ability to cut by bond indices as opposed to smarts patterns

* Fixed API (remove maxBondCuts when bonds are sent in)

* Adds bond api test

* Fixes docs

* Small doc change

* Removes cstdint

* Adds ValueError minor bond retrieval optimization

* Removes fragMolHelper4

* Tests ValueError

* py3 fix
2017-02-27 17:08:01 +01:00
gedeck
e9af48ffd7 Issue1071/yapf (#1078)
* Issue #1071: add yapf configuration file

* yapf formatting of Code directory

* yapf formatting of Contrib directory

* yapf formatting of Data directory

* yapf formatting of Docs directory

* yapf formatting of External directory

* yapf formatting of Projects directory

* yapf formatting of Regress directory

* yapf formatting of Scripts directory

* yapf formatting of Web directory

* yapf formatting of rdkit directory
2016-09-23 04:58:46 +02:00
Greg Landrum
adbfb5bd8b Fixes #1044 (#1077) 2016-09-23 04:57:27 +02:00
Paolo Tosco
dd871c3536 Modifications to enable building with MinGW compilers (#960)
* - added -DBOOST_SYSTEM_NO_DEPRECATED to definitions for MINGW builds
- modified a few #ifdef's to discriminate better between MINGW and MSVC
- added a ios::binary to Code/GraphMol/FileParsers/testMolSupplier.cpp
  (I already had to add some of those in the past to avoid the CR+LF issues on Windows)
- modified Code/GraphMol/FMCS/MaximumCommonSubgraph.cpp and
  Code/GraphMol/FMCS/FMCS.h because checking the function pointer does not
  work with DLLs as the function pointer changes upon different calls
- builds under MinGW with -DRDK_USE_BOOST_SERIALIZATION=OFF and
  RDK_BUILD_THREADSAFE_SSS=OFF

* - added the possibility to define MSVC_RUNTIME_DLL to point to the
  absolute path of an appropriate MSVC runtime DLL to enable
  multi-threaded builds with MinGW
- modified C++ and Python tests of the multi-threaded conformation
  embedder as under 32-bit MinGW lower numeric precision introduces minimal
  coordinate differences with result in ~1-kcal energy difference.
  Therefore the energy criterion has been made more lenient, and a
  coordinate MSD criterion has been introduce to compare substantial
  identity of conformations

* - reverted Code/GraphMol/DistGeomHelpers/Wrap/testDistGeom.py and Code/GraphMol/DistGeomHelpers/testDgeomHelpers.cpp
  to the upstream/master version
2016-06-25 09:12:40 +02:00
Greg Landrum
e04aed8ea8 another batch of warnings squashed 2016-03-30 13:44:21 +02:00
Greg Landrum
cf7ceab383 remove wave of warnings 2016-03-30 13:09:59 +02:00
Riccardo Vianello
d1f206e923 replace std::map::at with std::map::operator[] 2016-01-12 20:53:22 +01:00
kelley
f6416b5c80 Squashes MSVC _CRT_SECURE Warnings 2015-11-29 18:03:46 -05:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00