Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sierra-moxon committed Nov 25, 2024
1 parent aa2aec9 commit 8f91cc0
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions app/routers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,6 @@ async def get_term_details_by_taxon_id(
return collated_results



@router.get(
"/api/pmid/{id}/models",
tags=["models"],
Expand All @@ -453,11 +452,7 @@ async def get_term_details_by_taxon_id(
async def get_model_details_by_pmid(
id: str = Path(..., description="A publication identifier (PMID)" " (e.g. 15314168 or 26954676)")
):
"""
Returns models for a given publication identifier (PMID).
"""

"""Returns models for a given publication identifier (PMID)."""
ont_r = OntologyResource(url=get_sparql_endpoint())
si = SparqlImplementation(ont_r)

Expand Down Expand Up @@ -499,12 +494,12 @@ async def get_models_by_orcid(
)
):
"""Returns model details based on an orcid."""
mod_orcid = f'https://orcid.org/{orcid}'
mod_orcid = f"https://orcid.org/{orcid}"
print(mod_orcid)
ont_r = OntologyResource(url=get_sparql_endpoint())
si = SparqlImplementation(ont_r)
query = (
"""
"""
PREFIX metago: <http://model.geneontology.org/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX has_affiliation: <http://purl.obolibrary.org/obo/ERO_0000066>
Expand All @@ -528,7 +523,7 @@ async def get_models_by_orcid(
}
}
"""
% mod_orcid
% mod_orcid
)

results = si._sparql_query(query)
Expand All @@ -541,6 +536,7 @@ async def get_models_by_orcid(
collated_results.append({"model_id": result["gocam"].get("value"), "title": result["title"].get("value")})
return collated_results


@router.get(
"/api/models",
tags=["models"],
Expand Down Expand Up @@ -782,4 +778,4 @@ async def get_gocam_models(
results = si._sparql_query(query)
transformed_results = transform_array(results, ["orcids", "names", "groupids", "groupnames"])
logger.info(transformed_results)
return transform_array(results, ["orcids", "names", "groupids", "groupnames"])
return transform_array(results, ["orcids", "names", "groupids", "groupnames"])

0 comments on commit 8f91cc0

Please sign in to comment.