77from typing import Any
88
99import bioregistry
10+ import ror_downloader
1011from pydantic import ValidationError
11- from ror_downloader import (
12- OrganizationType ,
13- get_description ,
14- )
15- from ror_downloader import (
16- get_organizations as get_ror_records ,
17- )
18- from ror_downloader import (
19- get_version_info as get_ror_status ,
20- )
12+ from ror_downloader import OrganizationType
2113from tqdm .auto import tqdm
2214
2315from pyobo .struct import Obo , Reference , Term
3325)
3426
3527__all__ = [
36- "get_ror_records " ,
28+ "RORGetter " ,
3729 "get_ror_to_country_geonames" ,
3830]
3931
@@ -70,7 +62,7 @@ class RORGetter(Obo):
7062 root_terms = [CITY_CLASS , ORG_CLASS ]
7163
7264 def __post_init__ (self ):
73- self .data_version , _url , _path = get_ror_status ()
65+ self .data_version , _url , _path = ror_downloader . get_version_info ()
7466 super ().__post_init__ ()
7567
7668 def iter_terms (self , force : bool = False ) -> Iterable [Term ]:
@@ -105,7 +97,7 @@ def iter_terms(self, force: bool = False) -> Iterable[Term]:
10597
10698def iterate_ror_terms (* , force : bool = False ) -> Iterable [Term ]:
10799 """Iterate over terms in ROR."""
108- status , records = get_ror_records (force = force )
100+ status , records = ror_downloader . get_organizations (force = force )
109101 unhandled_xref_prefixes : set [str ] = set ()
110102
111103 seen_geonames_references = set ()
@@ -119,7 +111,7 @@ def iterate_ror_terms(*, force: bool = False) -> Iterable[Term]:
119111 term = Term (
120112 reference = Reference (prefix = PREFIX , identifier = identifier , name = primary_name ),
121113 type = "Instance" ,
122- definition = get_description (record ),
114+ definition = record . get_description (),
123115 )
124116 for organization_type in record .types :
125117 if organization_type in ROR_ORGANIZATION_TYPE_TO_OBI :
0 commit comments