Skip to content

manage multiple waste outputs according to chemical compatibility - #25

Merged
Poofjunior merged 23 commits into
mainfrom
feat/separate_waste
Nov 17, 2025
Merged

manage multiple waste outputs according to chemical compatibility#25
Poofjunior merged 23 commits into
mainfrom
feat/separate_waste

Conversation

@Poofjunior

@Poofjunior Poofjunior commented Jul 23, 2025

Copy link
Copy Markdown
Collaborator

This PR:

  • makes it possible to have multiple waste vessels, each of which can be marked with what chemicals it can accept.
  • tracks the contents of the reaction vessel during pauses so that it knows where to dump the waste when it resumes.
  • adds more validation checks to ensure a Job can run on a machine that can handle the waste.

Heads-up! The bulk of the changes are in brainwasher.py and job.py. (You can probably ignore the bulk of the *.yaml file changes.

More detailed changes:

  • move starting_solution out of the job history field so we can record the solution of the reaction vessel during a pause.
  • make Vessel, ReactionVessel, and WasteVessel dataclasses. (Also consolidate them)
    • WasteVessels accept a set of all the chemicals you can fill them with.
  • add a get_compatible_waste_vessel_id method
    • by passing in a set of chemicals, this method returns the waste vessel index that can accept that kind of waste. If both are acceptable, it returns the vessel with less waste.
  • drafted tests for the Job pydantic model.

Reviewing

Heads up! If you're curious about liquid-handling functions like prime_reservoir_line, drain_vessel, or run_wash_step, let's do a demo or walk through the code together! The next best thing is to reference this P&ID diagram.

Testing:

  • running jobs works in simulation.
    • pausing jobs correctly populates the reaction vessels current solution
  • running a short job works on the real machine. ("chemicals" are just colored liquids.)

TODO

  • Test all the changes on real hardware using colored dyes.
  • Test that purge can purge to different waste vessels or to the reaction vessel.
  • ensure the waste vessel solutions increase each time we dump to them
  • ensure the reaction vessel solution contents is being tracked correctly
  • reconstitute starting state knowing the contents of all vessels in the event of a power failure or crash. <-- punt this for later after we wrap up chemistry tests. (Kevin and I can always recover the machine from a power failure / crash without additional features. (See: Save/Reconstitute Starting State #24 for requirements.)

@Poofjunior
Poofjunior merged commit 5b7e6a2 into main Nov 17, 2025
@Poofjunior
Poofjunior deleted the feat/separate_waste branch November 17, 2025 22:56
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

Successfully merging this pull request may close these issues.

1 participant