Skip to content

Commit

Permalink
Update MeSH import for 2023+ data (#151)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Charles Tapley Hoyt <cthoyt@gmail.com>
  • Loading branch information
hrshdhgd and cthoyt authored Aug 18, 2023
1 parent 6311733 commit 1ed30a3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pyobo/sources/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,12 @@ def get_descriptor_records(element: Element, id_key: str, name_key) -> List[Dict

def get_scope_note(descriptor_record) -> Optional[str]:
"""Get the scope note from the preferred concept in a term's record."""
for concept in descriptor_record["concepts"]:
if isinstance(descriptor_record, dict):
# necessary for pre-2023 data
concepts = descriptor_record["concepts"]
else:
concepts = descriptor_record
for concept in concepts:
scope_note = concept.get("ScopeNote")
if scope_note is not None:
return scope_note.replace("\\n", "\n").strip()
Expand Down

0 comments on commit 1ed30a3

Please sign in to comment.