16
16
from .. import anchor as _anchor
17
17
from . import tabular
18
18
19
- from ... import commons , vocabularies
19
+ from ...commons import logger
20
+ from ...vocabularies import RECEPTOR_SYMBOLS
20
21
from ...retrieval import requests
21
22
22
23
import pandas as pd
@@ -75,9 +76,9 @@ def neurotransmitters(self) -> List[str]:
75
76
# Likely ill-formed tsv's
76
77
return [
77
78
"{} ({})" .format (
78
- vocabularies . RECEPTOR_SYMBOLS [t ]['neurotransmitter' ]['label' ],
79
- vocabularies . RECEPTOR_SYMBOLS [t ]['neurotransmitter' ]['name' ],
80
- ) if t in vocabularies . RECEPTOR_SYMBOLS else
79
+ RECEPTOR_SYMBOLS [t ]['neurotransmitter' ]['label' ],
80
+ RECEPTOR_SYMBOLS [t ]['neurotransmitter' ]['name' ],
81
+ ) if t in RECEPTOR_SYMBOLS else
81
82
f"{ t } (undeciphered)"
82
83
for t in self .receptors
83
84
]
@@ -107,7 +108,7 @@ def parse_tsv_data(cls, data: dict):
107
108
std = [data [_ ]["density (sd)" ] for _ in labels ]
108
109
except KeyError as e :
109
110
print (str (e ))
110
- commons . logger .error ("Could not parse fingerprint from this dictionary" )
111
+ logger .error ("Could not parse fingerprint from this dictionary" )
111
112
return {
112
113
'unit' : next (iter (units )),
113
114
'labels' : labels ,
@@ -124,9 +125,11 @@ def polar_plot(self, *args, backend='matplotlib', **kwargs):
124
125
if backend == "matplotlib" :
125
126
try :
126
127
import matplotlib .pyplot as plt
127
- except ImportError :
128
- commons .logger .error ("matplotlib not available. Plotting of fingerprints disabled." )
129
- return None
128
+ except ImportError as e :
129
+ logger .error (
130
+ "matplotlib not available. Please install matplotlib or use or another backend such as plotly."
131
+ )
132
+ raise e
130
133
from collections import deque
131
134
132
135
# default args
0 commit comments