Update card_creation.py
Match AVG, OBP, and SLG formulas to Ratings Guide sheet
This commit is contained in:
parent
0c9b681ed2
commit
dbdd1c7fcb
@ -1676,26 +1676,22 @@ async def main(argv):
|
|||||||
p_ratings['homerun'] + p_ratings['bp_homerun'] / 2 + p_ratings['triple'] +
|
p_ratings['homerun'] + p_ratings['bp_homerun'] / 2 + p_ratings['triple'] +
|
||||||
p_ratings['double_three'] + p_ratings['double_two'] + p_ratings['double_cf'] +
|
p_ratings['double_three'] + p_ratings['double_two'] + p_ratings['double_cf'] +
|
||||||
p_ratings['single_two'] + p_ratings['single_one'] +
|
p_ratings['single_two'] + p_ratings['single_one'] +
|
||||||
p_ratings['single_center'] + p_ratings['bp_single'] / 2 +
|
p_ratings['single_center'] + p_ratings['bp_single']
|
||||||
(p_ratings['xcheck_p'] + p_ratings['xcheck_c'] + p_ratings['xcheck_1b'] +
|
|
||||||
p_ratings['xcheck_2b'] + p_ratings['xcheck_3b'] + p_ratings['xcheck_ss'] +
|
|
||||||
p_ratings['xcheck_lf'] + p_ratings['xcheck_cf'] + p_ratings['xcheck_rf']) * .3
|
|
||||||
)
|
)
|
||||||
|
|
||||||
p_ratings['avg'] = count_hits / 108
|
p_ratings['avg'] = count_hits / 108
|
||||||
p_ratings['obp'] = (
|
p_ratings['obp'] = (
|
||||||
count_hits + p_ratings['hbp'] + p_ratings['walk']
|
count_hits + p_ratings['hbp'] + p_ratings['walk'] +
|
||||||
) / 108
|
|
||||||
p_ratings['slg'] = (
|
|
||||||
(p_ratings['homerun'] * 4) + (p_ratings['triple'] * 3) +
|
|
||||||
((p_ratings['bp_homerun'] + p_ratings['double_three'] + p_ratings['double_two'] +
|
|
||||||
p_ratings['double_cf']) * 2) +
|
|
||||||
p_ratings['single_two'] + p_ratings['single_one'] + p_ratings['single_center'] +
|
|
||||||
p_ratings['bp_single'] / 2 +
|
|
||||||
(p_ratings['xcheck_p'] + p_ratings['xcheck_c'] + p_ratings['xcheck_1b'] +
|
(p_ratings['xcheck_p'] + p_ratings['xcheck_c'] + p_ratings['xcheck_1b'] +
|
||||||
p_ratings['xcheck_2b'] + p_ratings['xcheck_3b'] + p_ratings['xcheck_ss'] +
|
p_ratings['xcheck_2b'] + p_ratings['xcheck_3b'] + p_ratings['xcheck_ss'] +
|
||||||
p_ratings['xcheck_lf'] + p_ratings['xcheck_cf'] + p_ratings['xcheck_rf']) * .3
|
p_ratings['xcheck_lf'] + p_ratings['xcheck_cf'] + p_ratings['xcheck_rf']) * .3
|
||||||
) / 108
|
) / 108
|
||||||
|
p_ratings['slg'] = (
|
||||||
|
((p_ratings['homerun'] + p_ratings['bp_homerun']) * 4) + (p_ratings['triple'] * 3) +
|
||||||
|
((p_ratings['double_three'] + p_ratings['double_two'] + p_ratings['double_cf']) * 2) +
|
||||||
|
p_ratings['single_two'] + p_ratings['single_one'] + p_ratings['single_center'] +
|
||||||
|
p_ratings['bp_single'] / 2
|
||||||
|
) / 108
|
||||||
|
|
||||||
PitcherRatings.insert(p_ratings).on_conflict_replace().execute()
|
PitcherRatings.insert(p_ratings).on_conflict_replace().execute()
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user