* Remove Dict::getData() for a strict abstraction boundary
Replace direct access to Dict's internal std::vector<Pair> with
encapsulated methods: size(), empty(), const iteration via
begin()/end(), appendPair(), markNonPOD(), and getRawVal().
This enables future changes to Dict's internal representation
without breaking callers.
Ref: rdkit/rdkit#9112
* Harden Dict::appendPair to take a populated Pair by move
appendPair(Pair&&) now auto-detects non-POD status via
RDValue::needsCleanup(), eliminating markNonPOD() and the
risk of dangling references or uninitialized entries.
needsCleanup() is placed next to destroy() on RDValue to
keep the POD/non-POD distinction in one place.
* Remove vestigial dictHasNonPOD param from streamReadProp
Both callers ignored the output. Non-POD detection is now handled
by Dict::appendPair via RDValue::needsCleanup().
* unbork java build
* Address PR review: bulk append, rename getRawVal, add custom data test
- Add Dict::append(vector<Pair>&&) for bulk insertion with reserve
- Use bulk append in streamReadProps to restore pre-allocation
- Rename getRawVal -> getRDValue per reviewer preference
- Add test verifying custom AnyTag data is destroyed through Dict lifecycle
* heed self-review
* don't manually implement vec.insert
* Add test: ExplicitBitVect round-trip through Dict serialization
Exercises the full streamWriteProps/streamReadProps path with an
ExplicitBitVect in an RDProps Dict, confirming the custom handler
is invoked and no memory is leaked (verified under valgrind).
* in anyTag test, assert destructors ran a specific number of times.
---------
Co-authored-by: bddap (Coding Agent) <andrew+bot@dirksen.com>
* 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
* Fixes#9068
* fix a problem with empty labels in s-group parsing
* fix empty column names in smiles suppliers
* add the check to setPODVal()
---------
Co-authored-by: = <=>
* merge ABS groups on setStereoGroups
* warn/fail on multiple ABS groups on strict parsing
* add a test for setStereoGroups
* add a test for multiple ABS groups in mol blocks
* Drop the warning
* do not remove hydrides by default
* add a minimal test
* add release note about behavior change
* require Hydrides to have degree 1
* also allow hydrides with degree 0 (ionic bond)
* suggested changes
---------
Co-authored-by: greg landrum <greg.landrum@gmail.com>
* refactor the code to determine whether or not an atom is in brackets
* move the definition of isMetal to QueryOps
* atoms bound to metals in SMILES should always be in square brackets
Implementation and some test updates
needs confirmation that all of tests run
* basic tests pass
* java tests pass
* update js tests
* doc updates
* Update Code/GraphMol/catch_graphmol.cpp
Co-authored-by: Ricardo Rodriguez <ricrogz@users.noreply.github.com>
* Update Code/GraphMol/SmilesParse/test.cpp
Co-authored-by: Ricardo Rodriguez <ricrogz@users.noreply.github.com>
* finish fixing tests
* bump yaehmop version to allow compilation to work
---------
Co-authored-by: Ricardo Rodriguez <ricrogz@users.noreply.github.com>
* first pass, does not pass all tests
* add an option to control the new behavior
* add that to the python wrapper too
Fixes#8304
* Update Code/GraphMol/MolOps.h
Co-authored-by: Ricardo Rodriguez <ricrogz@users.noreply.github.com>
* undo some extra comment reformatting
* typo
Co-authored-by: Ricardo Rodriguez <ricrogz@users.noreply.github.com>
---------
Co-authored-by: Ricardo Rodriguez <ricrogz@users.noreply.github.com>
* remove no-op macros and dead code (pt 2)
* test failures due to whitespace changes?
* actually run the testFeatures tests
---------
Co-authored-by: greg landrum <greg.landrum@gmail.com>
* Improved handling of SP/TB/OH reording in SMILES/SMARTS.
- add a getMaxNbors(tag) utility function to avoid repeated logic in multiple places
- tweak getChiralPermutation() for handling implicit/missing ligands (uses -1), allow inverse lookup
- use the tweaked chiral ordering in the reading/writing from SMILES
* clang-format run
* Reviewer requested changes.
- curly braces on all if conditions
- null check raw pointers with precondition.
* Correct additional test case introduced in the last year
* oxime tests
* Support allenes in canonicalizing double bonds
* alternate solution to the problem
* expand comment
* reactivate conjugated nitro test
* Fix conjugated nitro tests, have a bondstereo test
* Empty commit to re-proc tests
---------
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
* Fixes#7873
* Resolve MonomerInfo class for deletion
* Add regression test for setMonomerInfo
---------
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
* add option to use chiral presence in atom ranking
* add findMesoCenters
* add includeChiralPresence to python wrapper
* add python wrapper for that
* backup, not working
* backup
* all tests pass
* add tests for partial coverage of stereo groups
all tests pass
* backout the cleanup operations for the initial merge
* track the meso atoms with atom properties.
this is an optimization for later.
* changes in response to review
* change valence model to use isolobal analogy
Remove support for five-coordinate C+ and, by analogy, five-coordinate N+2
Removes support for charge states that take atoms past the end of the periodic table
i.e. [Lv-4] is no longer supported
* update the tests for that
* remove valence state of 6 for Al
* fix representation of phosphate in the mol2 parser
this is a correction of what was done during #5973
* cleanup the exceptions for P, S, As, and Se
* drop valence states:
Si 6, P 7, As 7
* a couple of additional changes from #7397
* update java tests
* fix an inconsistency: Rb now supports valence -1
* documentation
* - replace operator[] with at() for bounds check
- extract some code into a function to avoid duplication
- use TAB as separator throughout in the periodic table data for consistency
* removing the .at() usage
We know that these vectors aren't empty, so there's no need for the bounds check.
---------
Co-authored-by: ptosco <paolo.tosco@novartis.com>
* Try not to make wedged bonds double in the kekulization code
This is a first pass implementation and definitely needs more testing of the new feature.
Probably looking at optimizing the code would also not be terrible.
All tests pass with this commit
* Some changes to the kekulization in presence of wedged bonds and additional testing
* additional kekulization test case
* start the kekulization in rings with wedged bonds
add some bulk tests
all tests now passing for me
* changes from review
---------
Co-authored-by: Riccardo Vianello <riccardo.vianello@gmail.com>
* check for ringinfo levels instead of init
* check for ring info in kekulizefragment
* add a test
* update tests
* update doctests
* revert ringinfo level checks
* add MolOps::expandAttachmentPoints, along with tests
* support expandAttachmentPoints in the mol file parser
* switch the v2 stuff in the guts of the reaction parser
* add collapseAttachmentPoints()
add addAsQueries option to expandAttachmentPoints()
lots of testing
* an edge case and some cleanup
* add python wrapper for those two functions
* Update Code/GraphMol/FileParsers/FileParsers.h
Co-authored-by: Ric <ricrogz@users.noreply.github.com>
* changes in response to review
- support addCoords in expandAttachmentPoints()
- support the new attachment point stuff to/from CXSMILES
- add MolOps::details::addExplicitAttachmentPoint() and MolOps::details::isAttachmentPoint() utility functions
---------
Co-authored-by: Ric <ricrogz@users.noreply.github.com>
* insert stereogroups
* insert Substance Groups
* fix ownership, bond indexes
* add test
* fix comparison signednedss
* update test
* Brian's suggestion
* allow more than one ABS group
* 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>
* added ROMol::hasQuery
* python bindings for Mol.HasQuery
* at least I checked that my Python tests were running...
* hasQuery use C++11 range iterators
* enable Werror on Mac and Linux
* do not fail on boost multiprecision pessimizing move
* fix eigen array_bounds warning
* Fix unused arg in Rascal MCS
* fix range-loop-construct warning in Rascal MCES
* fix sign mismatched comparison
* drop unused lambda capture
* allow FMCS timeout test more time under Debug (not a warning!)
* fix fwd declaration of struct RascalClusterOptions
* fix deallocator mismatch
* fix two minor leaks
* fix a real leak
* more minor leaks
* fix another real leak, plus some potential ones
* fix std::move preventing copy ellision
* allow longer run time for debug builds
* make maxBondMatchPairs and getLargestFragSize unsigned int
* make snake case camel case
* update to current master, fix new warnings
* update again and more fixes
* add #include <optional>
* fix char array deallocation
* update and fixes in Marvin writer
* unsigned int
* more copy ellision fixes
* more copy ellision fixes, and typos
* and some more
* Fix canonically correct single to dative bond conversion for organometallics.
* Cleanups from review.
* Process atoms in canonical order.
Extra test.
* Only do the expensive bit if there's something to fix.
---------
Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
* Changing flags if doIsomericSmiles is false
* Ignoring cis-trans bonds as well
* Tests for removing enhanced stereo
* Fix#6237 by checking chiral tag instead of CIP
* Remove unnecesary calls to fabs
* Modify AddHs
* Tets for #6237
* Rerun Checks
* First stab at disconnecting organometallics the Syngenta way.
* Add support for Li and Na compounds, with tests.
* Correct docstrings.
* Add -1 valence to sodium.
* Add changes from PR 5997.
* Move declaration of disconnectOrganometallics.
* Re-factor tests for disconnectOrganometallics to read V3000 files rather than hard-code in file.
* Add optional options to constructor.
* Python wrapping for disconnectOrganometallics.
* Python tests.
* Correct docString.
* Test using in place overload of disconnect free function.
* options_ should not be a reference.
* Re-work the wrappers.
* Added test MOL files.
* Correct charge on iron atoms.
* Fix tests for charged iron.
* Added some more test complexes.
* Port Marco's oxidation number Python to C++ Descriptor.
* Rename functions.
* Another test.
* Python wrappers.
* Comment in test.
* Throws exception if atom-based function called with non-kekulized parent.
* Fix typo.
* Allow potassium as well.
* Whole molecule calculations for oxidation number only.
Rename prop to OxidationNumber.
* Add OxidationNumber to common_properties.
* Extra comment.
* When deleting atom, update any ENDPTS props on bonds.
Copied in from stale PR ExtraDoc.
* Added hapticBondsToDative with python wrapper.
* Extra test.
* Re-factor endpts parsing.
* Typo.
* Add function for haptic end points inc. Python wrapper.
* Add dative bonds in separate step.
* C++ version of dativeBondstoHaptic.
* Update test mols.
* Python wrapper.
* Fix indents in Python test script.
* Corrected expected test result.
* Only do non-metal to metal conversion of single bond to dative if the explicit valence of the non-metal allows it.
* Fix test broken in a non-material way by previous change.
* Export for DLL.
* Remove redundant function declaration.
* Dave hates Windows.
* Move hapticBondEndpoints to Molops::details.
* And take it out of the Python wrappers.
* Run yapf on reformatted test script.
* Get the DLL builds going.
* addDativeBond -> addHapticBond.
* Batch edits.
* Position arithmetic.
* setQuery.
* Dummy positions for all confs.
* Fix tests for dummy positions for all confs.
* Move tests to catch_organometallics.cpp.
* Modern docString.
* Change member variable names.
* sProp length, bonus batchEdit.
* Add options object to disconnectOrganometallics.
* Tidied license.
Atom precondition.
* GetIntProp.
* Test opts aren't defaults.
* Python wrapper for disconnectOrganometallics with options.
* Minor edit.
* Slightly random attempt to fix Java build.
* Response to review.
* Another stab at the doc strings.
---------
Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>