From 66f293cc061d5e97390c64a07e5c9d40df5e8b12 Mon Sep 17 00:00:00 2001 From: Niclas Dobbertin Date: Thu, 21 Sep 2023 08:20:56 +0200 Subject: improvements --- master_thesis/frensch_procedures.py | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'master_thesis/frensch_procedures.py') diff --git a/master_thesis/frensch_procedures.py b/master_thesis/frensch_procedures.py index 38e8cf3..c2ace41 100644 --- a/master_thesis/frensch_procedures.py +++ b/master_thesis/frensch_procedures.py @@ -19,16 +19,33 @@ class WaterSample: def procedure_dict(self): procedures = { - "1": (self.index1, self.index1_str), - "2": (self.index2, self.index2_str), - "3": (self.index3, self.index3_str), - "4": (self.index4, self.index4_str), - "5": (self.index5, self.index5_str), - "6": (self.index6, self.index6_str), - "overall": (self.overall, self.overall_str), + "1": (self.index1(), self.index1_str()), + "2": (self.index2(), self.index2_str()), + "3": (self.index3(), self.index3_str()), + "4": (self.index4(), self.index4_str()), + "5": (self.index5(), self.index5_str()), + "6": (self.index6(), self.index6_str()), + "overall": (self.overall(), self.overall_str()), } + return procedures + def water_sample_dict(self): + sample = { + "1": (self.index1(), self.index1_str()), + "2": (self.index2(), self.index2_str()), + "3": (self.index3(), self.index3_str()), + "4": (self.index4(), self.index4_str()), + "5": (self.index5(), self.index5_str()), + "6": (self.index6(), self.index6_str()), + "overall": (self.overall(), self.overall_str()), + "solid": self.solid, + "algae": self.algae, + "lime": self.lime, + "toxin": self.toxin, + } + return sample + def select_procedures(self): procedures = [ (self.index1, self.index1_str), @@ -112,7 +129,7 @@ def constrained_WaterSample(): resample = False # check for negative results for proc in water_sample.procedure_dict().keys(): - if water_sample.procedure_dict()[proc][0]() < 0: + if water_sample.procedure_dict()[proc][0] < 0: resample = True # check for greater/lesser equality # procedure 5 -- cgit v1.2.3