Commit Graph

42 Commits

Author SHA1 Message Date
Greg Landrum
e35f7db009 Cleanup/get atoms and bonds (#9243) 2026-04-18 05:22:09 +02:00
Patrick Kunzmann
c20b2a906b Fix #8638 (#8639)
* Fix #8638

* add a test

---------

Co-authored-by: greg landrum <greg.landrum@gmail.com>
2025-07-25 14:33:32 +02: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
Greg Landrum
1f4584b2ca run clang_format (#5676) 2022-11-01 04:14:26 +01:00
Brian Kelley
e946148fbe Fix a hang in ResonanceMolSupplier when the computed ceMap is empty (#5701)
* Fix a hang in ResonanceMolSupplier when the computed ceMap is empty

* Fix up tests to also handle #4884

* Remove hard coded string and use the test string

Co-authored-by: Brian Kelley <bkelley@relaytx.com>
2022-10-28 19:47:06 +02:00
Greg Landrum
0147cd8201 Fixes #5210 (#5408)
* revert duplicate chunk in release notes

* replace deprecated ifdefs
This one gets rid of USE_BUILTIN_POPCNT and RDK_THREADSAFE_SS
use RDK_OPTIMIZE_POPCNT or RDK_BUILD_THREADSAFE_SSS instead

* get rid of BUILD_COORDGEN_SUPPORT from ROMol.i

* fix a stupid typo

* update release notes
2022-07-11 11:20:03 +02:00
Eisuke Kawashima
11532089de Run clang-format against cpp (#4358) 2021-10-20 04:25:27 +02:00
Greg Landrum
85608555fe add ROMol::atomNeighbors() and ROMol::atomBonds() (#4573)
* 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
2021-10-02 07:28:24 +02:00
Eisuke Kawashima
b9a5be5a2d miscellaneous updates (#4284)
* Remove accidentally tracked files and unset x flag

* Ignore ComicNeue

* Unify test tag to `reader`

* Trivial destructors

* Bump CMAKE_CXX_STANDARD to 14 (#4165)
2021-07-13 06:57:29 +02:00
Ric
2afb4fbac4 Mem checkup & fixes (#3510)
* fix leak in testConformerParser

* fix leaks in testMultithreadedMolSupplier

* fix leak in catch_graphmol

* pass build type to YAEHMOP

* cleanup fragments in CoordGen minimizeOnly

* fix leaking ConjElectrons stack in res mol supplier

* avoid double delete

* do not delete 'this'; clean ce not added to map

* delete mol if Multithreaded SD readMolProps throws

* fix typo

* fix typo in comment
2020-11-09 12:08:36 -05:00
Paolo Tosco
5a8db40181 - fixed #3349 (#3354)
- fixed a few typos
- removed const from operator(), which should be allowed to modify the owning object
- added missing const to some getters
2020-09-02 04:51:20 +02:00
Paolo Tosco
c118c416ed Fixes #2597 (#3213)
* - major refactoring (fixes #2597)
- adds support for C++ and Python callbacks to monitor progress
- cumulated bonds should not appear in rings
- UNCONSTRAINED_CATIONS now implies ALLOW_CHARGE_SEPARATION and ALLOW_INCOMPLETE_OCTETS
  as it should already have
- UNCONSTRAINED_ANIONS now implies ALLOW_CHARGE_SEPARATION
  as it should already have

* removed spurious debugging messag

* changes in response to review
2020-07-13 15:15:24 +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
Paolo Tosco
ce3cb8455b - fixes GitHub #3048 (#3081)
* - fixes GitHub #3048

* - avoid try..catch
2020-04-17 14:19:53 +02:00
Paolo Tosco
cf031c2f7e - fixes #3041 (#3045)
- added a couple of missing const
- added a test for maxStructs
2020-04-01 10:00:22 +02:00
Greg Landrum
1830767d5d Fix a couple residual problems created by #2899 (#2935) 2020-02-05 16:32:08 +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
Greg Landrum
ec366c1ab7 Dev/pvs studio cleanups2 (#2877)
* a round of cleanups courtesy of PVS studio

* add a test to make sure that a warning is a false alarm

* bug fix

* Fix a UFF bug

* more PVS studio cleanups

* next round of PVS studio cleanups

* completely remove the chances for that bug

* changes in response to review

* add an additional test
+ a bit of reformatting that snuck in
2020-01-22 15:10:58 +01:00
Paolo Tosco
f2eb894a08 - fixes ResonanceMolSupplier bug in perceiving conjugated groups (#2517)
* - fixes ResonanceMolSupplier bug in perceiving conjugated groups

* - addresses comments to PR #2517
2019-07-23 08:03:24 -04:00
Greg Landrum
d8c49e6dab Code cleanups from PVS/Studio (#2531)
* first round of cleanups based on PVS-studio suggestions

* a couple more

* a few more cleanups

* another round of cleanups

* undo one of those cleanups
we want the integer rounding behavior here

* add a comment to make that clear

* Fix for filter catalog PRECONDITION redundancy
2019-07-13 07:25:37 +02:00
Brian Kelley
373a89021e Change boost int types to std types (#2233) 2019-01-22 17:45:03 +01:00
Boran Adas
8452ec59f9 Fix for issue #1730 (#1792)
* Fix for issue #1730

setAromaticity() now works even if there are aromatic atoms present and the relevat test case is added

* Removed setaromaticity flag
2018-03-25 06:38:34 +02:00
Greg Landrum
108d84ab1e Switch from boost::thread to std::thread (#1745)
* boost::thread mostly gone... still need to get rid of once
everything compiles

* replace boost::call_once

* remove link-time dependency on boost::thread

* first pass at using async

* switch to using async everywhere
2018-02-22 03:43:07 +01: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
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
Paolo Tosco
8d166f52cb Fixes #1162 (resMolSupplierTest failing with boost 1.62) (#1166)
* - fixed issue with weighted formal charges being stored as unsigned rather than as signed int
- the sum of formal charge and multiple bond indices is now used as last resort sort criterion to achieve stable sorting of degenerate resonance structures

* - added C++ and Python tests for GItHub #1166
2016-11-30 14:15:22 +01:00
Paolo Tosco
2392762575 - fixed a couple of compilation warnings in Resonance.cpp/Resonance.h 2015-12-16 17:33:22 +00:00
kelley
5dbec2fe85 Adds rdcasts where appropriate 2015-11-29 17:52:27 -05:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Greg Landrum
5992c6fd23 - made the ResonanceMolSupplier really lazy, i.e. resonance structure enumeration is only carried out when the user asks for a structure or when the user explicitly request that calling the enumerate() member function. This makes object creation fast and enables calling getNumConjGrps(), getBondConjGrpIdx() and getAtomConjGrpIdx() member function without incurring in the cost of necessarily enumerating resonance structures
- now bonds and atoms with do not belong to conjugated groups get a -1 index
- added a few Python wrappers
- added a few tests
2015-11-04 05:39:46 +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
Paolo Tosco
076831aa31 - removed d_ceMapTmp and d_ceMap from ResonanceMolSupplier
(they both were temporary data structures and there was
  no real reason for them to be there, especially in view
  of a possible code parallelization)
- converted most uint64_t to unsigned int since they weren't
  really necessary
- fixed a couple of compilation warnings
2015-10-25 21:50:20 +00:00
Paolo Tosco
72de596280 - implemented correct resonance structure sorting for degenerate cases
- moved classes that do not need being exposed in Resonance.h to Resonance.cpp
- added the ALLOW_CHARGE_SEPARATION flag: now by default charge
  separation structures are not displayed if there's at least one
  structure with no charge separation
- TODO
  * add SWIG wrappers
  * add a few test tp resMolSupplierTest.cpp
2015-10-23 18:41:53 +01:00
Paolo Tosco
6ccda75d77 - fixed a problem when selecting maxStructs = 0 2015-10-21 20:27:02 +01:00
Paolo Tosco
f43677b978 - fixed a problem with thiocarboxylates/thiolates not being perceived
as conjugated like their oxygen analogs
- fixed an issue with large numbers of resonance structures exceeding
  the unsigned int allowance
- implemented the uniquify feature properly
- uniquify now defaults to false when using the ResonanceMolSupplier-
  enabled SubstructMatch() version
- the concept of 'laziness' is now clearer
- TODO:
  * remove some debugging info
  * move classes from .h to .cpp
  * SWIG wrappers
  * improve resonance structure sorting for degenerate resonance
    structures
  I will do all of the above ASAP
2015-10-21 20:06:53 +01:00
Greg Landrum
c6b3d5d4a0 sync 2015-10-19 17:47:52 -04:00
Greg Landrum
91fc0de1ed include cleanup 2015-10-19 16:06:48 +02:00
Greg Landrum
442e842c58 remove vestigial svn tags 2015-10-19 16:04:42 +02:00
Paolo Tosco
f96787eede - added a check for non-NULLness of d_atom and d_bond pointers
in the AtomElectrons and BondElectrons constructors
- removed superfluous NULLness check in ConjElectrons destructor
- outer electrons are used instead of atomic number to
  determine formal charging behaviour
- better handling of electronegativity using Allen electronegativity
  instead of the number of outer electrons
- removed superfluous code in sanitizeMol() (I had missed the
  "If there is a failure in the sanitization, a SanitException will be thrown"
  note)
- used getOtherAtom() method whose existence I ignored (thanks Greg!)
2015-10-19 00:06:31 +01:00
Paolo Tosco
8a0e1ed824 - removed spurious x flags 2015-10-04 23:23:36 +01:00
Paolo Tosco
eaa187b03d - added ResonanceMolSupplier
- added overloaded SubstructMatch() version supporting ResonanceMolSupplier
- added relevant Python wrappers
- added C++/Python tests
2015-10-04 23:21:28 +01:00