Skip to content

Commit 2fc4428

Browse files
committed
Fix murfey id counts and autoproc id in test
1 parent e485575 commit 2fc4428

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed

src/murfey/server/feedback.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,9 @@ def _register_incomplete_2d_batch(message: dict, _db, demo: bool = False):
625625
)
626626
_db.add(class2d_params)
627627
_db.commit()
628-
murfey_ids = _murfey_id(message["program_id"], _db, number=50)
628+
murfey_ids = _murfey_id(
629+
message["program_id"], _db, number=default_spa_parameters.nr_classes_2d
630+
)
629631
_murfey_class2ds(
630632
murfey_ids, class2d_message["particles_file"], message["program_id"], _db
631633
)
@@ -749,7 +751,9 @@ def _register_complete_2d_batch(message: dict, _db, demo: bool = False):
749751
_db.add(class2d_params)
750752
_db.commit()
751753
_db.close()
752-
murfey_ids = _murfey_id(_app_id(pj_id, _db), _db, number=50)
754+
murfey_ids = _murfey_id(
755+
_app_id(pj_id, _db), _db, number=default_spa_parameters.nr_classes_2d
756+
)
753757
_murfey_class2ds(
754758
murfey_ids, class2d_message["particles_file"], _app_id(pj_id, _db), _db
755759
)
@@ -798,7 +802,13 @@ def _register_complete_2d_batch(message: dict, _db, demo: bool = False):
798802
else:
799803
class_uuids = {
800804
str(i + 1): m
801-
for i, m in enumerate(_murfey_id(_app_id(pj_id, _db), _db, number=50))
805+
for i, m in enumerate(
806+
_murfey_id(
807+
_app_id(pj_id, _db),
808+
_db,
809+
number=default_spa_parameters.nr_classes_2d,
810+
)
811+
)
802812
}
803813
class2d_grp_uuid = _murfey_id(_app_id(pj_id, _db), _db)[0]
804814
zocalo_message: dict = {
@@ -867,7 +877,13 @@ def _register_complete_2d_batch(message: dict, _db, demo: bool = False):
867877
else:
868878
class_uuids = {
869879
str(i + 1): m
870-
for i, m in enumerate(_murfey_id(_app_id(pj_id, _db), _db, number=50))
880+
for i, m in enumerate(
881+
_murfey_id(
882+
_app_id(pj_id, _db),
883+
_db,
884+
number=default_spa_parameters.nr_classes_2d,
885+
)
886+
)
871887
}
872888
class2d_grp_uuid = _murfey_id(_app_id(pj_id, _db), _db)[0]
873889
zocalo_message = {

src/murfey/workflows/tomo/picking.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,13 @@ def _register_picked_tomogram_use_diameter(message: dict, _db: Session):
140140
particle_diameter = tomo_params.particle_diameter
141141
class_uuids = {
142142
str(i + 1): m
143-
for i, m in enumerate(_murfey_id(_app_id(pj_id, _db), _db, number=50))
143+
for i, m in enumerate(
144+
_murfey_id(
145+
_app_id(pj_id, _db),
146+
_db,
147+
number=default_tomo_parameters.nr_classes_2d,
148+
)
149+
)
144150
}
145151
class2d_grp_uuid = _murfey_id(_app_id(pj_id, _db), _db)[0]
146152
zocalo_message = {

tests/workflows/tomo/test_tomo_picking.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from sqlmodel import Session, select
44

55
from murfey.util.db import (
6+
AutoProcProgram,
67
DataCollection,
78
DataCollectionGroup,
89
ParticleSizes,
@@ -117,6 +118,14 @@ def test_picked_tomogram_run_class2d(
117118
"dc_id": dc_entry.id,
118119
},
119120
)
121+
get_or_create_db_entry(
122+
murfey_db_session,
123+
AutoProcProgram,
124+
lookup_kwargs={
125+
"id": 0,
126+
"pj_id": processing_job_entry.id,
127+
},
128+
)
120129
get_or_create_db_entry(
121130
murfey_db_session,
122131
TomographyProcessingParameters,

0 commit comments

Comments
 (0)