Commit Graph

65 Commits

Author SHA1 Message Date
Greg Landrum
a2767d9f7d Allow custom post-match filters for substructure matching (#2927)
* backup, does not work

* working on the C++ side

* backup

* fix the API

* document the new functionality

* improve that example

* final bit of cleanup

* switch to std::function
2020-02-04 11:22:38 -05:00
Brian Kelley
68e8f10b95 Fixes #2510 (#2907)
* Fixes #2510

* Changes in response to review

* Use CoordsAsDouble, rev version

* Confs->coords in documentation

* conformations->coordinate
2020-01-28 05:07:31 +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
Dan N
378a223d66 Python wrap enhanced stereo setters (#2509)
* Allow creation of Enhanced Stereo groups from Python

This wraps creation of Enhanced Stereo groups from Python. It
also allows setting enhanced stereo groups on an RWMol from
Python.

Additionally, this provides a little function to allow C++
vectors to be wrapped for Python, but allow Python list objects
or wrapped C++ vectors to be used as arguments to functions
that take vectors as inputs. I added it only to
Wrap/StereoGroup.cpp, but I _think_ that I should add this
logic to RegisterVectorConverter in RDBoost/Wrap.h. If I
did that, I'd be able to remove a couple of lines in Wrap/Mol.cpp

* enforce atom ownership in SGroups
Some cleanups to make sure you can't add an S group with bogus atoms
to a molecule

* Remove constructor for StereoGroup.

I tried very hard to convince boost Python to allow me to use
with_custodian_and_ward_postcall on an init, and it just never
worked. I've removed the constructor - folks will need to
use the factory function "CreateStereoGroup" if they want
a StereoGroup.
2019-07-03 10:24:26 +02:00
Greg Landrum
a102eaf932 Add options for substructure searching (#2254)
* first pass at adding a SubstructMatchParameter struct

* start moving the rest of the backend to use the parameters

* backend at least mostly moved over

* add aromaticMatchesConjugated
add tests

* switch over the MolBundle too
Add templates to reduce duplicated code

* support older compilers

let's see if it works...

* add SubstructMatchParameters to Python wrapper

* remove some deprecations and warnings

* damn compilers

* parameter support for bundles in python wrapper

* add the parameters to the java wrappers

* response to review
2019-02-08 09:10:10 -05:00
Brian Kelley
fe3096cffa Fixes #2240 (#2241)
* Fixes #2240

* Fix for boost python variants

* Revert unneeded constructor
2019-01-25 17:30:08 +01:00
Dan N
04c1234f11 Enhanced stereo python issue 2108 (#2121)
* Issue #2108: Read Enhanced Stereochemistry from Python

This wraps enhanced stereochemistry data for an ROMol for use
in Python and includes a test that demonstrates access.

* Adds test for potential memory management problems

(also fixes incorrect class name and bad docstring)

* Corrected file reading idiom and object lifetime test logic
2018-10-25 04:58:02 +02:00
Greg Landrum
8cfa694035 Add Properties interface to ChemicalReactions (#1848)
* initial pass at pickling reaction properties

* move more of the property handling functions to props.hpp
Wouldn't be bad to rename these at some point.

* add reaction properties to python wrappers
2018-05-05 04:39:10 +02:00
Jeff van Santen
e593d13f6f Fix typo in GetBoolProp documentation (#1770)
@jvansan Thanks!
2018-03-23 12:25:36 +01: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
Greg Landrum
0775cf0da5 add substructure searches of Mols using MolBundles from Python (#1603) 2017-10-03 17:46:44 -04:00
Greg Landrum
6ed76d9fff Expose the MolBundle to python (#1583)
* backup

* initial mol bundle wrapper

* Move the substructure matching wrapper code to a template header file to clean stuff up.

* update python docs
2017-09-26 13:00:53 -04: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
7c0bb0b743 clang-tidy output 2017-04-22 17:09:24 +02:00
Greg Landrum
283332e4de Fix/github1366 (#1382)
* add test

* update that test

* add python version of a test

* add some preconditions before dereferencing pointers

* make data members of AtomIterators private (not sure why these were ever made public)

* Fixes #1366

* switch to using std::runtime_error

* switch python tests too

* move the tests from the C++ side to be on the python side.
2017-03-28 16:01:36 -04: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
Brian Cole
a4054c0657 Expose RWMol.ReplaceBond to Python (#1174)
This will be more useful in a later pull request I'm working on that
exposes QueryBonds to Python. Though it is usable without QueryBonds
as well, so submitting this for now.
2016-11-21 09:41:53 -05:00
Greg Landrum
3b41772851 add support for a default constructor to the python-exposed RWMol class (#1129) 2016-10-29 02:17:12 +02:00
Greg Landrum
2644a7af02 Allow the output of ROMol::debugMol() to show up in jupyter (#1110)
* allow Mol::debug output to show up in jupyter notebooks

* use rdInfoLog instead of rdWarningLog

* fix a typo
2016-10-17 13:03:15 -04:00
Brian Kelley
2debdfde0d Adds RDAny (smaller generic holder) Updates all used dictionaries (#896)
* Adds RDAny (smaller generic holder) Updates all used dictionaries

This is an API compliant version of the current rdany system,
but uses a lot less memory in practice.

* Removes code duplication

* Converts CHECK_INVARIANT to TEST_ASSERT

* Fixes DoubleTag issue

* Adds Bool to DoubleMagic implementation

* Removes reference to property pickler
2016-05-29 17:04:21 +01:00
Paolo Tosco
2b3a818f84 - removed the dependency on Trajectory from ROMol and ForceField 2016-05-11 19:37:09 +01:00
Paolo Tosco
d16b312ee6 - Completely revised coordinate ownership
- Implemented Python wrappers
- prepared relevant test cases
2016-04-24 23:30:25 +01:00
Brian Kelley
d5299d8ad6 Use GetProp (as opposed to MolGetProp) 2016-01-19 07:45:43 -05:00
Brian Kelley
1b69b940a8 Converts RuntimeError to better described ValueError 2016-01-17 16:33:34 -05:00
Brian Kelley
5c3f864980 Fixes GetPropsAsDict to return non-string values 2016-01-17 11:20:30 -05:00
Brian Kelley
5c398036da Adds GetPropsAsDict to Mol/Atom/Bond 2015-12-21 08:44:59 -05:00
Brian Kelley
ae49289a62 Changes GetUInt to GetUnsigned 2015-12-21 08:44:33 -05:00
Brian Kelley
bd7782465f Exposes Get/Set Double, Int, Uint and bool props to molecules 2015-12-20 09:49:29 -05:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Greg Landrum
5618819c64 merge #641 2015-11-14 05:03:24 +01:00
Paolo Tosco
3d48ba72e1 - added threading support to ResonanceMolSupplier and relevant tests
- added threading support to the ResonanceMolSupplier-enabled
  SubstructMatch() and relevant tests
- modified/removed some code in O3AAlignMolecules.cpp which doesn't
  seem necessary anymore
- modified Code/GraphMol/CMakeLists.txt to allow building
  on Windows
2015-11-01 23:01:34 +00:00
Brian Kelley
403a3d6b7c Suppresses Boost warnings 2015-10-18 13:41:03 -04:00
Brian Kelley
52732df2f0 Fixes #629 - python GetSubstructureMatch thread safety 2015-10-13 15:36:11 -04:00
Greg Landrum
a3414b2d6d Fixes #572 2015-08-24 10:46:42 +02:00
Greg Landrum
2b107bd886 Fixes #467 2015-04-01 02:37:02 +02:00
Greg Landrum
b78bb40ca5 Fixes #384 2015-03-30 07:20:24 +02:00
Brian Kelley
d61c78581d RDKit learns how to release the GIL in python 2015-03-11 20:08:09 -04:00
Brian Kelley
f0bc4d0817 rdkit learns how to wrap a proper RWMol (kinda)
RWMol becomes a replacement for EditableMol.
It has the EditableMol interface in addition
to the ROMol interface.  In the future this
may or may not grow the RWMol C++ interface.

Conflicts:
	Code/GraphMol/Wrap/rough_test.py
2015-01-30 12:16:23 -05:00
Greg Landrum
4b8caf2ceb Fixes #409 2015-01-10 07:21:55 +01:00
Nadine Schneider
0bbf3ec79b Add function to test if UpdatePropertyCache is necessary 2014-12-19 13:59:42 +01:00
Greg Landrum
50332b599e get some of the pickle problems resolved; this probably only works with python3 and is not yet 100% functional 2014-06-19 06:05:42 +02:00
Riccardo Vianello
3358ec5925 initial set of changes introducing python3 support 2014-06-17 18:26:41 +02:00
Greg Landrum
118306d1f9 expose useQueryQueryMatch info to python;
Fixes #258
2014-05-07 06:04:38 +02:00
Greg Landrum
819272f375 initial batch of decent QueryAtom support for python;
Fixes #181
2013-12-17 05:55:18 +01:00
Greg Landrum
4520ee1263 more progress towards #181; the problem now is that there is
not really anyway to build a query atom from python
2013-12-16 05:24:04 +01:00
Greg Landrum
aef75dced2 Progress towards #181 2013-12-14 15:45:45 +01:00
Greg Landrum
62efc6ab42 Fixes #133 2013-10-17 02:51:39 +02:00
Greg Landrum
d1cae9346f an initial version of the "atomBits" feature for RDKit fingerprints 2013-03-12 04:39:43 +00:00