-
Notifications
You must be signed in to change notification settings - Fork 0
/
garlic.py
92 lines (73 loc) · 2.27 KB
/
garlic.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
"""
http://teltanefarm.com/garlic.html
75' softneck
25' hardneck
Softneck - 10-16 cloves per bulb
8-10 bulbs per pound
Porcelain (hardneck) - 4-6 cloves per bulb
6-8 bulbs per pound
Racambole / Purple Stripe - 6-9 cloves per bulb
8-10 bulbs per pound
Softneck
========
75' x 3 rows x 2/ft spacing = 450 bulbs
450 / average(10, 16) / average(8, 10)
Inchelium
"""
from __future__ import division
SOFTNECK = {
'clovesPerBulb': (10, 16),
'bulbsPerPound': (8, 10),
'rows': 3,
'perFoot': 2,
}
PORCELAIN = {
'clovesPerBulb': (4, 6),
'bulbsPerPound': (6, 8),
'rows': 3,
'perFoot': 2,
}
PURPLE_STRIPED = RACAMBOLE = {
'clovesPerBulb': (6, 9),
'bulbsPerPound': (8, 10),
'rows': 3,
'perFoot': 2,
}
GARLIC_DATA = {
'Inchelium': SOFTNECK,
'Rosewood': PORCELAIN,
'Siberian Red': PURPLE_STRIPED,
'Musik': PORCELAIN,
}
PLANTING_DATA = {
'Inchelium': 70,
'Rosewood': 10,
'Siberian Red': 10,
'Musik': 10,
}
def seedPoundsPerFoot((minClovesPerBulb, maxClovesPerBulb),
(minBulbsPerPound, maxBulbsPerPound),
rows, perFoot):
neededCloves = rows * perFoot
minNeeded = neededCloves / maxClovesPerBulb / maxBulbsPerPound
maxNeeded = neededCloves / minClovesPerBulb / minBulbsPerPound
return minNeeded, maxNeeded
def yieldPoundsPerFoot((minBulbsPerPound, maxBulbsPerPound),
rows, perFoot):
seededCloves = rows * perFoot
minYield = seededCloves / maxBulbsPerPound
maxYield = seededCloves / minBulbsPerPound
return minYield, maxYield
for variety, feet in PLANTING_DATA.iteritems():
data = GARLIC_DATA[variety]
minNeeded, maxNeeded = seedPoundsPerFoot(
data['clovesPerBulb'], data['bulbsPerPound'],
data['rows'], data['perFoot'])
print '%(variety)s min %(min)0.2f max %(max)0.2f' % {
'variety': variety, 'min': minNeeded * feet, 'max': maxNeeded * feet}
print ' ' * 10, 'halfway %0.2f' % ((minNeeded + maxNeeded) / 2 * feet,)
minYield, maxYield = yieldPoundsPerFoot(
data['bulbsPerPound'],
data['rows'], data['perFoot'])
print ' ' * 10, 'yield min %0.2f max %0.2f' % (
minYield * feet, maxYield * feet)