From 36f9978c79c79a0b6c59bc3a1f859f48588ce801 Mon Sep 17 00:00:00 2001 From: GotthardG <51994228+GotthardG@users.noreply.github.com> Date: Wed, 19 Mar 2025 11:51:49 +0100 Subject: [PATCH] Update dependencies and improve Python path handling Updated several frontend dependencies including MUI packages and added new ones like `@mui/x-charts`. Adjusted the Python path setup in the CI configuration to correctly point to the `aaredb` backend, ensuring accurate module resolution. --- backend/app/routers/sample.py | 19 +++++++++++++++---- backend/main.py | 4 ++-- backend/pyproject.toml | 2 +- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/backend/app/routers/sample.py b/backend/app/routers/sample.py index b4afb50..ebceabb 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 3500fb8..15e5af6 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 1d7ea89..1ed9e94 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 -- GitLab