Code cleanup
This commit is contained in:
parent
406e066cdb
commit
a48c16b96d
@ -124,7 +124,7 @@ async def main(args):
|
||||
player_description = f'{season}'
|
||||
|
||||
start_time = datetime.datetime.now()
|
||||
release_directory = f'{datetime.datetime.now().year}-{datetime.datetime.now().month}-{datetime.datetime.now().day}'
|
||||
release_directory = f'{start_time.year}-{start_time.month}-{start_time.day}'
|
||||
input_path = f'data-input/{cardset["name"]} Cardset/'
|
||||
|
||||
print('Reading batting stats...')
|
||||
@ -276,7 +276,7 @@ async def main(args):
|
||||
)) / 3
|
||||
|
||||
position_payload.append({
|
||||
"player_id": int(player_data.at[df_data["key_bbref"], 'player_id']),
|
||||
"player_id": int(df_data['player_id']),
|
||||
"position": pos_data[1].upper(),
|
||||
"innings": float(pos_data[0].at[df_data["key_bbref"], 'Inn_def']),
|
||||
"range": cde.get_if_range(
|
||||
@ -305,7 +305,7 @@ async def main(args):
|
||||
int(pos_data[0].at[df_data["key_bbref"], 'bis_runs_total'])
|
||||
)) / 3
|
||||
of_payloads.append({
|
||||
"player_id": int(player_data.at[df_data["key_bbref"], 'player_id']),
|
||||
"player_id": int(df_data['player_id']),
|
||||
"position": pos_data[1].upper(),
|
||||
"innings": float(pos_data[0].at[df_data["key_bbref"], 'Inn_def']),
|
||||
"range": cde.get_of_range(
|
||||
@ -341,7 +341,7 @@ async def main(args):
|
||||
)
|
||||
no_data = False
|
||||
position_payload.append({
|
||||
"player_id": int(player_data.at[df_data["key_bbref"], 'player_id']),
|
||||
"player_id": int(df_data['player_id']),
|
||||
"position": 'C',
|
||||
"innings": float(df_c.at[df_data["key_bbref"], 'Inn_def']),
|
||||
"range": cde.range_catcher(
|
||||
@ -369,7 +369,7 @@ async def main(args):
|
||||
|
||||
if no_data:
|
||||
position_payload.append({
|
||||
"player_id": int(player_data.at[df_data["key_bbref"], 'player_id']),
|
||||
"player_id": int(df_data['player_id']),
|
||||
"position": 'DH',
|
||||
"innings": df_data['PA_vL'] + df_data['PA_vR']
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user