HPInc / HP-Digital-Microfluidics

HP Digital Microfluidics Software Platform and Libraries
MIT License
2 stars 0 forks source link

Make it easier to partially fill wells in the macro language #260

Closed EvanKirshenbaum closed 5 months ago

EvanKirshenbaum commented 5 months ago

Looking at the way OSU is doing macros, it's pretty clear that it's time to expose more of the internal volume control in the macro language.

What they really want to be able to do is to say simply

wC : prepare to dispense(3 drops of reagent "A");

What this should do is to call

   w.required = liq.volume
   w.ensure_content(liq.volume, liq.reagent)

In addition, it would be useful to expose the following attributes on well:

Migrated from internal repository. Originally created by @EvanKirshenbaum on Feb 28, 2023 at 12:33 PM PST. Closed on Feb 28, 2023 at 1:54 PM PST.
EvanKirshenbaum commented 5 months ago

This issue was referenced by the following commit before migration:

EvanKirshenbaum commented 5 months ago

Added

I changed required to requirement because w's required sounded weird.

While doing this, I changed the definition of Well.fill_to from

    @property
    def fill_to(self) -> Volume:
        def default_fill_line() -> Volume:
            if self.required is None:
                return self.capacity
            return min(self.capacity, self.required)
        return self.volume_from_spec(self._fill_to, default_fill_line)

to

    @property
    def fill_to(self) -> Volume:
        def default_fill_line() -> Volume:
            if self.required is None:
                return self.max_fill
            return min(self.max_fill, self.required+self.min_fill)
        return self.volume_from_spec(self._fill_to, default_fill_line)

Two changes:

  1. Use max_fill rather than capacity
  2. Make sure that there will be min_fill left after dispensing when required isn't None.
    Migrated from internal repository. Originally created by @EvanKirshenbaum on Feb 28, 2023 at 1:54 PM PST.