Skip to content

Commit 5147daf

Browse files
committed
Moved 'TiffSeriesInfo' Pydantic model to the CLEM API page
1 parent befc71b commit 5147daf

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

src/murfey/server/api/clem.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
import re
44
import traceback
5+
from ast import literal_eval
56
from importlib.metadata import EntryPoint # type hinting only
67
from logging import getLogger
78
from pathlib import Path
8-
from typing import Optional, Type, Union
9+
from typing import Literal, Optional, Type, Union
910

1011
from backports.entry_points_selectable import entry_points
1112
from fastapi import APIRouter
13+
from pydantic import BaseModel, validator
1214
from sqlalchemy.exc import NoResultFound
1315
from sqlmodel import Session, select
1416

@@ -23,7 +25,6 @@
2325
CLEMTIFFFile,
2426
)
2527
from murfey.util.db import Session as MurfeySession
26-
from murfey.util.models import TIFFSeriesInfo
2728

2829
# Set up logger
2930
logger = getLogger("murfey.server.api.clem")
@@ -622,7 +623,7 @@ def register_image_stack(
622623
"/sessions/{session_id}/clem/preprocessing/process_raw_lifs"
623624
) # API posts to this URL
624625
def process_raw_lifs(
625-
session_id: int, # Used by the decorator
626+
session_id: int,
626627
lif_file: Path,
627628
db: Session = murfey_db,
628629
):
@@ -654,9 +655,15 @@ def process_raw_lifs(
654655
return True
655656

656657

658+
class TIFFSeriesInfo(BaseModel):
659+
series_name: str
660+
tiff_files: list[Path]
661+
series_metadata: Path
662+
663+
657664
@router.post("/sessions/{session_id}/clem/preprocessing/process_raw_tiffs")
658665
def process_raw_tiffs(
659-
session_id: int, # Used by the decorator
666+
session_id: int,
660667
tiff_info: TIFFSeriesInfo,
661668
db: Session = murfey_db,
662669
):

src/murfey/util/models.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -147,19 +147,6 @@ class FractionationParameters(BaseModel):
147147
fractionation_file_name: str = "eer_fractionation.txt"
148148

149149

150-
"""
151-
Cryo-CLEM
152-
=========
153-
Models related to the cryo-CLEM workflow.
154-
"""
155-
156-
157-
class TIFFSeriesInfo(BaseModel):
158-
series_name: str
159-
tiff_files: List[Path]
160-
series_metadata: Path
161-
162-
163150
"""
164151
FIB
165152
===

0 commit comments

Comments
 (0)