88 Commits

Author SHA1 Message Date
Ricardo Rodriguez
7b7a8a4e17 Refactor iostreams includes (#8846)
* refactor iostreams includes

* restore ostream to MonomerInfo.cpp
2025-10-08 16:08:01 +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
ab152a4ed1 Switch over to using pytest to run the python tests (#5916)
* misc adaptations/modernizations
plus a few changes to allow pytest discovery

* get the recap unittests running

* pytest config updates

* all tests pass

* integrate the pytest stuff into ctest

* integrate Projects dir
better cmake integration

* ci build env updates

* ignore more files

* remove six.py

* cleanup UnitTestPandasTools

* cleanup pytest

* remove obsolete use of rdkit.six from doctests

* update release notes

* mysterious CI fix

* add conftest to remove some tests

* remove the old python-based testing infrastructure

---------

Co-authored-by: Ric <ricrogz@gmail.com>
2023-11-03 14:39:24 +01:00
Paolo Tosco
4e5a989422 update avalontools version to incorporate bug fixes (#6513)
* - fixed a crash in Avalon occurring when an atom idx in the bond table is out of bounds
- removed 0-padding ahead of parsing bond line as it is unnecessary and potentially harmful
- forked Avalon so it can be patched more conveniently

* updated the Avalon pre-relase number and updated the checksum

* updated pre-release number and checksum

* moved the Avalon fork under RDKit organization
updated checksum and release

---------

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2023-07-14 12:58:18 +02:00
Ric
880a8e5725 Reformat Python code for 2023.03 release (#6294)
* run yapf

* run isort

---------

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2023-04-28 06:53:56 +02:00
Ric
58d135a874 Reformat C/C++ code ahead of 2023.03 release (#6295)
* format files

* format template files too
2023-04-28 04:42:35 +02:00
Paolo Tosco
f303e59f8c - fix indentation (#5951)
- fix regex check (which currently always fails)

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2023-01-10 10:31:20 +01:00
Paolo Tosco
206b698230 Avoid that trailing garbage pollutes the fmemopen buffer (#5928)
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2023-01-07 05:11:02 +01:00
Paolo Tosco
d75d3e6b1c - update AvalonTools to version 2.0.4a (#5796)
- update config files in Data to the same version as in AvalonTools
- fix a bug in AvalonTools.cpp causing the last character of the optString bassed to initCheckMol() to be deleted
- add a test to confirm the bug is fixed

Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2022-12-01 16:48:09 +01:00
Paolo Tosco
f642667686 avoid passing a NULL pointer to CanSmiles (which will happen if there are not atoms in the molblock and hence a NULL SMILES) as undefined behavior will arise (#5750)
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2022-11-14 15:37:44 +01:00
Paolo Tosco
186d821d57 Update AvalonTools to 2.0.2 (#5620)
Co-authored-by: Tosco, Paolo <paolo.tosco@novartis.com>
2022-10-06 05:45:49 +02:00
Paolo Tosco
75416ba090 Update AvalonTools to version 2.0.1 (#5591) 2022-09-28 05:48:04 +02:00
Eisuke Kawashima
b53ee20b49 Fix Flake8 erorrs (#4252)
* Fix PEP8 [E101](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [E502](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [E703](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [E711](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [E712](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [E713](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [E722](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)

* Fix PEP8 [W605](https://github.com/PyCQA/pycodestyle/blob/2.8.0/docs/intro.rst#error-codes)
2022-03-10 06:55:18 +01:00
Greg Landrum
00f23b5047 [WIP] Clean up the warning landscape (#5048)
* suppress a bunch of warnings from third-party code
get rid of one warning in RDKit code

* corrections

* fix the maeparser flags

* remove some more inchi warnings with clang
2022-03-01 05:00:25 +01:00
Greg Landrum
2053a98ffa Fixes #4330 (#4338)
* Fixes #4330

* new test
2021-07-15 10:26:29 -04:00
Greg Landrum
a1d94d5f22 Fixes #4075 (#4079) 2021-04-23 16:43:18 -04:00
Paolo Tosco
e911da94fd use https for Avalon and Inchi downloads (#3915)
Co-authored-by: Paolo Tosco <paolo.tosco@novartis.com>
2021-03-11 21:00:22 +01:00
Eisuke Kawashima
e0b665bfe1 Clean up CMake files (#3417)
* Clean up CMake files

* bump CMake minimum required version to 3.7 to utilize
  [`VERSION_GREATER_EQUAL`](https://cmake.org/cmake/help/v3.7/release/3.7.html#index-0-command:if)
* improve catch-dependency
* fix conditionals
* use early return
* properly use CMake commands

* Apply suggestions from code review

Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2020-11-28 08:00:39 +01:00
Greg Landrum
c0a62388a2 switch to using target_compile_definitions instead of add_definitions (#3350)
* switch to using target_compile_definitions instead of add_definitions

* missed one
2020-08-21 04:49:07 +02:00
Greg Landrum
45bf58754a Cleanup some cmake dependencies (#3077)
* change minimal cmake version to a consistent 3.5

* progress towards a cleanup

* get the basic python deps working

* two more libs

* another round of changes
all tests pass at this point

* next round of changes
all tests pass at this point

* close to done
all tests pass

* very close

* almost done

* shift the RDBoost dependencies around a bit

* remove an extraneous python linkage
this is trying to get the mac builds working again

* Only link to python if it was built shared (#3091)

* change in response to review

Co-Authored-By: Ric <ricrogz@users.noreply.github.com>

* move that suppression of the maybe-uninitialized warning to BoostStartInclude.h

Co-authored-by: Brian Kelley <fustigator@gmail.com>
Co-authored-by: Ric <ricrogz@users.noreply.github.com>
2020-04-17 14:34:23 +02: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
Eisuke Kawashima
dc7cc84a0c Fix typo [ci skip] 2019-10-17 17:45:50 +09:00
Eisuke Kawashima
185ec927ab Unset executable flag 2019-10-10 20:18:43 +09:00
Greg Landrum
7e6600f3be Fixes #2516 (#2519)
* RDStreams now installed properly

* skip Wrap directories if RDK_BUILD_PYTHON_WRAPPERS is not set

Fixes #2516
2019-06-28 09:57:00 -04:00
Greg Landrum
ec31bea97b clang-tidy-7 pass (#2408) 2019-04-16 12:05:47 -04:00
Ric
6224a42516 Build warnings revisited (#2318)
* unused vars in bison parser cleanup

* initialization order in TopologicalTorsionGenerator

* unused params in SLN bison

* sln flex unused params

* throwing destructor in TDTWriter

* signed comparison in substructmethods

* unused input param in smiles/smarts bison

* unused ms param in sln bison

* signed comparison in FingerprintGenerator

* store return of fscanf in StructCheckerOptions

* unreferenced var in catch

* uninitialized value in FileParserUtils

* avoid override overload warning in MolDraw2DSVG

* non-final overrides in Validate.h

* unused static var in Avalon

* unused vars in catch blocks

* make AvalonTools avalonSimilarityBits & avalonSSSBits const int

* assert fscanf result in StructCheckerOptions
2019-03-08 16:42:54 +01:00
Greg Landrum
24f1737839 Remove a bunch of Python2-related warts (#2315)
* remove all of the "from __future__" imports

* remove the first batch of rdkit.six imports/uses

* next step of rdkit.six removal

* removing xrange, range, and some maps

* next round of removals

* next round of cleanups

* fix inchi test

* last bits of "from rdkit.six" are gone

* and the last of the six stuff is gone

* strange importlib problem
2019-03-06 20:43:49 -05:00
Riccardo Vianello
c19ebb9c56 don't use a ctab as input for the computation of 2D coordinates (#2255)
* don't use a ctab as input for the computation of 2D coordinates

Fix GitHub issue 1062.

* make sure that the output 2D coordinates are ordered correctly
2019-02-25 12:39:01 -05:00
Ric
a6b26253ff Fix (most of) mem problems (#2123)
* do not use new on loggers

* del pointers in testDistGeom

* Update Dict hasNonPOD status on bulk update

* delete new Dicts in memtest1.cpp

* fixes in MolSuppliers and testFMCS

* PeriodicTable singleton as unique_ptr

* fix EEM_arrays leak

* fix leaks in testPBF

* fix ParamCollection leak in test UFF

* fix leaks in MMFF

* clear prop dict before read in in pickler

* fix leaks in testFreeSASA

* fix leaks in test3D

* modernize Dict.h & SmilesParse.cpp

* fix leaks in testQuery

* fix leaks in testCrystalFF

* fix leaks in cxsmilesTest

* fix leaks in Catalog & mol cat test

* fix leaks in ShapeUtils & tests

* fix leaks in testSubgraphs1

* fix leaks testFingerprintGenerators

* fix leaks in Catalog/FilterCatalog

* fix leaks in graphmolqueryTest

* these changes reduce bison parse leaks

* fixed leaks in testChirality.cpp

* fix leaks + 2 tests in testMolWriter

* fix 4m leaks in substructLibraryTest

* small improvements to molTautomerTest; still leaks

* fix leaks in testRGroupDecomp

* fix leaks in test; parser still leaks

* fix leaks in itertest

* fix 4m leaks in testDepictor

* fixes in smatest; still leaking due to parser

* fixes in testSLNParse; still leaking due to parser

* flex/bison: always add atoms with ownership; smarts error cleanup

* fix leaks in testReaction

* fix leaks in testSubstructMatch

* fix leaks in resMolSupplierTest

* fix leaks in testChemTransforms + bug in ChemTransforms

* fix leaks in testPickler

* fix leaks in testMolTransform

* fix leaks in testFragCatalog

* fix leak in testSLNParse. Still leaks due to Smiles

* fixed most leaks in testMolSupplier

* pre bison fix

* fix some atom & bond parse problems; others still fail

* bison smiles & smarts, atoms & bonds more or less fixed

* fix leaks in molopstest.cpp

* fix leaks in testFingerprints, MACCS.cpp & AtomPairs.cpp

* fix leaks in moldraw2Dtest1

* fix leaks in testDescriptors

* fix leaks in testInchi

* fix leaks in testUFFForceFieldHelpers

* fix leaks in hanoiTest & new_canon.h

* fix leaks in testMMFFForceField

* fix leaks in graphmolTest1

* fix leaks in testMMFFForceFieldHelpers

* fix leaks in testDistGeomHelpers

* fix leaks in testMolAlign

* initialize occupancy & temp facto with default values

* fix leak in TautomerTransform

* updated suppressions

* fix testStructChecker

* fix logging & py tests

* fix TautomerTransform class/struct issue

* remove misplaced delete in testSLNParse

* deinit in testAvalonLib1

* fix Avalon-triggered(?) bug in StructChecker/Pattern.cpp

* fix random testMolWriter/Supplier fails

- diversify output file names to avoid clashing.
- unify Writers close/destruct behavior.
- flushing/closing in tests.

* use reset in FFs Params.cpp

* comments on testMMFFForceField

* unrequired 'if's added to mol suppliers

* correct cast in FilterCatalog.h

* use unique_ptr in MACCS Patterns

* remove unrequred if in new_canon

* update & move suppressions
2018-10-29 14:33:26 +00:00
Paolo Tosco
f7c888844d moved test.h from RDBoost to RDGeneral for consistency with export.h (#2074) 2018-10-11 17:35:23 -04:00
Greg Landrum
2738c35178 Fixes #1903 (#1971)
* Fixes #1903

* update SWIG bindings too
2018-07-25 09:14:17 +02:00
Greg Landrum
77078eac66 Add an auto-populated file with cmake config options (#1874)
* this is a rough first pass, needs to be finished and is a strong argument for changing the names of some of the #defines that are currently used

* rationalize the rest of the #defines
add something to the release notes about this
2018-06-09 05:41:28 +02:00
Paolo Tosco
97d147b3f1 - fixes the dynamic/static library CMake logic (#1875) 2018-05-27 07:13:03 +02:00
Paolo Tosco
c08ea49bda - enable building DLLs on Windows (#1861)
* - enable building DLLs on Windows

* - export.h and test.h are now auto-generated by CMake
2018-05-16 08:42:41 +02:00
Greg Landrum
42eecc664d Integrate Coordgen (#1708)
* first pass, does not yet actually work

* pass2, same problems

* pass2, same problems

* another test

* new tests; bugfix

* move the code out to a header

* add a double bond example

* enable auto-downloads of the code

* move the function to its own namespace

* first pass at a basic python wrapper

* change coordgen commit used

* try supporting bond stereo; does not currently work

* cis/trans seems to now work.

* first pass at templates; needs testing

* use the fixed flag too

* need mol align

* expand test

* initial pass at python wrapper for template

* simplify tests

* add an option to directly use a substructure match for alignment

* scaling

* add #define

* Define a cache setting for RDK_COORDGEN_LIBS to allow these to be used in other packages

* return the conformer id from addCoords

* Make CoordGen the default when it’s available.
This is a backup commit… the tests don’t even come close to passing.

* add some debugging options for a bit

* add alignment step to testing when using non-fixed coords

* Add global to allow use of CoordGen to be disabled
get the basic depictor tests working

* make coordgen the default when it is available

* make sure things continue to work when coordgen is disabled

* get windows builds working

* mods to get this building on windows.
something is screwy with the fileParsersTest1

* no need to generate coords for the 1K C string

* fix java wrappers

* works on linux

* update the (stupid) way dependencies were handled on windows.
this allows a lot of cleanup of cmake files (still more to do)
the linux build is unlikely to work due to the way _statics aren't handled

* docs

* extend forceRDKit applicability

* switch coordgen version

* try using templates

* try to get the template dir finding reasonably robust w.r.t. conda install

* continuing to iterate on the way the template file is installed

* fix a problem caused by the merge

* remove test that should never have been checked in

* update expected results for cartridge tests

* switch back to using the RDKit as the default coordinate generator
2018-02-15 05:36:03 +01:00
Greg Landrum
1efa8e696e another clang-format run 2017-10-12 06:42:15 +02:00
Greg Landrum
f94e277856 another pass of clang modernize 2017-10-12 06:35:51 +02:00
Greg Landrum
c775897625 disable some warnings for the avalon code too 2017-07-03 04:48:33 +02:00
Brian Kelley
5cff04583d Fixes memory leak in closeCheckMolFiles, fixes valgrind read issue in initCheckMol (#1200) 2016-12-13 16:33:09 +01:00
Brian Kelley
7d0f3e0743 Fix/expose run struchk (#1147)
* Exposes GetMolCheckLog to python

* Updates docs to reflect reality
2016-11-04 04:31:04 +01:00
gedeck
e9af48ffd7 Issue1071/yapf (#1078)
* Issue #1071: add yapf configuration file

* yapf formatting of Code directory

* yapf formatting of Contrib directory

* yapf formatting of Data directory

* yapf formatting of Docs directory

* yapf formatting of External directory

* yapf formatting of Projects directory

* yapf formatting of Regress directory

* yapf formatting of Scripts directory

* yapf formatting of Web directory

* yapf formatting of rdkit directory
2016-09-23 04:58:46 +02:00
Greg Landrum
c88ab59085 do not download the avalon distribution if we don't need it (#858) 2016-04-13 09:55:58 -04:00
Paolo Tosco
8135eb0396 - Updated Install.md and README files related to the new CMake build
procedures involving the Avalon Toolkit, InChI and PostgreSQL cartridge
2016-04-03 23:06:28 +01:00
Greg Landrum
ccbebcf3ba and another block of warnings 2016-03-30 14:03:54 +02:00
Greg Landrum
e04aed8ea8 another batch of warnings squashed 2016-03-30 13:44:21 +02:00
Paolo Tosco
8adfc6503a - added the possibility to override AVALONTOOLS_BASE and INCHI_BASE too 2016-02-28 08:30:47 +00:00
Paolo Tosco
31f2b33cbc - download URLs and MD5 checksums can now be overridden with CMake
definitions
- InChI and AvalonTools README files were updated accordingly
2016-02-28 07:49:45 +00:00
Paolo Tosco
4363a40489 - added a downloadAndCheckMD5() function which attempts to use CMake
DOWNLOAD first, and if it fails it falls back to curl (Unix, OS X)
  or Powershell (Windows). The MD% sum is check with the nativa CMake
  command md5sum
2016-02-27 22:15:46 +00:00
Paolo Tosco
ec400a896d - improved curl workaround 2016-02-23 09:21:11 +00:00
Paolo Tosco
a76f413b0d - reverting previous change 2016-02-23 09:13:00 +00:00