11"""CLI for PyOBO Database Generation."""
22
33import logging
4- import warnings
54from collections .abc import Callable , Iterable
65from pathlib import Path
76from typing import ParamSpec , TypeVar
@@ -383,29 +382,6 @@ def properties(zenodo: bool, directory: Path, **kwargs: Unpack[DatabaseKwargs])
383382 update_zenodo (PROPERTIES_RECORD , paths )
384383
385384
386- @database_annotate
387- def xrefs (zenodo : bool , directory : Path , ** kwargs : Unpack [DatabaseKwargs ]) -> None :
388- """Make the prefix-identifier-xref dump."""
389- from .database_utils import _iter_xrefs
390- from ..getters import db_output_helper
391-
392- warnings .warn ("Use pyobo.database.mappings instead" , DeprecationWarning , stacklevel = 2 )
393- with logging_redirect_tqdm ():
394- it = _iter_xrefs (** kwargs )
395- paths = db_output_helper (
396- it ,
397- "xrefs" ,
398- ("prefix" , "identifier" , "xref_prefix" , "xref_identifier" , "provenance" ),
399- summary_detailed = (0 , 2 ), # second column corresponds to xref prefix
400- directory = directory ,
401- )
402- if zenodo :
403- from zenodo_client import update_zenodo
404-
405- # see https://zenodo.org/record/4021477
406- update_zenodo (JAVERT_RECORD , paths )
407-
408-
409385@database_annotate
410386def mappings (zenodo : bool , directory : Path , ** kwargs : Unpack [DatabaseKwargs ]) -> None :
411387 """Make the SSSOM dump."""
@@ -421,14 +397,18 @@ def mappings(zenodo: bool, directory: Path, **kwargs: Unpack[DatabaseKwargs]) ->
421397 ]
422398 with logging_redirect_tqdm ():
423399 it = _iter_mappings (** kwargs )
424- db_output_helper (
400+ paths = db_output_helper (
425401 it ,
426402 "mappings" ,
427403 columns ,
428404 directory = directory ,
429405 )
430406 if zenodo :
431- raise NotImplementedError ("need to do initial manual upload of SSSOM build" )
407+ from zenodo_client import update_zenodo
408+
409+ # TODO might not work because file paths for old xrefs were different
410+ # see https://zenodo.org/record/4021477
411+ update_zenodo (JAVERT_RECORD , paths )
432412
433413
434414if __name__ == "__main__" :
0 commit comments