Hey all,
Running a super basic program and not seeing my PLT car populate on the visualizer. I am assigning it as a child resource on the deck:
My lh.summary has it assigned too:
**
**
Though when looking at my visualizer I am not seeing it!
Anything I’m missing?
is the visualizer connected to the correct port?
I see the tip carrier appear which is sketchy
when you start the visualizer it gives you the link. and you can see connected(green)/disconnected(red) in the header of the visualizer
I’m also loading tips
Here’s my full code block:
# %%
import sys
print(sys.executable)
# %%
#imports
import pandas as pd
import PyQt6
import math
import numpy as np
from pylabrobot.liquid_handling import LiquidHandler
from pylabrobot.liquid_handling.backends import LiquidHandlerChatterboxBackend
from pylabrobot.visualizer.visualizer import Visualizer
import pylabrobot.resources.functional as F
from pylabrobot.resources.hamilton import STARLetDeck
# %%
# grab .csv to dataframe
df = pd.read_csv("C:\\pylabrobot_scripts\\test_cherry_pick.csv")
print(df.head())
# get how many unique source plates and destination plates there are
source_plates = df['source_barcode'].unique()
destination_plates = df['destination_barcode'].unique()
all_unique_plates = np.concatenate((source_plates, destination_plates))
#get the total amount of transfers, for a cherrypick this is the amount of tips to allocate
hit_count = len(df.index)
#calc the number of tip racks this will require, a tip rack holds 96 tips
rack_count = math.ceil((hit_count/96))
#calc the number of of tip carriers, you can fit five tip racks on a carrier
tip_carrrier_count = math.ceil((rack_count/5))
# %%
# create the deck to import labware to
lh = LiquidHandler(backend=LiquidHandlerChatterboxBackend(), deck=STARLetDeck())
await lh.setup()
#init the visualizer
vis = Visualizer(resource=lh)
await vis.setup()
#import the labware resources that you are to use
from pylabrobot.resources import (
TIP_CAR_480_A00,
PLT_CAR_L5AC_A00,
Cor_96_wellplate_360ul_Fb,
HTF
)
# %%
# add the tips to the tip carrier
tip_car= TIP_CAR_480_A00(name='tip carrier')
tip_car[0] = tip_rack1 = HTF(name='tips_01', with_tips=False)
tip_car[1] = tip_rack2 = HTF(name='tips_02', with_tips=False)
tip_car[2] = tip_rack3 = HTF(name='tips_03', with_tips=False)
tip_car[3] = tip_rack4 = HTF(name='tips_04', with_tips=False)
tip_car[4] = tip_rack5 = HTF(name='tips_05', with_tips=False)
# add the tip racks to the tip spot generator
tip_racks = [tip_rack1, tip_rack2, tip_rack3,tip_rack4,tip_rack5]
tip_spots = F.get_all_tip_spots(tip_racks)
tip_spots[0]
linear_generator = F.linear_tip_spot_generator(
tip_spots=tip_spots, # the list of tip spots to use
cache_file_path="./linear_cache.json", # load/save tip spot cache for state in between runs
repeat=False, # don't repeat the tip spots if they run out
)
# %%
lh.deck.assign_child_resource(tip_car, rails=10)
# %%
plt_car = PLT_CAR_L5AC_A00(name='plate carrier')
#combine the unique source and dest then add both to the deck
for index, plate_name in enumerate(all_unique_plates):
new_plate = Cor_96_wellplate_360ul_Fb(name= plate_name)
print(new_plate.name)
plt_car[index] = new_plate
print(plt_car[index])
for plate in plt_car.children:
print(plate.name)
# %%
# must go two layers to get the plate name
print(plt_car[0].children[0].name)
# %%
lh.deck.assign_child_resource(plt_car, rails=2)
# %%
tip_rack1.fill()
tip_rack2.fill()
tip_rack3.fill()
tip_rack4.fill()
tip_rack5.fill()
# %%
lh.summary()
# %%
cur_deck_carrier = lh.deck.get_resource("plate carrier")
generic_liquid = [[(None, 500)]]*96
for index,plate in enumerate(cur_deck_carrier.children):
if plate.children:
print(cur_deck_carrier[index].children[0].name)
cur_deck_carrier[index].children[0].set_well_liquids(generic_liquid)
# %%
from pylabrobot.resources import set_tip_tracking, set_volume_tracking
set_tip_tracking(True), set_volume_tracking(True)
# %%
Edit: its green and connected
I removed the pandas and qt since I don’t have those installed, and the visualizer does work:
here’s the code. just removed stuff from your code that doesn’t run locally for me. hopefully it can be a starting point for you
# %%
import sys
print(sys.executable)
# %%
#imports
import math
import numpy as np
from pylabrobot.liquid_handling import LiquidHandler
from pylabrobot.liquid_handling.backends import LiquidHandlerChatterboxBackend
from pylabrobot.visualizer.visualizer import Visualizer
import pylabrobot.resources.functional as F
from pylabrobot.resources.hamilton import STARLetDeck
# %%
# grab .csv to dataframe
# %%
# create the deck to import labware to
lh = LiquidHandler(backend=LiquidHandlerChatterboxBackend(), deck=STARLetDeck())
await lh.setup()
#init the visualizer
vis = Visualizer(resource=lh)
await vis.setup()
#import the labware resources that you are to use
from pylabrobot.resources import (
TIP_CAR_480_A00,
PLT_CAR_L5AC_A00,
Cor_96_wellplate_360ul_Fb,
HTF
)
# %%
# add the tips to the tip carrier
tip_car= TIP_CAR_480_A00(name='tip carrier')
tip_car[0] = tip_rack1 = HTF(name='tips_01', with_tips=False)
tip_car[1] = tip_rack2 = HTF(name='tips_02', with_tips=False)
tip_car[2] = tip_rack3 = HTF(name='tips_03', with_tips=False)
tip_car[3] = tip_rack4 = HTF(name='tips_04', with_tips=False)
tip_car[4] = tip_rack5 = HTF(name='tips_05', with_tips=False)
# add the tip racks to the tip spot generator
tip_racks = [tip_rack1, tip_rack2, tip_rack3,tip_rack4,tip_rack5]
tip_spots = F.get_all_tip_spots(tip_racks)
tip_spots[0]
linear_generator = F.linear_tip_spot_generator(
tip_spots=tip_spots, # the list of tip spots to use
cache_file_path="./linear_cache.json", # load/save tip spot cache for state in between runs
repeat=False, # don't repeat the tip spots if they run out
)
# %%
lh.deck.assign_child_resource(tip_car, rails=10)
# %%
plt_car = PLT_CAR_L5AC_A00(name='plate carrier')
for plate in plt_car.children:
print(plate.name)
# %%
# must go two layers to get the plate name
# print(plt_car[0].children[0].name)
# %%
lh.deck.assign_child_resource(plt_car, rails=2)
# %%
tip_rack1.fill()
tip_rack2.fill()
tip_rack3.fill()
tip_rack4.fill()
tip_rack5.fill()
# %%
lh.summary()
# %%
cur_deck_carrier = lh.deck.get_resource("plate carrier")
generic_liquid = [[(None, 500)]]*96
for index,plate in enumerate(cur_deck_carrier.children):
if plate.children:
print(cur_deck_carrier[index].children[0].name)
cur_deck_carrier[index].children[0].set_well_liquids(generic_liquid)
# %%
from pylabrobot.resources import set_tip_tracking, set_volume_tracking
set_tip_tracking(True), set_volume_tracking(True)
# %%
Word, for sure something on my end, the code you pasted shows the same deck layout as before with only 1 tip carrier. Also moving my tip rack around does not change. I’ll dive into this tomorrow haha
really? that’s weird. could you show the output of the console? are you running the latest version/commit of PLR?
let’s fix the plate carrier issue first, maybe they have the same underlying cause. and I know for sure the plate carrier is working on my machine 
Not seeing the PLT_CAR in the console objects, seeing the tips though
I just pulled the newest repo, no change
I hadn’t restarted my env after pulling. After closing VScode and opening its working lol
1 Like