Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into dependabot/pip/fastap…
Browse files Browse the repository at this point in the history
…i-gte-0.103-and-lt-0.112
  • Loading branch information
holtgrewe committed Aug 29, 2024
2 parents 54c9a65 + 317a767 commit bab417b
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 38 deletions.
11 changes: 11 additions & 0 deletions cada_prio/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import cattr
import click
import logzero
import yaml

try:
import optuna
Expand Down Expand Up @@ -140,6 +141,16 @@ def cli_dump_graph(
inspection.dump_graph(path_graph, path_hgnc_info, hgnc_to_entrez)


@cli_utils.command("dump-openapi-yaml")
@click.argument("path_out", type=str)
def cli_dump_openapi_yaml(path_out: str):
"""Dump OpenAPI YAML file"""
from cada_prio import rest_server

with open(path_out, "wt") as f:
yaml.dump(rest_server.app.openapi(), f)


@cli.group("tune")
def cli_tune():
"""hyperparameter tuning"""
Expand Down
13 changes: 0 additions & 13 deletions requirements.txt

This file was deleted.

1 change: 1 addition & 0 deletions requirements.txt
1 change: 1 addition & 0 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ gensim >=4.3.2, <5.0
uvicorn >=0.23.2
fastapi >=0.103, <0.112
python-dotenv >=1.0, <2.0
pyyaml >=6.0, <7.0
1 change: 1 addition & 0 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ types-tabulate >=0.9.0.0
types-jsonschema >=4.17.0
types-tqdm >=4.66.0
types-xmltodict >=0.13.0.3
types-PyYAML >=6.0
networkx-stubs

sphinx
Expand Down
6 changes: 3 additions & 3 deletions tests/test_rest_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
@pytest.mark.asyncio
async def test_version():
with TestClient(rest_server.app) as client:
response = client.get("/version")
response = client.get("/api/v1/version")
assert response.status_code == 200


@mock.patch("cada_prio.rest_server.PATH_DATA", "tests/data/model_smoke")
@pytest.mark.asyncio
async def test_predict_with_gene():
with TestClient(rest_server.app) as client:
response = client.get("/predict/?hpo_terms=HP:0008551&hpo=HP:0000007&gene=MKS1")
response = client.get("/api/v1/predict/?hpo_terms=HP:0008551&hpo=HP:0000007&gene=MKS1")
assert response.status_code == 200


@mock.patch("cada_prio.rest_server.PATH_DATA", "tests/data/model_smoke")
@pytest.mark.asyncio
async def test_predict_without_gene():
with TestClient(rest_server.app) as client:
response = client.get("/predict/?hpo_terms=HP:0008551&hpo=HP:0000007")
response = client.get("/api/v1/predict/?hpo_terms=HP:0008551&hpo=HP:0000007")
assert response.status_code == 200
2 changes: 0 additions & 2 deletions utils/terraform/.gitignore

This file was deleted.

19 changes: 0 additions & 19 deletions utils/terraform/main.tf

This file was deleted.

1 change: 0 additions & 1 deletion utils/terraform/provider.tf

This file was deleted.

0 comments on commit bab417b

Please sign in to comment.