Set processes, objectives, and roles#

A WaTr unit records what it does (has_process), what it is for (has_treatment_objective), and its place in your system (has_role). The WaTr vocabulary explains the difference.

Find the terms#

Processes and objectives are class hierarchies. Roles are enum values.

from plumb.watr import Process, TreatmentObjective, enums

print(Process.meta.tree(max_depth=1))
print(TreatmentObjective.meta.tree(max_depth=1))
Process
├── Process_BiologicalProcess
├── Process_ChemicalProcess
└── Process_PhysicalProcess
TreatmentObjective
├── TreatmentObjective_BiosolidsDisposal
├── TreatmentObjective_ConstituentRemoval
├── TreatmentObjective_Disinfection
├── TreatmentObjective_EquipmentCleaning
├── TreatmentObjective_ResourceRecovery
├── TreatmentObjective_Stabilization
├── TreatmentObjective_VolumeReduction
└── TreatmentObjective_pHControl

Use the class defaults#

When the class fixes a process or objective, the constructor fills it in. A gravity thickener needs only its role:

from plumb import Model
from plumb.watr import GravityThickener

with Model("urn:example:thickening#") as model:
    thickener = GravityThickener("primary-thickener", has_role=[enums.values.Role_Primary])

list(thickener.has_process), list(thickener.has_treatment_objective), list(thickener.has_role)
([plumb.watr.Process_Settling],
 [plumb.watr.TreatmentObjective_Thickening],
 [<enum Role-Primary>])

A class that fixes no process, such as DewateringUnit, requires has_process.

Add an objective#

A sedimentation tank always settles, but its objective depends on the installation. State it; the process is still filled in:

from plumb.watr import SedimentationTank, TreatmentObjective_Clarification

with model:
    clarifier = SedimentationTank(
        "primary-clarifier",
        has_treatment_objective=[TreatmentObjective_Clarification],
    )

list(clarifier.has_process), list(clarifier.has_treatment_objective)
([plumb.watr.Process_Settling], [plumb.watr.TreatmentObjective_Clarification])

Name a more specific process#

A subclass of the default replaces it:

from plumb.watr import MediaFiltrationUnit, Process_RapidSandFiltration

with model:
    sand_filter = MediaFiltrationUnit(
        "sand-filter", has_process=[Process_RapidSandFiltration]
    )

list(sand_filter.has_process)
[plumb.watr.Process_RapidSandFiltration]

Systems take the same attributes.