Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/murfey/server/api/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ async def request_spa_preprocessing(
db.add(feedback_params)
movie = Movie(
murfey_id=murfey_ids[0],
data_collection_id=detached_ids[1],
path=proc_file.path,
image_number=proc_file.image_number,
tag=proc_file.tag,
Expand Down Expand Up @@ -695,6 +696,17 @@ async def request_tomography_preprocessing(
0
].eer_fractionation_file

movie = Movie(
murfey_id=murfey_ids[0],
data_collection_id=dcid,
path=proc_file.path,
image_number=proc_file.image_number,
tag=proc_file.tag,
)
db.add(movie)
db.commit()
db.close()

zocalo_message: dict = {
"recipes": [recipe_name],
"parameters": {
Expand Down
1 change: 1 addition & 0 deletions src/murfey/server/feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,7 @@ def _flush_tomography_preprocessing(message: dict, _db):
p.parent.mkdir(parents=True)
movie = db.Movie(
murfey_id=murfey_ids[0],
data_collection_id=detached_ids[1],
path=f.file_path,
image_number=f.image_number,
tag=f.tag,
Expand Down
5 changes: 5 additions & 0 deletions src/murfey/util/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,9 @@ class DataCollection(SQLModel, table=True): # type: ignore
processing_jobs: List["ProcessingJob"] = Relationship(
back_populates="data_collection", sa_relationship_kwargs={"cascade": "delete"}
)
movies: List["Movie"] = Relationship(
back_populates="data_collection", sa_relationship_kwargs={"cascade": "delete"}
)


class ProcessingJob(SQLModel, table=True): # type: ignore
Expand Down Expand Up @@ -688,12 +691,14 @@ class SearchMap(SQLModel, table=True): # type: ignore

class Movie(SQLModel, table=True): # type: ignore
murfey_id: int = Field(primary_key=True, foreign_key="murfeyledger.id")
data_collection_id: Optional[int] = Field(foreign_key="datacollection.id")
foil_hole_id: int = Field(foreign_key="foilhole.id", nullable=True, default=None)
path: str
image_number: int
tag: str
preprocessed: bool = False
murfey_ledger: Optional[MurfeyLedger] = Relationship(back_populates="movies")
data_collection: Optional["DataCollection"] = Relationship(back_populates="movies")
foil_hole: Optional[FoilHole] = Relationship(back_populates="movies")


Expand Down
Loading