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

PubchemApi.fetch_data()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 2
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
"""
2
PubChem querying API.
3
"""
4
from __future__ import annotations
5
6
import abc
7
from typing import FrozenSet, Optional, Union
8
9
from mandos.model import Api, CompoundNotFoundError
10
from mandos.model.apis.pubchem_support.pubchem_data import PubchemData
11
12
13
class PubchemCompoundLookupError(CompoundNotFoundError):
0 ignored issues
show
Documentation introduced by
Empty class docstring
Loading history...
14
    """ """
15
16
17
class PubchemApi(Api, metaclass=abc.ABCMeta):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
18
    def fetch_data_from_cid(self, cid: int) -> Optional[PubchemData]:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
19
        # separated from fetch_data to make it completely clear what an int value means
20
        # noinspection PyTypeChecker
21
        return self.fetch_data(cid)
22
23
    def fetch_data(self, inchikey: str) -> Optional[PubchemData]:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
24
        raise NotImplementedError()
25
26
    def find_similar_compounds(self, inchi: Union[int, str], min_tc: float) -> FrozenSet[int]:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
27
        raise NotImplementedError()
28
29
30
__all__ = ["PubchemApi", "PubchemCompoundLookupError"]
31