Skip to content

Commit

Permalink
Merge pull request #62 from ncbo/jenkins_test
Browse files Browse the repository at this point in the history
Fixes for the Jenkins build
  • Loading branch information
caufieldjh authored Sep 4, 2024
2 parents bb472a8 + b4bb2f2 commit 9c30b8d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,17 @@ pipeline {
dir('./gitrepo') {
script {
// Get the names of all BioPortal ontologies
sh ". venv/bin/activate && kgbioportal get-ontology-list --api_key ${NCBO_API_KEY} --output data/raw/"
// This saves the list to data/raw/ontologylist.tsv
sh ". venv/bin/activate && kgbioportal get-ontology-list --api_key ${NCBO_API_KEY}"

// Now download all
// or at least in the future, do them all.
// For now just do a few
sh "printf 'ENVO\nPO\nSEPIO\n' > data/raw/ontologylist.tsv"

// Download the ontologies
sh ". venv/bin/activate && kbbioportal download --api_key ${NCBO_API_KEY} --ontology_file data/raw/ontologylist.tsv --output_dir data/raw/"
// This saves them to data/raw/
sh ". venv/bin/activate && kgbioportal download --api_key ${NCBO_API_KEY} --ontology_file data/raw/ontologylist.tsv"

}
}
Expand Down
2 changes: 1 addition & 1 deletion src/kg_bioportal/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def get_ontology_list(output_dir, api_key) -> None:
required=False,
type=click.Path(exists=True),
)
@click.option("output_dir", "-o", required=True, default="data/raw")
@click.option("--output_dir", "-o", required=True, default="data/raw")
@click.option(
"--snippet_only",
"-x",
Expand Down
3 changes: 3 additions & 0 deletions src/kg_bioportal/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def __init__(
if not os.path.exists(self.output_dir):
os.makedirs(self.output_dir)

if not api_key:
raise ValueError("API key is required for downloading from BioPortal.")

return None

# TODO: save NCBO ID and version for each ontology, then pass to transformer
Expand Down

0 comments on commit 9c30b8d

Please sign in to comment.