HPInc / HP-Digital-Microfluidics

HP Digital Microfluidics Software Platform and Libraries
MIT License
3 stars 1 forks source link

How to run the opendrop board #185

Open EvanKirshenbaum opened 8 months ago

EvanKirshenbaum commented 8 months ago

I'm running the opendrop board like so:

python tools/opendrop.py dispense -w=3

and it throws the following error:

python tools/opendrop.py dispense -w=3
   INFO|monitor|Setting tick to 100.0 ms
Drop at Pad(14,6): None
   INFO|engine|Clock Thread exited
Exception in thread Clock Thread:
Traceback (most recent call last):
  File "C:\Users\huberma\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner
    self.run()
  File "C:\microfluidics\thylacine\mpam\src\mpam\engine.py", line 585, in run
    new_queue = self._process_queue(queue, tag = "post-tick")
  File "C:\microfluidics\thylacine\mpam\src\mpam\engine.py", line 514, in _process_queue
    new_delay: Optional[Ticks] = fn()
  File "C:\microfluidics\thylacine\mpam\src\mpam\drop.py", line 971, in <lambda>
    board.after_tick(lambda: future.post(pad.checked_drop))
  File "C:\microfluidics\thylacine\mpam\src\mpam\device.py", line 459, in checked_drop
    raise TypeError(f"{self} has no drop")
TypeError: Pad(14,6) has no drop

Am I doing something wrong? The drop does show up on the board:

image

Migrated from internal repository. Originally created by Mark Huber on Jul 05, 2022 at 11:47 AM PDT.
EvanKirshenbaum commented 8 months ago

I'm not sure what's going on there, but as I said earlier, the opendrop exerciser is deprecated, so I'd rather not spend too much time on it. If you run interactive opendrop, you should be able to say

w = well #3 
w's volume = 20 drops
w : dispense drop

which seems to work for me.

Migrated from internal repository. Originally created by @EvanKirshenbaum on Jul 05, 2022 at 2:50 PM PDT.
EvanKirshenbaum commented 8 months ago

when I run python tools/interactive.py opendrop I get this error:

ModuleNotFoundError: No module named 'pyglider'

Looking at the homepage for pyglider it recommends installing it using conda. Installing it with pip throws other errors. Just wondering, do you run python anaconda on your system or did you install it with pip ?

Migrated from internal repository. Originally created by Mark Huber on Jul 05, 2022 at 4:29 PM PDT.
EvanKirshenbaum commented 8 months ago

nvm, had to update some C++ tools for windows and then it worked

Migrated from internal repository. Originally created by Mark Huber on Jul 05, 2022 at 4:51 PM PDT.
EvanKirshenbaum commented 8 months ago

getting a different error now though:

AttributeError: module 'pyglider' has no attribute 'Electrode'

Is it a specific version of pyglider that is used here?

Migrated from internal repository. Originally created by Mark Huber on Jul 05, 2022 at 4:53 PM PDT.
EvanKirshenbaum commented 8 months ago

You may have messed things up by trying to install pyglider with pip. It's a local thing that should be there already. Look for pyglider.pyi in, I believe, src. (I'm away from my computer at the moment.)

Migrated from internal repository. Originally created by @EvanKirshenbaum on Jul 05, 2022 at 5:02 PM PDT.
EvanKirshenbaum commented 8 months ago

i uninstalled the package with pip. I have the path to pyglider.pyi as an environment variable. Is there something else I have to set so the file can be found?

Migrated from internal repository. Originally created by Mark Huber on Jul 05, 2022 at 5:54 PM PDT.
EvanKirshenbaum commented 8 months ago

Rares tried on his machine and got the same error. Could you verify that it works on your machine?

Migrated from internal repository. Originally created by Mark Huber on Jul 06, 2022 at 1:47 PM PDT.
EvanKirshenbaum commented 8 months ago

It definitely works on mine, at least using the master branch. It's possible (although I wouldn't have thought it to be the case) that it only works because I have the C++ DLL that implements the interface on the PYTHONPATH

But in any case, pyglider isn't need for opendrop; it's needed for bilby, so the easiest solution should be to clone interactive and remove the import of bilby and the reference to bilby.PlatformTask.

If that works, open up an issue to make sure that these scripts work in the absence of platform-specific DLLs. If it doesn't, we may need to share a screen to see if we can figure out what's going on.

Migrated from internal repository. Originally created by @EvanKirshenbaum on Jul 06, 2022 at 2:49 PM PDT.
EvanKirshenbaum commented 8 months ago

https://github.azc.ext.hp.com/evan-kirshenbaum/thylacine/issues/188

