Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldcampbelljr committed Sep 21, 2023
1 parent b1e389f commit cd88448
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pipestatreader/reader.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import argparse
import fastapi
import uvicorn
from typing import Optional
from pipestat import RecordNotFoundError, SamplePipestatManager
from pydantic import BaseModel

Check warning on line 6 in pipestatreader/reader.py

View check run for this annotation

Codecov / codecov/patch

pipestatreader/reader.py#L1-L6

Added lines #L1 - L6 were not covered by tests

import argparse

# Simple Argument Parser
parser = argparse.ArgumentParser()
parser.add_argument("--config", type=str, help="an integer number")
parser.add_argument("--config", type=str, help="absolute path to pipestat config file.")
args = parser.parse_args()
pipestatcfg = args.config

Check warning on line 12 in pipestatreader/reader.py

View check run for this annotation

Codecov / codecov/patch

pipestatreader/reader.py#L9-L12

Added lines #L9 - L12 were not covered by tests

# For testing, simply hardcode config atm
# Create PipestatManager that will interface with the PostgreSQL database
# pipestatcfg = "/home/drc/PythonProjects/pipestat/testimport/drcdbconfig.yaml"
psm = SamplePipestatManager(config_file=pipestatcfg)

Check warning on line 16 in pipestatreader/reader.py

View check run for this annotation

Codecov / codecov/patch

pipestatreader/reader.py#L16

Added line #L16 was not covered by tests

app = fastapi.FastAPI(

Check warning on line 18 in pipestatreader/reader.py

View check run for this annotation

Codecov / codecov/patch

pipestatreader/reader.py#L18

Added line #L18 was not covered by tests
title="Pipestat Reader",
description="Allows reading pipestat files from a POSTGRESQL Server",
description="Allows reading pipestat files from a PostgreSQL Database",
version="0.01",
)

Expand All @@ -36,7 +36,7 @@ async def home():


@app.get("/data/{record_identifier}")
async def retrieve_results(record_identifier: str):
async def retrieve_results_one_record(record_identifier: str):

Check warning on line 39 in pipestatreader/reader.py

View check run for this annotation

Codecov / codecov/patch

pipestatreader/reader.py#L38-L39

Added lines #L38 - L39 were not covered by tests
"""
Get all the results for one record
"""
Expand Down Expand Up @@ -77,7 +77,7 @@ async def retrieve_results(record_identifier: str, result_identifier: str):
@app.get("/output_schema/")
async def retrieve_output_schema(pipeline_type: Optional[str] = None):

Check warning on line 78 in pipestatreader/reader.py

View check run for this annotation

Codecov / codecov/patch

pipestatreader/reader.py#L77-L78

Added lines #L77 - L78 were not covered by tests
"""
Get specific result given a record identifier and a result identifier
Get the output_schema used by the PipestatManager.
"""

if pipeline_type == "sample":
Expand Down
1 change: 1 addition & 0 deletions requirements/requirements-all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ pandas
eido
uvicorn
fastapi
pydantic

0 comments on commit cd88448

Please sign in to comment.