From f6b852bc8c1605499b14bb3b8c639f1a20f65e0b Mon Sep 17 00:00:00 2001 From: yxd92326 Date: Fri, 12 Jun 2026 16:46:12 +0100 Subject: [PATCH 1/3] Back-populate bfactor table into processing job --- src/murfey/util/db.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/murfey/util/db.py b/src/murfey/util/db.py index 56b891d78..8c931e481 100644 --- a/src/murfey/util/db.py +++ b/src/murfey/util/db.py @@ -379,6 +379,9 @@ class ProcessingJob(SQLModel, table=True): # type: ignore refine3ds: List["Refine3D"] = Relationship( back_populates="processing_job", sa_relationship_kwargs={"cascade": "delete"} ) + bfactors: List["BFactorParameters"] = Relationship( + back_populates="processing_job", sa_relationship_kwargs={"cascade": "delete"} + ) class PreprocessStash(SQLModel, table=True): # type: ignore From d55ee9435a180614c90471ded5efde6dc24a0c22 Mon Sep 17 00:00:00 2001 From: yxd92326 Date: Fri, 12 Jun 2026 16:47:36 +0100 Subject: [PATCH 2/3] Found another one --- src/murfey/util/db.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/murfey/util/db.py b/src/murfey/util/db.py index 8c931e481..c41a1b283 100644 --- a/src/murfey/util/db.py +++ b/src/murfey/util/db.py @@ -379,7 +379,10 @@ class ProcessingJob(SQLModel, table=True): # type: ignore refine3ds: List["Refine3D"] = Relationship( back_populates="processing_job", sa_relationship_kwargs={"cascade": "delete"} ) - bfactors: List["BFactorParameters"] = Relationship( + bfactor_parameters: List["BFactorParameters"] = Relationship( + back_populates="processing_job", sa_relationship_kwargs={"cascade": "delete"} + ) + bfactors: List["BFactors"] = Relationship( back_populates="processing_job", sa_relationship_kwargs={"cascade": "delete"} ) From 7cbe2b2ae50292fed7c78da963943c308713b836 Mon Sep 17 00:00:00 2001 From: yxd92326 Date: Fri, 12 Jun 2026 16:49:42 +0100 Subject: [PATCH 3/3] And the other way --- src/murfey/util/db.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/murfey/util/db.py b/src/murfey/util/db.py index c41a1b283..86d1d6f2a 100644 --- a/src/murfey/util/db.py +++ b/src/murfey/util/db.py @@ -816,6 +816,9 @@ class BFactorParameters(SQLModel, table=True): # type: ignore class_number: int mask_file: str run: bool = True + processing_job: Optional[ProcessingJob] = Relationship( + back_populates="bfactor_parameters" + ) class BFactors(SQLModel, table=True): # type: ignore @@ -823,6 +826,7 @@ class BFactors(SQLModel, table=True): # type: ignore pj_id: int = Field(primary_key=True, foreign_key="processingjob.processingJobId") number_of_particles: int resolution: float + processing_job: Optional[ProcessingJob] = Relationship(back_populates="bfactors") class MotionCorrection(SQLModel, table=True): # type: ignore