* SHARED-12256: Add test and change function.
* SHARED-12256: Update to only wrapping changes.
* SHARED-12256: Parameterize tests.
* SHARED-12256: GetPropIfPresent changes.
* Revert "SHARED-12256: GetPropIfPresent changes."
This reverts commit f598f8c161.
* SHARED-12256: Make default the keyword in the boost wrappings.
* SHARED-12256: Overload function instead of using a sentinel.
* SHARED-12256: Extend GetProp changes.
* SHARED-12256: Add entry point for tests and fix tests.
* add the _CIPNeighborRanks property
* store CIP-ranked chiral neighbors
* store CIP-ranked SP2 bond and atropisomer anchors
* add a test
* boost headers in test
* add Atom::NOATOM
* add NOATOM test
* amend and clarify implicit H in Tetrahedral
* rename property
* rename property to _CIPNeighborOrder
* deprecate Chirality::StereoInfo::NOATOM
* Trim spaces from RDProp strings to simulate reading from SDFiles
* Update documentation
* Use the correct doc strings
---------
Co-authored-by: Brian Kelley <bkelley@glysade.com>
* Speed up GetProp Python keyerrors
A common pattern _in Python_ for checking for the presence or
absence of a key is:
try:
return mol.GetProp('mykey')
except KeyError:
return None
Shockingly, this is really slow with boost python objects! I was
recently profiling a workflow and 90% of the time or more was
spent in failed GetProp calls (mostly on bonds, some on atoms
or mols).
I sped up the workflow by protecting the calls using HasProp. But
I think this is a silly trap we've set for our users.
The problem comes because boost::python uses a C++ exception to
indicate that there is already a Python exception set. In C++,
exceptions are slow - they require unrolling a stack. In Python,
exceptions are about the same speed as any other control flow!
This commit speeds up GetProp failures by circumventing the
boost throw_exception_already_set() mechanism.
In my testing, this speeds up failed GetProp substantially:
* Factor of 1000x on Mac
* Factor of 40x on Linux
* Update typed GetXXXProp to bypass boost exceptions
Based on PR #8372
Updates the typed GetIntProp, GetDoubleProp, etc to bypass C++
exceptions in access. This speeds up missing key errors
significantly - for instance, calling mol. GetIntProp with a
missing prop 100,000 times:
Before: 28s
After: 0.05s
* Fixes#7873
* Resolve MonomerInfo class for deletion
* Add regression test for setMonomerInfo
---------
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
* Refactor Atom.cpp to create a hasValenceViolation method that uses existing valence checking code
* work without exceptions
* get rid of the snake_case
* put free functions in an unnamed namespace
---------
Co-authored-by: greg landrum <greg.landrum@gmail.com>
* 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>
with cmake --build . --target stubs (also make stubs on *NIX)
- improved the patching script to do a better assignment of
overloaded constructor parameters, whcih results in a number
of docstring fixes
Co-authored-by: ptosco <paolo.tosco@novartis.com>
* - 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>
* Optimize GetPropsFromDict, use tags for conversion, not the try and fail technique
* Autoconvert strings to ints and bools if possible
* Add autoConvert option to GetPropsAsDict default=true
* Update Code/GraphMol/Wrap/props.hpp
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
* change autoConvert to autoConvertStrings, add failed datatype conversion notices
* Fix Invariant usage
* Fix namespace for string
* Add GetProp(key, autoConvert) to allow for converting only what you want
* Make TestSetProps private
* Get _TestSetProps from rdmolops
---------
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
Co-authored-by: Brian Kelley <bkelley@relaytx.com>
* very basics: actually parsing the new atom stereochem features
* add some input verification for the chiral permutations
* fix a typo
add quadruple bond SMILES/SMARTS extension
* add forgotten files
* patch from Roger
* add Roger's parsing examples
* typo
* new tests
* adjusted version of next PR from Roger:
- add SP2D hybridization for square planar (this may change)
- some modernizationof Chirality.cpp
- stop using < HybridizationType in Chirality.cpp (should probably do this elsewhere too)
- improved handling of hybridization assignment for new stereochem
- handle new stereo/hybridization in UFF
- tests for the above
* perception of non-tetrahedral stereo from 3D (from Roger S)
Basic testing of SP and TB based on opensmiles docs
* potential fixes for octahedral assignment
more tests
* docs update
need way more!
* map the TH tags directly to @ tags
* very basics of SMILES writing
this does not work with anything that changes the permutation order
like canonicalization or writing things in rings.
* start to support the getChiralAcross API
* more testing
* consistency
* add hasNonTetrahedralStereo() and getIdealAngleBetweenLigands()
* assignStereochemistry should only remove non-tetrahedral stereo
* re-simplify those tests
* cleanup matrix stream output
* initial pass at supporting nontet stereo in distgeom
* backup
* start on the reference docs
* TBP reference
* first pass at Oh finished
* update SP section
* more doc updates
* fix a typo
* add param to not remove Hs connected to non-tetrahedral atoms
* VERY basic coord generation for square planar
* TBP basics
* basic OH depiction
* start testing missing ligands
allow non-tet stereo in rings (ugly, but correct)
* add new TBP functions from Roger
* update depiction code for new API
* backup, the new tests work so far
* Finish the TB tests
* OH tests pass too
* cleanup
* first pass at getting correct SMILES with reordering
need way more testing than this
* ensure permutation 0 is correctly preserved
* some progress towards adding non-tetrahedral stereo to StereoInfo
* doc update
* add non-tet chiral classes to python wrappers
* make sure removeAllHs also gets neighbors of non-tetrahedral centers
more testing
* a bit of depictor cleanup
* make the assignment from 3D more tolerant
more testing
* improve the bulk testing
* cleanup
* remove a bit of redundant code
* ensure we don't write bogus permutation values to SMILES
* fix some rebase problems
* allow assignStereochemistryFrom3D() to be called without sanitization
* allow disabling the non-tetrahedral stereo when it's not explicit
* get that working on windows too
* add ROMol::atomBonds() and ROMol::atomNeighbors() methods
* remove some warnings
* start using the new code
* add default for those template params
* some more applications
* get the SWIG builds working
* get rid of extraneous ref
* remove extraneous comments
* 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
* Fixes#2450
adds `hasOwningMol()` to the public API for Bond and Atom
* add to other classes;
add to python wrappers
* get the smiles generation partially working
* changes in response to review
* Allow Atoms to be copyied in Python.
The dunder copy method is the idiomatic way to support
making copies in Python. Includes a test to make sure that
copied atoms are usable.
* Use RWMol in Code/GraphMol/Wrap/rough_test.py
Co-Authored-By: d-b-w <dan.nealschneider@schrodinger.com>
* Allow access to an atom's copy constructor in Python
* 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
* Expose SetQuery to python
* Add a default for maximum products generated by a reaction (maxProducts=1000)
* Add better documentation for test that used to raise exception
* properly import rdqueries
* Add more options to GetAtomSmiles() to control output.
The most important one here is that you can now directly control whether or not isomeric SMILES is generated.
Expand the python interface so that we have more control over Atom.GetSmarts()
* make the use of isomeric atomic smiles explicit (since we can)
* start release notes for 2018.09.1
* python formatting
* 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
* Adds Atom atom map and rlabel apis
* Moves RLabels to their own namespace, adds other properties.
* Removes namespaces, liberally adds Atom to function names.
* move detail::computedPropName to RDKit::detail::computedPropName
* 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