Passed
Push — dependabot/pip/pyarrow-4.0.1 ( ca09ce...b2836e )
by
unknown
02:18 queued 20s
created

mandos.model.apis.g2p_data   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 41
dl 0
loc 51
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A TrueFalseUnknown.parse() 0 9 1
1
import enum
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
from dataclasses import dataclass
3
from typing import List, Optional
4
5
6
class TrueFalseUnknown(enum.Enum):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
7
    true = enum.auto()
8
    false = enum.auto()
9
    unknown = enum.auto()
10
11
    @classmethod
12
    def parse(cls, s: str):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
Coding Style Naming introduced by
Argument name "s" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
13
        tf_map = {
14
            "t": TrueFalseUnknown.true,
15
            "f": TrueFalseUnknown.false,
16
            "true": TrueFalseUnknown.true,
17
            "false": TrueFalseUnknown.false,
18
        }
19
        return tf_map.get(s.lower().strip(), TrueFalseUnknown.unknown)
20
21
22
@dataclass
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
best-practice introduced by
Too many instance attributes (13/7)
Loading history...
23
class G2pInteraction:
24
    target: str
25
    target_id: str
26
    target_gene_symbol: str
27
    target_uniprot: str
28
    target_species: str
29
    ligand_id: int
30
    type: str
31
    action: str
32
    selectivity: TrueFalseUnknown
33
    endogenous: TrueFalseUnknown
34
    primary_target: TrueFalseUnknown
35
    affinity_units: str
36
    affinity_median: float
37
38
39
@dataclass
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
40
class G2pData:
41
    inchikey: str
42
    g2pid: int
43
    name: str
44
    type: str
45
    approved: bool
46
    pubchem_id: Optional[int]
47
    interactions: List[G2pInteraction]
48
49
50
__all__ = ["G2pInteraction", "G2pData", "TrueFalseUnknown"]
51