Skip to content

Commit 3b7ea18

Browse files
author
David Erb
committed
small changes to debug
1 parent a3795a4 commit 3b7ea18

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

src/rockingester_lib/collectors/direct_poll.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,10 @@ async def scrape_plates_directory(
242242

243243
# This plate directory's barcode is not in the database?
244244
if crystal_plate_model is None:
245-
# logger.debug(
246-
# f"[ROCKINGESTER POLL] plate_barcode {plate_barcode} is not in the database"
247-
# )
245+
logger.debug(
246+
f"[ROCKDIR] plate_barcode {plate_barcode} is not in the database"
247+
)
248+
self.__handled_plate_names.append(plate_name)
248249
continue
249250
try:
250251
# Try to get the visit directory from the visit stored in the database's plate record.
@@ -255,17 +256,19 @@ async def scrape_plates_directory(
255256
)
256257
# This is an improperly formatted visit name?
257258
except ValueError:
258-
# logger.debug(
259-
# f"[ROCKINGESTER POLL] plate_barcode {plate_barcode}"
260-
# f" is in the database, but visit {crystal_plate_model.visit} is improperly formed"
261-
# )
259+
logger.debug(
260+
f"[ROCKDIR] plate_barcode {plate_barcode}"
261+
f" is in the database, but visit {crystal_plate_model.visit} is improperly formed"
262+
)
263+
self.__handled_plate_names.append(plate_name)
262264
continue
263265
# This visit is not found on disk?
264266
except VisitNotFound:
265-
# logger.debug(
266-
# f"[ROCKINGESTER POLL] plate_barcode {plate_barcode}"
267-
# f" is in the database, but cannot find visit directory in {self.__visits_directory}"
268-
# )
267+
logger.debug(
268+
f"[ROCKDIR] plate_barcode {plate_barcode}"
269+
f" is in the database, but cannot find visit directory in {self.__visits_directory}"
270+
)
271+
self.__handled_plate_names.append(plate_name)
269272
continue
270273

271274
# Scrape the directory when all image files have arrived.
@@ -300,9 +303,10 @@ async def scrape_plate_directory_if_complete(
300303
# TODO: Have a way to rebuild rockingest after database wipe, but images have already been copied to the visit.
301304
if target.is_dir():
302305
# Presumably this is done, so no error but log it.
303-
# logger.debug(
304-
# f"[ROCKINGESTER POLL] plate_barcode {plate_directory.name} is apparently already copied to {target}"
305-
# )
306+
logger.debug(
307+
f"[ROCKDIR] plate_barcode {plate_directory.name} is apparently already copied to {target}"
308+
)
309+
self.__handled_plate_names.append(plate_directory.stem)
306310
return
307311

308312
# This is the first time we have scraped a directory for this plate record in the database?
@@ -327,6 +331,9 @@ async def scrape_plate_directory_if_complete(
327331
# Don't handle the plate directory until all images have arrived.
328332
# TODO: Put in some kind of failsafe in direct_poll.py to handle case where all the well images never arrive.
329333
if len(subwell_names) < crystal_plate_object.get_well_count():
334+
logger.debug(
335+
f"[PLATEWAIT] found only {len(subwell_names)} out of {crystal_plate_object.get_well_count()} subwell images in {plate_directory}"
336+
)
330337
return
331338

332339
# Sort wells by name so that tests are deterministic.

0 commit comments

Comments
 (0)