Ejemplo n.º 1
0
def _ensure_containers_and_wells():
    """ Load all persisted containers in to the labware database
    """

    print("Loading json containers...")
    load_all_containers_from_disk()
    json_containers = list_container_names()
    log.debug("_ensure_containers_and_wells: file load complete")
    print("Json container file load complete, listing database")
    current_containers = database.list_all_containers()
    to_update = set(json_containers) - set(current_containers)
    msg = f"Found {len(to_update)} containers to add. Starting migration..."
    print(msg)
    log.info(msg)
    for container_name in to_update:
        _migrate_container(container_name)
    current_containers = database.list_all_containers()
    missing = set(json_containers) - set(current_containers)
    if missing:
        msg = f"MIGRATION FAILED: MISSING {missing}"
        log.error(msg)
        print(msg)
    else:
        log.info("Database migration complete")
        print("Database migration complete!")
Ejemplo n.º 2
0
def _ensure_trash():
    """ Ensure that the tall and short fixed trash containers are present

    This is a separate step because the robot singleton needs them, so
    they need to be present whenever the singleton is constructed on import.
    The rest of the containers are not necessarily needed, and so are handled
    elsewhere.
    """
    load_all_containers_from_disk()

    to_load = set(['fixed-trash', 'tall-fixed-trash'])
    present = set(database.list_all_containers())
    to_update = to_load - present
    log.info(f"_ensure_trash: loading {to_update}")
    for container_name in to_update:
        _migrate_container(container_name)
Ejemplo n.º 3
0
def list():
    return database.list_all_containers()