Skip to content

Commit e97a982

Browse files
committed
Remove references to the TomographyProcessingParameters table
1 parent 728d0e5 commit e97a982

File tree

6 files changed

+0
-123
lines changed

6 files changed

+0
-123
lines changed

src/murfey/client/multigrid_control.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -411,12 +411,6 @@ def _start_dc(self, json, from_form: bool = False):
411411
source = Path(json["source"])
412412
context = self.analysers[source]._context
413413
if isinstance(context, TomographyContext):
414-
if from_form:
415-
capture_post(
416-
f"{self._environment.url.geturl()}/clients/{self._environment.client_id}/tomography_processing_parameters",
417-
json=json,
418-
)
419-
420414
source = Path(json["source"])
421415
context.register_tomography_data_collections(
422416
file_extension=json["file_extension"],

src/murfey/server/__init__.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,6 @@ def get_job_ids(tilt_series_id: int, appid: int) -> JobIDs:
190190
)
191191

192192

193-
def get_tomo_proc_params(pj_id: int, *args) -> db.TomographyProcessingParameters:
194-
results = murfey_db.exec(
195-
select(db.TomographyProcessingParameters).where(
196-
db.TomographyProcessingParameters.pj_id == pj_id
197-
)
198-
).one()
199-
return results
200-
201-
202193
def get_tomo_preproc_params(dcg_id: int, *args) -> db.TomographyPreprocessingParameters:
203194
results = murfey_db.exec(
204195
select(db.TomographyPreprocessingParameters).where(

src/murfey/server/api/__init__.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
SPARelionParameters,
7171
Tilt,
7272
TiltSeries,
73-
TomographyProcessingParameters,
7473
)
7574
from murfey.util.models import (
7675
BLSampleImageParameters,
@@ -92,7 +91,6 @@
9291
PreprocessingParametersTomo,
9392
ProcessingJobParameters,
9493
ProcessingParametersSPA,
95-
ProcessingParametersTomo,
9694
RegistrationMessage,
9795
RsyncerInfo,
9896
RsyncerSource,
@@ -640,41 +638,6 @@ def register_tomo_preproc_params(
640638
_transport_object.send(_transport_object.feedback_queue, zocalo_message)
641639

642640

643-
@router.post("/sessions/{session_id}/tomography_processing_parameters")
644-
def register_tomo_proc_params(
645-
session_id: MurfeySessionID, proc_params: ProcessingParametersTomo, db=murfey_db
646-
):
647-
log.info(
648-
f"Registering tomography processing parameters {sanitise(proc_params.tag)}, {sanitise(proc_params.tilt_series_tag)}"
649-
)
650-
collected_ids = db.exec(
651-
select(
652-
DataCollectionGroup,
653-
DataCollection,
654-
ProcessingJob,
655-
AutoProcProgram,
656-
)
657-
.where(DataCollectionGroup.session_id == session_id)
658-
.where(DataCollectionGroup.tag == proc_params.tag)
659-
.where(DataCollection.tag == proc_params.tilt_series_tag)
660-
.where(DataCollection.dcg_id == DataCollectionGroup.id)
661-
.where(ProcessingJob.dc_id == DataCollection.id)
662-
.where(AutoProcProgram.pj_id == ProcessingJob.id)
663-
.where(ProcessingJob.recipe == "em-tomo-preprocess")
664-
).one()
665-
if not db.exec(
666-
select(func.count(TomographyProcessingParameters.pj_id)).where(
667-
TomographyProcessingParameters.pj_id == collected_ids[2].id
668-
)
669-
).one():
670-
tomogram_params = TomographyProcessingParameters(
671-
pj_id=collected_ids[2].id, manual_tilt_offset=proc_params.manual_tilt_offset
672-
)
673-
db.add(tomogram_params)
674-
db.commit()
675-
db.close()
676-
677-
678641
class Tag(BaseModel):
679642
tag: str
680643

src/murfey/server/demo_api.py

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
Tilt,
5959
TiltSeries,
6060
TomographyPreprocessingParameters,
61-
TomographyProcessingParameters,
6261
)
6362
from murfey.util.models import (
6463
ClientInfo,
@@ -75,7 +74,6 @@
7574
PreprocessingParametersTomo,
7675
ProcessingJobParameters,
7776
ProcessingParametersSPA,
78-
ProcessingParametersTomo,
7977
RegistrationMessage,
8078
RsyncerInfo,
8179
RsyncerSource,
@@ -513,57 +511,8 @@ def register_tomo_preproc_params(
513511
gain_ref=proc_params.gain_ref,
514512
motion_corr_binning=proc_params.motion_corr_binning,
515513
voltage=proc_params.voltage,
516-
# manual_tilt_offset=proc_params.manual_tilt_offset,
517514
)
518515
db.add(params)
519-
if not db.exec(
520-
select(func.count(TomographyProcessingParameters.pj_id)).where(
521-
TomographyProcessingParameters.pj_id == collected_ids[2].id
522-
)
523-
).one():
524-
tomogram_params = TomographyProcessingParameters(
525-
pj_id=collected_ids[2].id, manual_tilt_offset=proc_params.manual_tilt_offset
526-
)
527-
db.add(tomogram_params)
528-
db.commit()
529-
db.close()
530-
531-
532-
@router.post("/clients/{client_id}/tomography_processing_parameters")
533-
def register_tomo_proc_params(
534-
client_id: int, proc_params: ProcessingParametersTomo, db=murfey_db
535-
):
536-
client = db.exec(
537-
select(ClientEnvironment).where(ClientEnvironment.client_id == client_id)
538-
).one()
539-
session_id = client.session_id
540-
log.info(
541-
f"Registering tomography processing parameters {sanitise(proc_params.tag)}, {sanitise(proc_params.tilt_series_tag)}, {session_id}"
542-
)
543-
collected_ids = db.exec(
544-
select(
545-
DataCollectionGroup,
546-
DataCollection,
547-
ProcessingJob,
548-
AutoProcProgram,
549-
)
550-
.where(DataCollectionGroup.session_id == session_id)
551-
.where(DataCollectionGroup.tag == proc_params.tag)
552-
.where(DataCollection.tag == proc_params.tilt_series_tag)
553-
.where(DataCollection.dcg_id == DataCollectionGroup.id)
554-
.where(ProcessingJob.dc_id == DataCollection.id)
555-
.where(AutoProcProgram.pj_id == ProcessingJob.id)
556-
.where(ProcessingJob.recipe == "em-tomo-preprocess")
557-
).one()
558-
if not db.exec(
559-
select(func.count(TomographyProcessingParameters.pj_id)).where(
560-
TomographyProcessingParameters.pj_id == collected_ids[2].id
561-
)
562-
).one():
563-
tomogram_params = TomographyProcessingParameters(
564-
pj_id=collected_ids[2].id, manual_tilt_offset=proc_params.manual_tilt_offset
565-
)
566-
db.add(tomogram_params)
567516
db.commit()
568517
db.close()
569518

src/murfey/util/db.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -448,12 +448,6 @@ class ProcessingJob(SQLModel, table=True): # type: ignore
448448
spa_feedback_parameters: List["SPAFeedbackParameters"] = Relationship(
449449
back_populates="processing_job", sa_relationship_kwargs={"cascade": "delete"}
450450
)
451-
tomography_processing_parameters: List["TomographyProcessingParameters"] = (
452-
Relationship(
453-
back_populates="processing_job",
454-
sa_relationship_kwargs={"cascade": "delete"},
455-
)
456-
)
457451
ctf_parameters: List["CtfParameters"] = Relationship(
458452
back_populates="processing_job", sa_relationship_kwargs={"cascade": "delete"}
459453
)
@@ -514,14 +508,6 @@ class TomographyPreprocessingParameters(SQLModel, table=True): # type: ignore
514508
)
515509

516510

517-
class TomographyProcessingParameters(SQLModel, table=True): # type: ignore
518-
pj_id: int = Field(primary_key=True, foreign_key="processingjob.id")
519-
manual_tilt_offset: int
520-
processing_job: Optional[ProcessingJob] = Relationship(
521-
back_populates="tomography_processing_parameters"
522-
)
523-
524-
525511
class AutoProcProgram(SQLModel, table=True): # type: ignore
526512
id: int = Field(primary_key=True, unique=True)
527513
pj_id: int = Field(foreign_key="processingjob.id")

src/murfey/util/models.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,3 @@ class Base(BaseModel):
372372
gain_ref: Optional[str]
373373
manual_tilt_offset: float
374374
eer_fractionation: int
375-
376-
377-
class ProcessingParametersTomo(BaseModel):
378-
manual_tilt_offset: int
379-
tag: str
380-
tilt_series_tag: str

0 commit comments

Comments
 (0)