Skip to content

Instantly share code, notes, and snippets.

@chrisroat
Created April 26, 2021 04:12
Show Gist options
  • Save chrisroat/711008e2a482c73d789e47c93b0cf0d5 to your computer and use it in GitHub Desktop.
Save chrisroat/711008e2a482c73d789e47c93b0cf0d5 to your computer and use it in GitHub Desktop.
# When acquisition is inserted, the number of images is known
# and all metadata can be inserted.
class Acquisition(dj.Computed):
definition = """
acq_name: varchar(32)
"""
class ImageMetadata(dj.Part):
definition = """
-> Acquisition
-> image_index: int
"""
# Image seems like it should each be a Part table, but it is inserted
# independently when data comes available.
class Image(dj.Manual):
definition = """
-> Acquisition.ImageMetadata
"""
class ProcessImage(dj.Computed):
definition = """
-> Image
-> Params # not shown here
"""
# Need to manually spell out the key here, as there is no
# correct upstream table to reference. I'd also like it
# to be deleted whenever any ProcessImage gets removed.
class ProcessingComplete():
definition = """
-> Acquisition
-> Params
"""
def make(...):
if num_metadata == num_processed:
self.insert1()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment