Passed
Push — main ( 4074a3...6b8d16 )
by Douglas
01:56
created

PubchemApi.find_similar_compounds()   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 3
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 Union
8
9
import decorateme
0 ignored issues
show
introduced by
Unable to import 'decorateme'
Loading history...
10
11
from mandos.model import Api, CompoundNotFoundError
12
from mandos.model.apis.pubchem_support.pubchem_data import PubchemData
13
14
15
class PubchemCompoundLookupError(CompoundNotFoundError):
0 ignored issues
show
Documentation introduced by
Empty class docstring
Loading history...
16
    """ """
17
18
19
@decorateme.auto_repr_str()
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
20
class PubchemApi(Api, metaclass=abc.ABCMeta):
21
    def fetch_data(self, inchikey: Union[str, int]) -> PubchemData:
22
        """
23
        Fetches compound data for the given InChI Key.
24
25
        Raises:
26
            PubchemCompoundLookupError: If the compound ID is not found
27
        """
28
        raise NotImplementedError()
29
30
31
__all__ = ["PubchemApi", "PubchemCompoundLookupError"]
32