Skip to content

Commit b85d439

Browse files
committed
lint
1 parent e5a80f9 commit b85d439

1 file changed

Lines changed: 24 additions & 9 deletions

File tree

‎src/crate_builder_script/extractors.py‎

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,20 @@
1111

1212
# HuBMAP two-letter organ codes -> (label, UBERON term)
1313
ORGAN_MAP = {
14-
"LY": ("Lymph Node", "UBERON:0000029"), "SP": ("Spleen", "UBERON:0002106"),
15-
"TH": ("Thymus", "UBERON:0002370"), "BM": ("Bone Marrow", "UBERON:0002371"),
16-
"LK": ("Kidney (left)", "UBERON:0004538"), "RK": ("Kidney (right)", "UBERON:0004539"),
17-
"HT": ("Heart", "UBERON:0000948"), "LI": ("Large Intestine", "UBERON:0000059"),
18-
"SI": ("Small Intestine", "UBERON:0002108"), "LL": ("Lung (left)", "UBERON:0002168"),
19-
"RL": ("Lung (right)", "UBERON:0002167"), "LV": ("Liver", "UBERON:0002107"),
20-
"PA": ("Pancreas", "UBERON:0001264"), "BL": ("Bladder", "UBERON:0001255"),
14+
"LY": ("Lymph Node", "UBERON:0000029"),
15+
"SP": ("Spleen", "UBERON:0002106"),
16+
"TH": ("Thymus", "UBERON:0002370"),
17+
"BM": ("Bone Marrow", "UBERON:0002371"),
18+
"LK": ("Kidney (left)", "UBERON:0004538"),
19+
"RK": ("Kidney (right)", "UBERON:0004539"),
20+
"HT": ("Heart", "UBERON:0000948"),
21+
"LI": ("Large Intestine", "UBERON:0000059"),
22+
"SI": ("Small Intestine", "UBERON:0002108"),
23+
"LL": ("Lung (left)", "UBERON:0002168"),
24+
"RL": ("Lung (right)", "UBERON:0002167"),
25+
"LV": ("Liver", "UBERON:0002107"),
26+
"PA": ("Pancreas", "UBERON:0001264"),
27+
"BL": ("Bladder", "UBERON:0001255"),
2128
"SK": ("Skin", "UBERON:0002097"),
2229
"LF": ("Fallopian tube (left)", "UBERON:0001303"),
2330
"RF": ("Fallopian tube (right)", "UBERON:0001302"),
@@ -192,7 +199,11 @@ def _assay_info_kwds(ancs: list) -> list[str]:
192199
rslt = []
193200
for anc in ancs:
194201
md = anc.get("metadata", {})
195-
for v in [anc.get("dataset_type"), md.get("assay_category"), md.get("analyte_class")]:
202+
for v in [
203+
anc.get("dataset_type"),
204+
md.get("assay_category"),
205+
md.get("analyte_class"),
206+
]:
196207
if v and v not in rslt:
197208
rslt.append(v)
198209
return rslt
@@ -212,7 +223,11 @@ def keywords(self) -> list[str]:
212223
if rui:
213224
r = json.loads(rui) if isinstance(rui, str) else rui
214225
for term in r.get("ccf_annotations", []) or []:
215-
short = "UBERON:" + term.rsplit("_", 1)[-1] if "UBERON" in term else term
226+
short = (
227+
"UBERON:" + term.rsplit("_", 1)[-1]
228+
if "UBERON" in term
229+
else term
230+
)
216231
if short not in kws:
217232
kws.append(short)
218233
break

0 commit comments

Comments
 (0)