Migrated from internal repository. Originally created by Mark Huber on Jul 12, 2022 at 10:37 AM PDT.
EvanKirshenbaum commented 8 months ago

I run the program like so: python tools/interactive.py opendrop

when I do w : dispense drop I get only 6 drops in the well.

image

The terminal says this:

python tools/interactive.py opendrop
   INFO|monitor|Setting tick to 100.0 ms
Interactive cmd: w = well #3
  Interactive cmd val (WELL): Well[3]
Interactive cmd: w's volume = 20 drops
Asserted Well[3] contains 40 μl of unknown. Capacity only 12.0 μl
  Interactive cmd val (VOLUME): 40.0 μl

Does that mean every well can only hold 12.0 μl and each drop has a volume of 2.0 μl?

Migrated from internal repository. Originally created by Mark Huber on Jul 12, 2022 at 10:47 AM PDT.
EvanKirshenbaum commented 8 months ago

The terminal says this:

python tools/interactive.py opendrop
   INFO|monitor|Setting tick to 100.0 ms
Interactive cmd: w = well #3
  Interactive cmd val (WELL): Well[3]
Interactive cmd: w's volume = 20 drops
Asserted Well[3] contains 40 μl of unknown. Capacity only 12.0 μl
  Interactive cmd val (VOLUME): 40.0 μl

Does that mean every well can only hold 12.0 μl and each drop has a volume of 2.0 μl?

Yup. From devices.opentrons.Board._well():

        return Well(number=num,
                    board=self,
                    group=transition,
                    exit_dir=exit_dir,
                    exit_pad=exit_pad,
                    gate=gate,
                    shared_pads = shared,
                    capacity=12*uL,
                    dispensed_volume=2*uL,
                    shape=shape
                    )

Big drops, small wells. It really is a toy. Specifications taken from http://www.gaudi.ch/OpenDrop/?p=548:

Droplet volume: 2 ul
Reservoir volume: 12ul
Migrated from internal repository. Originally created by @EvanKirshenbaum on Jul 12, 2022 at 2:23 PM PDT.
EvanKirshenbaum commented 8 months ago

When I run the last command, w : dispense drop, I get the following error:

python tools/interactive.py opendrop
Interactive cmd: w = well #3
  Interactive cmd val (WELL): Well[3]
   INFO|monitor|Setting tick to 100.0 ms
Interactive cmd: w's volume = 20 drops
Asserted Well[3] contains 40 μl of unknown. Capacity only 12.0 μl
  Interactive cmd val (VOLUME): 40.0 μl
Interactive cmd: w : dispense drop
Drop at Pad(14,6): None
   INFO|engine|Clock Thread exited
Exception in thread Clock Thread:
Traceback (most recent call last):
  File "C:\Users\huberma\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner
    self.run()
  File "C:\microfluidics\thylacine\mpam\src\mpam\engine.py", line 585, in run
    new_queue = self._process_queue(queue, tag = "post-tick")
  File "C:\microfluidics\thylacine\mpam\src\mpam\engine.py", line 514, in _process_queue
    new_delay: Optional[Ticks] = fn()
  File "C:\microfluidics\thylacine\mpam\src\mpam\drop.py", line 971, in <lambda>
    board.after_tick(lambda: future.post(pad.checked_drop))
  File "C:\microfluidics\thylacine\mpam\src\mpam\device.py", line 459, in checked_drop
    raise TypeError(f"{self} has no drop")
TypeError: Pad(14,6) has no drop

image

Pad 14,6 seems to be the top gate and since it's complaining, I'm wondering if something is wrong with the orientation. I can't use the terminal from the matplot lib version, I was wondering if you could try on your machine and see if it's just my machine and I messed up the code?

Migrated from internal repository. Originally created by Mark Huber on Jul 12, 2022 at 4:05 PM PDT.
EvanKirshenbaum commented 8 months ago

No, this isn't a display problem. It looks as though somethings wrong with the dispense sequence for Opendrop. It's not obvious what, but I'll do a deeper dive, probably tomorrow morning.

Migrated from internal repository. Originally created by @EvanKirshenbaum on Jul 12, 2022 at 5:09 PM PDT.
EvanKirshenbaum commented 8 months ago

Okay. This should now be fixed (#189). Sorry about that.

Migrated from internal repository. Originally created by @EvanKirshenbaum on Jul 13, 2022 at 11:01 AM PDT.
EvanKirshenbaum commented 8 months ago

thanks

Migrated from internal repository. Originally created by Mark Huber on Jul 13, 2022 at 11:11 AM PDT.