Skip to content

Commit 2a902a1

Browse files
committed
Change primary key in tomogram picks
1 parent fad7f2a commit 2a902a1

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/murfey/util/db.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,9 +681,8 @@ class CtfParameters(SQLModel, table=True): # type: ignore
681681

682682

683683
class TomogramPicks(SQLModel, table=True): # type: ignore
684-
id: Optional[int] = Field(default=None, primary_key=True)
684+
tomogram: str = Field(primary_key=True)
685685
pj_id: int = Field(foreign_key="processingjob.id")
686-
tomogram: str
687686
cbox_3d: str
688687
particle_count: int
689688
tomogram_pixel_size: float

src/murfey/workflows/tomo/picking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ def _register_picked_tomogram_use_diameter(message: dict, _db: Session):
6363
)
6464
_db.add(pick_params)
6565
_db.commit()
66-
_db.close()
6766

6867
picking_db_len = _db.exec(
6968
select(func.count(ParticleSizes.id)).where(ParticleSizes.pj_id == pj_id)
@@ -150,6 +149,7 @@ def _register_picked_tomogram_use_diameter(message: dict, _db: Session):
150149
"processing_recipe", zocalo_message, new_connection=True
151150
)
152151
feedback_params.next_job += 2
152+
_db.delete(saved_message)
153153
else:
154154
# If the diameter is known then just send the new message
155155
particle_diameter = tomo_params.particle_diameter

0 commit comments

Comments
 (0)