File tree 1 file changed +36
-0
lines changed
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ class Utils :
2
+ def sgToBrix (sg ):
3
+ #TODO
4
+ pass
5
+
6
+ def brixToSg (brix ):
7
+ sg = (brix / (258.6 - ((brix / 258.2 ) * 227.1 ))) + 1
8
+ return sg
9
+
10
+ def abvCalc (startBrix = None ,endBrix = None ,startSG = None ,endSG = None ):
11
+ #TODO
12
+ pass
13
+
14
+ def dilution (startConcentration = None , startVolume = None , endConcentration = None , endVolume = None ):
15
+ # Check if we have the proper variables to solve for
16
+ varCount = 0
17
+ if startConcentration : varCount += 1
18
+ if endConcentration : varCount += 1
19
+ if startVolume : varCount += 1
20
+ if endVolume : varCount += 1
21
+ if varCount != 3 :
22
+ #TODO Raise Exception
23
+ print ("Wrong var count" )
24
+ return None
25
+ if not startConcentration :
26
+ startConcentration = (endConcentration * endVolume ) / startVolume
27
+ return startConcentration
28
+ if not endConcentration :
29
+ endConcentration = (startConcentration * startVolume ) / endVolume
30
+ return endConcentration
31
+ if not startVolume :
32
+ startVolume = (endConcentration * endVolume ) / startConcentration
33
+ return startVolume
34
+ if not endVolume :
35
+ endVolume = (startConcentration * startVolume ) / endConcentration
36
+ return endVolume
You can’t perform that action at this time.
0 commit comments