Skip to content

Instantly share code, notes, and snippets.

@DrSkippy
Last active September 29, 2021 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DrSkippy/0cbe91c73b9259618e79fbce10e3a24f to your computer and use it in GitHub Desktop.
Save DrSkippy/0cbe91c73b9259618e79fbce10e3a24f to your computer and use it in GitHub Desktop.
q1fy22 models
####################################################################
"""
successful sprints Fraction Achievement
0 | 0.00 | 0.90
1 | 0.33 | 0.93
2 | 0.67 | 0.97
3 | 1.00 | 1.00
4 | 1.33 | 1.03
5 | 1.67 | 1.07
6 | 2.00 | 1.10
"""
n_target = 3 # sprints
n_max = 6 # sprints
upside = 1.0 # + 100%
downside = 0.0
# Linear models around target
a, b = 1.0 / n_target, 0.0
c = upside / (n_max - n_target)
d = 1.0 - n_target * c
# print(a,b,c,d)
def f(x):
if x <= n_target:
p = a * x + b
else:
p = c * x + d
return p
fmt = "{:17} | {:8.2f} | {:8.2f}"
print("successful sprints", " Fraction ", " Achievement")
for i in range(0, n_max + 1):
print(fmt.format(i, round(f(i), 2), round(0.9 + 0.1 * f(i), 2)))
####################################################################
"""
ipv6 alpha week Fraction Achievement
0 | 2.00 | 1.10
1 | 1.89 | 1.09
2 | 1.78 | 1.08
3 | 1.67 | 1.07
4 | 1.56 | 1.06
5 | 1.44 | 1.04
6 | 1.33 | 1.03
7 | 1.22 | 1.02
8 | 1.11 | 1.01
9 | 1.00 | 1.00
10 | 0.67 | 0.97
11 | 0.33 | 0.93
12 | 0.00 | 0.90
"""
t_max = 12 # weeks in quarter
t_target = 9 # weeks before end of quarter
upside = 1.0
downside = 0.0
# Linear models around target
a = -upside / t_target
b = 1.0 + upside
c = -1 / (t_max - t_target)
d = 1.0 - t_target * c
# print(a,b,c,d)
def g(x):
if x <= t_target:
p = a * x + b
else:
p = c * x + d
return p
fmt = "{:17} | {:8.2f} | {:8.2f}"
print("ipv6 alpha week", " Fraction ", " Achievement")
for i in range(0, t_max + 1):
print(fmt.format(i, round(g(i), 2), round(0.9 + 0.1 * g(i), 2)))
####################################################################
"""
PRs Contributors Fraction Achievement
0 | 1 | 0.00 | 0.90
2 | 1 | 0.17 | 0.92
4 | 1 | 0.33 | 0.93
6 | 1 | 0.50 | 0.95
8 | 1 | 0.54 | 0.95
10 | 1 | 0.57 | 0.96
12 | 1 | 0.61 | 0.96
14 | 1 | 0.64 | 0.96
16 | 1 | 0.68 | 0.97
18 | 1 | 0.71 | 0.97
20 | 1 | 0.75 | 0.98
0 | 2 | 0.00 | 0.90
2 | 2 | 0.33 | 0.93
4 | 2 | 0.67 | 0.97
6 | 2 | 1.00 | 1.00
8 | 2 | 1.07 | 1.01
10 | 2 | 1.14 | 1.01
12 | 2 | 1.21 | 1.02
14 | 2 | 1.29 | 1.03
16 | 2 | 1.36 | 1.04
18 | 2 | 1.43 | 1.04
20 | 2 | 1.50 | 1.05
0 | 3 | 0.00 | 0.90
2 | 3 | 0.50 | 0.95
4 | 3 | 1.00 | 1.00
6 | 3 | 1.50 | 1.05
8 | 3 | 1.61 | 1.06
10 | 3 | 1.71 | 1.07
12 | 3 | 1.82 | 1.08
14 | 3 | 1.93 | 1.09
16 | 3 | 2.04 | 1.10
18 | 3 | 2.14 | 1.11
20 | 3 | 2.25 | 1.12
"""
n_target = 6 # PRs
n_max = 20 # PRs
c_target = 2 # contributors
c_max = 3 # contributors
upside = 0.5 # + 50% in each dimension
# Linear models around target
a, b = 1.0 / n_target, 0.0
c = upside / (n_max - n_target)
d = 1.0 - n_target * c
# print(a,b,c,d)
ac, bc = 1.0 / c_target, 0.0
cc = upside / (c_max - c_target)
dc = 1.0 - c_target * cc
# print(ac,bc,cc,dc)
def f(x, y):
if x <= n_target:
p = a * x + b
else:
p = c * x + d
if y <= c_target:
pc = ac * y + bc
else:
pc = cc * y + dc
return p * pc
fmt = "{:5} | {:12} | {:8.2f} | {:8.2f}"
print(" PRs ", " Contributors", " Fraction ", " Achievement")
for j in range(1, c_max + 1):
for i in range(0, n_max + 1, 2):
print(fmt.format(i, j, round(f(i, j), 2), round(0.9 + 0.1 * f(i, j), 2)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment