for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import enum
from dataclasses import dataclass
from typing import List, Optional
class TrueFalseUnknown(enum.Enum):
true = enum.auto()
false = enum.auto()
unknown = enum.auto()
@classmethod
def parse(cls, s: str):
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.
tf_map = {
"t": TrueFalseUnknown.true,
"f": TrueFalseUnknown.false,
"true": TrueFalseUnknown.true,
"false": TrueFalseUnknown.false,
}
return tf_map.get(s.lower().strip(), TrueFalseUnknown.unknown)
@dataclass
class G2pInteraction:
target: str
target_id: str
target_gene_symbol: str
target_uniprot: str
target_species: str
ligand_id: int
type: str
action: str
selectivity: TrueFalseUnknown
endogenous: TrueFalseUnknown
primary_target: TrueFalseUnknown
affinity_units: str
affinity_median: float
class G2pData:
inchikey: str
g2pid: int
name: str
approved: bool
pubchem_id: Optional[int]
interactions: List[G2pInteraction]
__all__ = ["G2pInteraction", "G2pData", "TrueFalseUnknown"]