Commit Graph

6 Commits

Author SHA1 Message Date
Eisuke Kawashima
11532089de Run clang-format against cpp (#4358) 2021-10-20 04:25:27 +02:00
Ric
91008ff11d Address compile warnings & trivial improvements (#2097)
* Address compile warnings & trivial improvements

* revert unwanted initializers; use RDUNUSED_PARAM for unused params

* revert fix in testRDFcustom; marked with 'TO DO' comment
2018-10-12 06:39:32 -04:00
Dan N
8bed437c5f Addresses several minor warning messages during the build (#1935)
* Address minor compilation warning messages

Addresses trivial compilation warning messages:

    [ 11%] Building CXX object Code/GraphMol/CMakeFiles/GraphMol.dir/AddHs.cpp.o
    rdkit/Code/GraphMol/AddHs.cpp:497:9: warning: unused variable 'dblBond' [-Wunused-variable]
      Bond *dblBond = nullptr;
            ^
    1 warning generated.

    [ 11%] Building CXX object Code/GraphMol/CMakeFiles/GraphMol.dir/Chirality.cpp.o
    rdkit/Code/GraphMol/Chirality.cpp:1738:62: warning: unused parameter 'mol' [-Wunused-parameter]
    bool isBondCandidateForStereo(const Bond *bond, const ROMol &mol) {
                                                                 ^
    1 warning generated.

    [ 44%] Building CXX object Code/GraphMol/CMakeFiles/graphmolMolOpsTest.dir/molopstest.cpp.o
    rdkit/Code/GraphMol/molopstest.cpp:4694:12: warning: unused variable 'nm' [-Wunused-variable]
        ROMol *nm = MolOps::renumberAtoms(*m, nVect);
               ^
    rdkit/Code/GraphMol/molopstest.cpp:6941:16: warning: unused variable 'm' [-Wunused-variable]
            RWMol *m = SmilesToMol(smiles);
                   ^
    2 warnings generated.

    [ 42%] Building CXX object Code/GraphMol/CMakeFiles/graphmoltestPicklerGlobalSetting.dir/testPicklerGlobalSettings.cpp.o
    rdkit/Code/GraphMol/testPicklerGlobalSettings.cpp:257:14: warning: unused parameter 'argc' [-Wunused-parameter]
    int main(int argc, char *argv[]) {
                 ^
    rdkit/Code/GraphMol/testPicklerGlobalSettings.cpp:257:26: warning: unused parameter 'argv' [-Wunused-parameter]
    int main(int argc, char *argv[]) {
                             ^
    2 warnings generated.

    [ 55%] Building CXX object Code/GraphMol/FilterCatalog/CMakeFiles/FilterCatalog.dir/FunctionalGroupHierarchy.cpp.o
    rdkit/Code/GraphMol/FilterCatalog/FunctionalGroupHierarchy.cpp:176:20: warning: unused variable 'NUM_FUNCS' [-Wunused-const-variable]
    const unsigned int NUM_FUNCS =
                       ^
    1 warning generated.

    [ 84%] Building CXX object Code/GraphMol/StructChecker/CMakeFiles/StructChecker.dir/ReCharge.cpp.o
    rdkit/Code/GraphMol/StructChecker/ReCharge.cpp:405:17: warning: unused variable 'atom' [-Wunused-variable]
        const Atom &atom = *Mol.getAtomWithIdx(i);
                    ^
    1 warning generated.

    [ 84%] Building CXX object Code/GraphMol/StructChecker/CMakeFiles/StructChecker.dir/Tautomer.cpp.o
    rdkit/Code/GraphMol/StructChecker/Tautomer.cpp:61:12: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
        if (-1 == ti || -1 == tj) continue;
            ~~ ^  ~~
    rdkit/Code/GraphMol/StructChecker/Tautomer.cpp:61:24: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
        if (-1 == ti || -1 == tj) continue;
                        ~~ ^  ~~
    2 warnings generated.

    [ 88%] Building CXX object Code/GraphMol/RGroupDecomposition/CMakeFiles/testRGroupDecomp.dir/testRGroupDecomp.cpp.o
    rdkit/Code/GraphMol/RGroupDecomposition/testRGroupDecomp.cpp:428:9: warning: unused variable 'res' [-Wunused-variable]
        int res = decomp.add(*mol);
            ^
    1 warning generated.

    [ 96%] Building CXX object Code/SimDivPickers/CMakeFiles/testSimDivPickers.dir/testPickers.cpp.o
    rdkit/Code/SimDivPickers/testPickers.cpp:19:10: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
      return abs((double)i - (double)j);
             ^
    rdkit/Code/SimDivPickers/testPickers.cpp:19:10: note: use function 'std::abs' instead
      return abs((double)i - (double)j);
             ^~~
             std::abs
    1 warning generated.

* Close open file handles during build set-up

Under Python3, the update_pains.py file generated warning
messages like:

    == Done updating pains files
    /Code/GraphMol/FilterCatalog/update_pains.py:140: ResourceWarning:
unclosed file <_io.TextIOWrapper
name='/Code/GraphMol/FilterCatalog/../../../Data/Pains/wehi_pains.csv'
mode='r' encoding='UTF-8'>
      for smiles, name in csv.reader(open(PAINS_CSV)):
    /Code/GraphMol/FilterCatalog/update_pains.py:169: ResourceWarning:
unclosed file <_io.TextIOWrapper
name='/Code/GraphMol/FilterCatalog/pains_a.in' mode='r'
encoding='UTF-8'>
      t = open(filename).read()
    /Code/GraphMol/FilterCatalog/update_pains.py:169: ResourceWarning:
unclosed file <_io.TextIOWrapper
name='/Code/GraphMol/FilterCatalog/pains_b.in' mode='r'
encoding='UTF-8'>
      t = open(filename).read()
    /Code/GraphMol/FilterCatalog/update_pains.py:169: ResourceWarning:
unclosed file <_io.TextIOWrapper
name='/Code/GraphMol/FilterCatalog/pains_c.in' mode='r'
encoding='UTF-8'>
      t = open(filename).read()
2018-06-26 13:57:22 -07: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
Brian Kelley
8609cd4883 Add StructChecker functionality
* StructChecker changes. Initial commit. First implementation. Added some tests.

* StructChecker: add  GoodAtoms and AcidicAtoms. new updates

* StructChecker: add new tests

* StructChecker: added TransformAugmentedAtoms()

* StructCheck: add structCheck to GraphMol. Fix compilation errors.

* StructChecker: add stereo verification and some utilities.

* StructChecker: function FixDubious3DMolecule was added

* StructChecker: checkStereo added. done with stereo.

* StructChecker: add StripSmallFragments()

* StructChecker: add AtomClash() function. Some cosmetic + tests

* StructChecker: checkAtoms() was started

* StructChecker: checkAtoms is ready

* StructChecker: user RingInfo from RDkit. Start regarge

* StructChecker: ReCharge molecule method prototype

* StructChecker: updates for ReCharge. Almost finished

* StructChecker: all ReCharge is done except external data tables loading

* StructChecker: add path tables into API. ReCharge completed

* Adds augmented atom data

Signed-off-by: Brian Kelley <brian.kelley@novartis.com>

* Removes extra files

Signed-off-by: Brian Kelley <brian.kelley@novartis.com>

* Adds path to test data via RDBASE environment

Signed-off-by: Brian Kelley <brian.kelley@novartis.com>

* Revert "Struct checker apr15"

* StructChecker: add missing tautomer tests

* Updates test to use RDBASE

* Adds initialization of data from data section

* Adds Python API and tests

* Fixes namespace for enum

* StructChecker: update/imporve strip small fragments

* StructChecker: fix acidic atoms (but logic does not work)

* StructChecker: fix match issue for CheckAtoms

* Adds macro guards

* Adds loading API and proper constructor

* Fixes tests, adds stereo test

* Fixes crash bug, matches[0] was being accessed from an empty match vector

* Reverts crash fix - conflicts with previous

* Adds the rest of the structure checker options

* StructChecker: fix atom matching for aromatic rings

* StructChecker: add tautomers checks. Update some tests

* StructChecker: stereo fixes. Add some tests

* StructChecker: fix check atoms. Start ligand symbol list

* StructChecker: fix some check atoms validation. Add Tranform to query lists. Start correct loading augmented atoms

* update

* another set of fixes

* StructChecker: fix loadDefaultAugmentedAtoms. Some changes in CheckAtom + tests + debug conditional breakpoints (TEMP operators)

* StructChecker: rewrited RecMatch() to sequential. Changed bond matching algorithm. small bug fixes

* Adds better logging of mismatched atoms

* Removes duplicated negative charge

* Fixes charges

* Adds nitro group test

* StructChecker: add better logging

* remove double logging

* Reformats code using RDKit's clang-format style

* StructChecker: Fix charge reformat using RDKit format.

* StructChecker: compilation restore after merge

* restore bond matching

* Removes the same fragments that strucheck does in case of ties

* Don't resanitize - this adds aromaticity which mucks things up

* Adds empty molecule checks

* Fixes atom clashes.

* Removes debug printing

* Removes debug logging info

* First pass at stereo fixes

* Fixes off by one error for dubious stereo fix

* Fixes more off by one errors

* Fixes more off by one errors

* More off by one fixes.

* Another off by one

* Fixes chiral flag set in molfile check

* Copies chiral flag over to largest fragment if necessary

* Poor man’s parity check.

* Find unspecified chiral centers ala Avalon.

* StructChecker: fix recursive match. Fix transformations

* StructChecker: fix transformation for atom list (using query atoms)

* Fixes checks && to &

* StructChecker: fix carboxylic acids tranform issue. Atom list is changed only if different

* StructChecker: documentation was updated

* Fixes snprintf and silences some warnings

* Adds Get/Set StructCheckerOptions

* Adds default AugmentedAtomTransforms
2016-10-24 08:00:07 +02:00