diff --git a/backend/app/routers/sample.py b/backend/app/routers/sample.py index b4afb5066fc56783120e9464c024416b87a02074..ebceabb6b4e21bb203634226c4520af79da9e342 100644 --- a/backend/app/routers/sample.py +++ b/backend/app/routers/sample.py @@ -124,7 +124,11 @@ async def create_sample_event( return sample # Return the sample, now including `mount_count` -@router.post("/{sample_id}/upload-images", response_model=Image) +@router.post( + "/{sample_id}/upload-images", + response_model=Image, + operation_id="upload_sample_image", +) async def upload_sample_image( sample_id: int, uploaded_file: UploadFile = File(...), @@ -231,7 +235,9 @@ async def upload_sample_image( return new_image -@router.get("/results", response_model=List[SampleResult]) +@router.get( + "/results", response_model=List[SampleResult], operation_id="get_sample_results" +) async def get_sample_results(active_pgroup: str, db: Session = Depends(get_db)): # Query samples for the active pgroup using joins. samples = ( @@ -302,6 +308,7 @@ async def get_sample_results(active_pgroup: str, db: Session = Depends(get_db)): @router.post( "/samples/{sample_id}/experiment_parameters", response_model=ExperimentParametersRead, + operation_id="create_experiment_parameters_for_sample", ) def create_experiment_parameters_for_sample( sample_id: int, @@ -344,7 +351,9 @@ def create_experiment_parameters_for_sample( return new_exp -@router.post("/processing-results", response_model=ResultResponse) +@router.post( + "/processing-results", response_model=ResultResponse, operation_id="create_result" +) def create_result(payload: ResultCreate, db: Session = Depends(get_db)): # Check experiment existence experiment = ( @@ -376,7 +385,9 @@ def create_result(payload: ResultCreate, db: Session = Depends(get_db)): @router.get( - "/processing-results/{sample_id}/{run_id}", response_model=List[ResultResponse] + "/processing-results/{sample_id}/{run_id}", + response_model=List[ResultResponse], + operation_id="get_results_for_run_and_sample", ) async def get_results_for_run_and_sample( sample_id: int, run_id: int, db: Session = Depends(get_db) diff --git a/backend/main.py b/backend/main.py index 3500fb8303598d917f4929bab3ca6c5ac1223873..15e5af6bf264dcd5d81114e234a4bb9ae68c4a5f 100644 --- a/backend/main.py +++ b/backend/main.py @@ -143,8 +143,8 @@ async def lifespan(app: FastAPI): load_slots_data(db) else: # dev or test environments print(f"{environment.capitalize()} environment: Regenerating database.") - Base.metadata.drop_all(bind=engine) - Base.metadata.create_all(bind=engine) + # Base.metadata.drop_all(bind=engine) + # Base.metadata.create_all(bind=engine) # from sqlalchemy.engine import reflection # from app.models import ExperimentParameters # adjust the import as needed # inspector = reflection.Inspector.from_engine(engine) diff --git a/backend/pyproject.toml b/backend/pyproject.toml index 1d7ea895d5845966082cdd125c9dcce9e465c5b6..1ed9e94abf3d1327a85dcf222de505165343b866 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -33,5 +33,5 @@ dependencies = [ [tool.pytest.ini_options] norecursedirs = ["backend/python-client"] # Or limit files explicitly -python_files = ["test_auth.py"]#, +python_files = [""]#,""test_auth.py"]#, #"test_contact.py"] \ No newline at end of file