Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove Hamilton liquid classes #225

Open
rickwierenga opened this issue Aug 22, 2024 · 4 comments
Open

remove Hamilton liquid classes #225

rickwierenga opened this issue Aug 22, 2024 · 4 comments

Comments

@rickwierenga
Copy link
Member

Liquid classes in the Hamiltonian sense are confusing, especially in PLR: https://labautomation.io/t/how-does-pylabrobot-handle-liquid-classes/977

A lot of code in STAR looks like this:

flow_rates = [
      op.flow_rate or (hlc.aspiration_flow_rate if hlc is not None else 100)
        for op, hlc in zip(ops, hamilton_liquid_classes)]

Hamiltonian liquid classes are effectively dicts of parameters.

We should do the following instead:

lh.aspirate(..., **hamilton_liquid_class.generate_kwargs())`
>>> hamilton_liquid_class.generate_kwargs()
{
  "flow_rate": 42,
  "clot_detection_height": 69,
  ...
}

so that we can remove all references to Hamilton liquid classes in STAR/Vantage backends, thus simplifying them a lot. HamiltonLiquidClass can simply be a TypedDict.

(I vaguely recall discussing this before, possibly in a private message, can't find a public issue/forum post now)

@rickwierenga
Copy link
Member Author

one issue with making it a TypedDict is that volume correction becomes slightly more awkward, and the user needs to explicitly say

lh.aspirate(vols=[hlc.correct(original_volume)])

but i think for sensitive liquid handling you'll want to fine-tine the volumes anyway, and this method is a lot more transparent than doing it somewhere deep in STAR where it's hidden

@rickwierenga
Copy link
Member Author

first PR: #248

@BioCam
Copy link
Contributor

BioCam commented Sep 27, 2024

one issue with making it a TypedDict is that volume correction becomes slightly more awkward, and the user needs to explicitly say

lh.aspirate(vols=[hlc.correct(original_volume)])

I agree; this puts enormous technical debt on the end user.

This way every user must constantly think about the actual piston_volume, i.e. the "corrected_volume", one has to move to achieve the target_liquid_volume.

The excellent idea behind standard liquid classes is to not have worry about this.
It makes reading and writing complex protocols much harder.

Ideally we want a system/advanced_liquid_class that is more than a dictionary, i.e. an object that corrects not just for volume but corrects all aspirate/dispense attributes... because why would the same blow_out_volume for 1 ul of 50% glycerol work the same way for 1000 of 50% glycerol.

This current alternative doesn't seem to address this.

@rickwierenga
Copy link
Member Author

but with liquid classes, you would still have to worry about this, because the provided liquid classes aren't good enough.

yes, we don't have an 'advanced liquid class' yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants