Commit Graph

220 Commits

Author SHA1 Message Date
Greg Landrum
0ee90279b5 Partial fix to a problem with implicit Hs being written to SMARTS (#8893)
* Partially resolve a problem with implicit Hs ending up in SMARTS

* update doctest

* document in release notes
2025-10-24 07:50:06 +02:00
Ricardo Rodriguez
d9850596aa Fixes #8726 (#8874)
* 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>
2025-10-17 16:51:22 +02:00
Greg Landrum
93d0f8bb74 Fixes #8776 (#8875)
* Fixes #8776

don't call the pseudo-CIP perception code if we really don't need to

* allow calling the pseudo-CIP code from Python

* update doctests
2025-10-17 05:52:27 +02:00
Ricardo Rodriguez
7d1e662bc7 Use std::string_view for property keys (#8844)
* string_view props API

* wip

* fix leak

* add string_view to swig

* fix comment

* add backwards incompatibilty note

* fix rebase issue

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-10-09 16:14:48 +02:00
Ricardo Rodriguez
9eaa193186 Merge simple AND queries onto atoms. (#8830)
* duplicate parser code

* regenerate smarts.tab files

* update test

* add release note

* restore pregenerated header

* Suggested changes (#23)

* add a generic flags interface to atoms and bonds

* suggested changes

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2025-10-09 04:38:42 +02:00
Greg Landrum
66787fe604 new release prep (#8848) 2025-10-05 09:23:33 +02:00
Greg Landrum
c15eb1a143 Fixes #8633 (#8794)
* Fixes #8633

* changes in response to review
2025-09-26 05:33:13 +02:00
Greg Landrum
c7a92389d9 Beta release prep (#8804)
* partial artifact update

* update release notes

* update
2025-09-24 11:07:07 +02:00
Niels Maeder
d13b002d2d update default ET version to 2 in getExperimentalTorsions (#8798)
* update et version to 2

* Add comment in the release notes.
2025-09-24 05:56:35 +02:00
Greg Landrum
d12932f13e support bond property lists in SDF (#8778)
* backup
builds but no tests

* deprecate old form

* initial basic tests for bond property lists

* Tests pass

Fixes #8777

* add deprecations to release notes

* - avoid computing size of a constant at runtime
- replace multiple instances of a numeric constant with a literal constant
- avoid unnecessary copying of strings in iterations and function calls

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2025-09-17 16:17:12 +02:00
Greg Landrum
86141183c1 Moving towards getting all tests to pass when using the new stereo code (#8409)
* Fixes #8379

* check in some working tests

* test passes

* test passes

* test passes

* test passes

* test passes

* ensure that the invariants flush the streams on failure

* tests pass

* test passes

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* tests pass

* Fixes #8391

* tests pass

* fix a test with legacy
not clear why this was not causing problems before

* make a test work

* Fixes #8396

* gcc builds work

* fingerprint tests pass

* mention backwards incompatible change

* fix a problem with FindMolChiralCenters

* more testing details

* enable the test status output

* Fixes #8432

fix a bug in double-bond stereo handling for template matching

* all depictor tests pass

* use the new-stereo chiral ranks in the depiction code

* always assign new-stereo chiral ranks

* make _ChiralAtomRank a computed property
This is analogous to _CIPRank

* tweak to the way the atom ordering is computed for 2D coordinate generation

* update two expected results

* backup

* response to review

* tests pass

* tests pass

---------

Co-authored-by: = <=>
2025-04-15 14:00:32 +02:00
Greg Landrum
923483523e prep for next release cycle (#8402) 2025-04-03 05:25:12 +02:00
Greg Landrum
d32c919066 prep for release (#8397) 2025-03-31 20:11:10 +02:00
Greg Landrum
32608ae0b4 Atoms bonded to metal atoms should always have their H counts explicit in SMILES (#8318)
* 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>
2025-03-29 07:26:03 +01:00
Greg Landrum
a9e79d35ad tag beta (#8369)
doing a self merge since this is just a release tag
2025-03-21 17:59:57 +01:00
Greg Landrum
b64aea5082 apply query adjustments when makeAtomsGeneric is enabled (#8315)
* apply query adjustments when makeAtomsGeneric is enabled

* changes in response to review

* I got Python in my C++
2025-03-04 13:50:24 +01:00
Ricardo Rodriguez
12929849f5 Make MaeWriter to throw on errors. (#8297)
* allow MaeWriter to throw

* update tests

* throw ValueErrorException

* add note on backward incompatible change of behavior
2025-02-25 16:59:40 +01:00
Greg Landrum
7311390005 MolDraw2D: add separate colors for atom and bond annotations (#8249) 2025-02-15 08:28:00 +01:00
Jeremy Monat
103b22dd4b Use GetUniqueCombinations_new instead of GetUniqueCombinations (#8214)
* Remove GetUniqueCombinations, use instead GetUniqueCombinations_new for improved speed. Update related tests.

* Remove unused and uncalled parameter `which`

* Update tests for GetUniqueCombinations to be in numerical order. Remove unused variable `x`. "Alias" GetUniqueCombinations_new to GetUniqueCombinations for backwards compatibility. Add note about backwards incompatibility for GetUniqueCombinations to ReleaseNotes.md.

* Create _compareCombinationsOrderUnimportant and use for testGetUniqueCombinations for order-insensitive comparison

* Replace call to GetUniqueCombinations_new with GetUniqueCombinations in Gen2DFingerprint for consistency
2025-02-06 05:21:33 +01:00
Greg Landrum
fa048eacc5 Replace GetImplicitValence() and GetExplicitValence() with GetValence() (#7926) 2025-01-28 21:09:03 +01:00
Brian Kelley
eacc365b27 GitHub 7865 haspropwithvaluequery leaks (#7872)
* Properly cleanup Dict::Pair when serializing HasPropWithQueryValue

* Make sure pickling doesn't change original molecule

* Fix bad cut and paste

* Add PairHolder utility class for memory management of non Dict Dict::Pairs, fix mem leak in pickler

* Edit comment to force a rebuild

* Ignore PairHolder from Java/Swig builds

* Ignore PairHolder API from swig

* Reponses to review

* Add backward incompatible change

* Make release note a bullet point
2024-10-30 06:12:40 +01:00
Paolo Tosco
f66ad7e7c1 Replace awful enum reflection macros with Better Enums (#7913)
* - moved SMILES and RGroupDecomp JSON parsers to their own translation units
- added missing DLL export decorators that had been previously forgotten
- changed the signatures of MolToCXSmiles and updateCXSmilesFieldsFromJSON
to replace enum parameters with the underlying types
- updated ReleaseNotes.md

* make sure cxSmilesFields is only updated if the JSON string contains keys
belonging to the CXSmilesFields enum

* added missing copyright notices

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-10-25 08:17:07 +02:00
Greg Landrum
a7404cdd91 Do the announced deprecations (#7910)
* remove MMFF:setMMFFAromaticity()

* remove AtomPairs.Utils.NumPiElectrons()

* remove the deprecated DistGeom contrib files

* document removed stuff
2024-10-11 06:42:18 +02:00
Greg Landrum
fcf8b8eb16 ready next release cycle (#7858) 2024-09-27 14:02:43 +02:00
Greg Landrum
9b9392266a update README and tag release (#7855) 2024-09-27 13:52:16 +02:00
Greg Landrum
b5d6a3dba7 beta release prep (#7836) 2024-09-20 17:20:05 +02:00
Juuso Lehtivarjo
9824a9d964 Expose MMFF aromaticity model for SetAromaticity (#7765)
* Expose MMFF aromaticity model for SetAromaticity

* Test, backward compatibility, missing AromaticityModel wrapper
2024-09-18 05:59:02 +02:00
Greg Landrum
90c5334848 Fix aliasing bug in MultithreadedSDMolSupplier and move GeneralFileReader to v2 API (#7761)
* fix aliasing bug in MultithreadedSDMolSupplier

* update GeneralFileReader to v2 API

* add backwards incompatibility note

* forgot the tests

* allow non-threadsafe builds

* more generalfilereader cleanup
2024-08-29 15:53:28 +02:00
Greg Landrum
2c5ae534f2 Optimizations of the DistanceGeometry forcefield (#7600)
* First try at using DistViolationContribs

only the most basic of testing has been done

also add ForceField::distance2 to allow some optimizations

* allow testing using old approach

* optimization

At this point testUFFForceFieldHelpers fails since the check for std::max_element
in the e_contribs vector at Embedder.cpp:513 is now doing something totally different
(instead of a bunch of small distance violation contribs, we have one big one).
We'll need to come up with something for this.

With the benchmarking set that I'm using - 500 DG conformers for ~465 COD molecules
using 10 threads - this runs in almost 10% less time than master.

* backup;
builds, tests do not pass

* all tests pass except the old failure

* more constification

* backup/debugging

* add fourthdim contribs the same way

* tests now pass

* deprecations

* remove unused vars and code

* changes in response to review
2024-07-15 14:14:39 -04:00
Greg Landrum
724716b2c6 Switch to isoelectronic valence model (#7491)
* 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>
2024-06-25 15:38:49 +02:00
Greg Landrum
93e8a746bf Shrink the tautomeric zone for the v2 hash of things like imines (#7502) 2024-06-07 05:09:57 +02:00
Greg Landrum
34e5569866 deprecations for the 2024.09 release (#7398)
* deprecations for the 2024.09 release

* update doctests

* Fixes #7402

* get tests passing when the cairo build is not there

* fix a problem in the tests
2024-05-05 07:30:00 -04:00
Paolo Tosco
2bb8952d7b Added JSON parameters to MinimalLib get_(cx)?sm(ile|art)s() functions (#7194)
* - renamed getParamsFromJSON() to updateSmilesWriteParamsFromJSON() and moved it from the anonymous namespace to the RDKit namespace such that it is publicly available
- implemented updateCXSmilesFieldsAndRestoreBondDirOptionFromJSON()
- added CFFI and JS tests
- get_smiles(), get_smarts(), get_cxsmiles() and get_cxsmarts() are now available in MinimalLib in both CFFI and JS layers and they can be passed JSON parameters
- CFFI get_qmol() now returns NULL if it fails to generate a RWMol rather than returning the "Error!" const char[] string, for consistency with what get_mol() and get_rxn() do. This was documented in release notes

* suggestions

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
Co-authored-by: greg landrum <greg.landrum@gmail.com>
2024-04-18 06:28:36 +02:00
Greg Landrum
f7fb104e6e Correct unbranched alkane SMARTS to match the description given (#7255)
* Correct unbranched alkane SMARTS to match the description: must restrict to only carbon and allow for terminal alkanes

* Add backwards incompatible change notes

* move and edit incompatible changes note

---------

Co-authored-by: Daniel Levine <levineds@meta.com>
Co-authored-by: levineds-meta <159849019+levineds-meta@users.noreply.github.com>
Co-authored-by: greg landrum <greg.landrum@gmail.com>
2024-04-12 08:25:00 +02:00
Anna Brünisholz
82dbf4c66b switch to range-based for loops (#7278)
* switch to range-based for loops

* Update Code/GraphMol/testChirality.cpp

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>

* fix a leak in the new DCLV code (#7279)

* fixes #7295 (#7303)

* tag 2024.03 release (#7308)

* tag release

* attempt to solve constant MD5 problems

* switch to getting the ComicNeue font from github instead of as a zip

* open new release cycle (#7314)

* restrict the application of 1,3- 1,5- conjugated cation normalization (#7287)

* propagate yaehmop build status (#7316)

* Fixes #7299 (#7304)

* clean up of python and c++ for-loops

* clang formatted testChirality

* fix test file

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
Co-authored-by: Riccardo Vianello <riccardo.vianello@gmail.com>
2024-04-08 14:16:27 +02:00
Ricardo Rodriguez
73e91a6344 Fixes #7318 (#7319)
* fix hybridization for atoms with outgoing dative bonds

* expose and wrap C++ numPiElectrons

* deprecate AtomPairs.Utils.NumPiElectrons

* add & update tests

* fix draw2d test

* update expected hash

* add hybridization test

* move numPiElectrons to Atom.h

* take reference instead of ptr
2024-04-03 15:34:37 +02:00
Greg Landrum
e34f1ffaa0 open new release cycle (#7314) 2024-03-30 05:12:02 +01:00
Greg Landrum
ba0b6f3baf tag 2024.03 release (#7308)
* tag release

* attempt to solve constant MD5 problems

* switch to getting the ComicNeue font from github instead of as a zip
2024-03-28 19:59:56 +01:00
Greg Landrum
4f1b88acbe deprecation (#7272) 2024-03-20 04:43:10 +01:00
Greg Landrum
a8d4912f88 beta release prep (#7271) 2024-03-19 09:05:33 +01:00
Greg Landrum
81af0dbd63 add option to symmetrize conjugated terminal groups when RMS pruning conformers (#7270)
* expose symmetrizeTerminalAtoms() to the public API

* support symmetrizing terminal groups in RMS pruning in confgen

* add that to the python wrapper

* add backwards compatibility note

* allow JSON config of the new option
2024-03-19 04:38:29 +01:00
Greg Landrum
0576f37e4e remove the broken Dbase.DbReport module (#7227) 2024-03-15 20:50:47 -04:00
Greg Landrum
3cff4d08af fix a problem with tautomeric systems being extended too far (#7200)
* fix a problem with tautomeric systems being extended too far

* add backwards incompatibility note
2024-03-15 16:42:22 +01:00
Greg Landrum
6981cb0a39 allow perception of stereo from T-shaped structures (#7183)
* allow perception of stereo from T-shaped structures

* document that in the release notes
2024-03-05 15:59:11 +01:00
Greg Landrum
3a27ca2910 V2 API for the MolSuppliers (#7168)
* backup

* backup

* backup

* new testing file

* reorder things in the SMILES and SMARTS parser
parameters to allow easier struct initialization

* add v2 of SmilesMolSupplier

v1 is not yet there

* add TDTMolSupplier

add some very basic tests for v1 suppliers

* more progress

* all tests passing

I think all the suppliers are now moved over

* check for maeparser before building the tests

* get SWIG builds working

* changes in response to review
2024-02-29 06:46:56 +01:00
Greg Landrum
d1b9331a36 Fixes #7122 (#7126) 2024-02-03 06:47:28 +01:00
Riccardo Vianello
b3cb9cab21 refactoring of MolStandardize validation module (#7085)
* refactoring of MolStandardize validation module

* redefine MolStandardize::ValidationErrorInfo as an alias for std::string

* changes in response to review

* describe the backward incompatible changes to MolStandardize in the release notes
2024-01-24 12:58:25 +01:00
MarioAndWario
9ca7a2e00d Sanitize number of radical electrons in case of invalid value assigned by CXSMILES (#6842)
* Sanitize number of radical electrons in case of invalid value assigned by CXSMILES (#6370)

* static_cast<int> for integer comparison

* Add unittests for 0 explicit hydrogens

* Fix unittests of radical count in fileParsersTest1

* Fix testMolWriter

* Fix testMrvToMol

* Address Greg's comments
2024-01-23 06:21:26 +01:00
Greg Landrum
b6361ae684 Change the defaults for the conformer generation to be ETKDGv3 (#6985)
* fix a float comparison in a test

* make ETKDGv3 (i.e. v2 of the torsion parameters) the default.
This should have been done a long time ago.

* change default for onlyHeavyAtomsForRMS too

* release notes update
2023-12-19 04:25:55 +01:00
Greg Landrum
dd2ffd3b03 Deprecate some of the ancient python-based ML code (#6891)
* working on deprecations

* update release notes
2023-11-14 14:32:11 +01:00