Completed
Push — master ( 2bc047...202252 )
by Rich
01:16
created

Conformer   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 35
Duplicated Lines 0 %
Metric Value
dl 0
loc 35
rs 10
wmc 6

3 Methods

Rating   Name   Duplication   Size   Complexity  
A is_three_d() 0 6 1
A __repr__() 0 3 1
A atom_positions() 0 6 1
1
#! /usr/bin/env python
2
#
3
# Copyright (C) 2007-2009 Rich Lewis <[email protected]>
4
# License: 3-clause BSD
5
6
"""
7
skchem.core.conformer
8
9
Defining conformers in scikit-chem.
10
"""
11
12
import rdkit.Chem
0 ignored issues
show
Configuration introduced by
The import rdkit.Chem could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
13
from skchem.core import Point3D
14
from skchem.core import ChemicalObject
15
16
class Conformer(rdkit.Chem.rdchem.Conformer, ChemicalObject):
17
18
    """ Class representing a Conformer in scikit-chem. """
19
    #should use a view, list for now
20
    @property
21
    def atom_positions(self):
22
23
        """ Return the atom positions in the conformer for the atoms in the molecule. """
24
25
        return [Point3D.from_super(self.GetAtomPosition(i)) for i in range(self.GetNumAtoms())]
0 ignored issues
show
Bug introduced by
The Instance of Conformer does not seem to have a member named GetAtomPosition.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of Conformer does not seem to have a member named GetNumAtoms.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
26
27
    @atom_positions.setter
28
    def atom_positions(self, value):
29
30
        """ Set the atom positions in the conformer.  Not implemented. """
31
32
        raise NotImplementedError
33
34
    @property
35
    def is_three_d(self):
36
37
        """ Return whether the conformer is three dimensional. """
38
39
        return self.is3D()
0 ignored issues
show
Bug introduced by
The Instance of Conformer does not seem to have a member named is3D.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
40
41
    @is_three_d.setter
42
    def is_three_d(self, value):
43
44
        """ Set whether the conformer is three dimensional. """
45
46
        self.set3D(value)
0 ignored issues
show
Bug introduced by
The Instance of Conformer does not seem to have a member named set3D.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
47
48
    def __repr__(self):
49
        return '<{klass} id="{id}" at {address}>'.format(klass=self.__class__.__name__, \
50
            id=self.GetId(), address=hex(id(self)))
0 ignored issues
show
Bug introduced by
The Instance of Conformer does not seem to have a member named GetId.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
51
52