Classes#

DirectPoll Collector#

class rockingester_lib.collectors.direct_poll.DirectPoll(specification, predefined_uuid=None)[source]#

Object representing an image collector. The behavior is to start a coro task to waken every few seconds and scan for newly created plate directories. Image files are pushed to xchembku. Plates for the image files are also pushed to xchembku the first time they are wanted.

async activate()[source]#

Activate the object.

Then it starts the coro task to awaken every few seconds to scrape the directories.

Return type:

None

async deactivate()[source]#

Deactivate the object.

Causes the coro task to stop.

This implementation then releases resources relating to the xchembku connection.

Return type:

None

async tick()[source]#

A coro task which does periodic checking for new files in the directories.

Stops when flag has been set by other tasks.

# TODO: Use an event to awaken ticker early to handle stop requests sooner.

Return type:

None

async scrape_plates_directories()[source]#

Scrape all the configured directories looking in each one for new plate directories.

Normally there is only one in the configured list of these places where plates arrive.

Return type:

None

async scrape_plates_directory(plates_directory)[source]#

Scrape a single directory looking for subdirectories which correspond to plates.

Parameters:

plates_directory (Path) –

Return type:

None

async scrape_plate_directory(plate_directory)[source]#

Scrape a single directory looking for images.

Parameters:

plate_directory (Path) –

Return type:

None

async scrape_plate_directory_if_complete(plate_directory, crystal_plate_model, visit_directory)[source]#

Scrape a single directory looking for new files.

Adds discovered files to internal list which gets pushed when it reaches a configurable size.

TODO: Consider some other flow where well images can be copied as they arrive instead of doing them all in a bunch.

Parameters:
  • plate_directory (Path) – disk directory where to look for subwell images

  • crystal_plate_model (CrystalPlateModel) – pre-built crystal plate description

  • visit_directory (Path) – full path to the top of the visit directory

Return type:

None

async ingest_well(plate_directory, subwell_name, crystal_plate_model, crystal_plate_object, target)[source]#

Ingest the well into the database.

Move the well image file to the ingested area.

Parameters:
  • plate_directory (Path) –

  • subwell_name (str) –

  • crystal_plate_model (CrystalPlateModel) –

  • crystal_plate_object (Interface) –

  • target (Path) –

Return type:

CrystalWellModel