Standardize formatting with black and apply ruff auto-fixes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
47 lines
1.6 KiB
Python
47 lines
1.6 KiB
Python
import asyncio
|
|
import datetime
|
|
import sys
|
|
|
|
from db_calls import db_post
|
|
|
|
|
|
async def main(args):
|
|
start_time = datetime.datetime.now()
|
|
print("Running basic batting...")
|
|
b_basic = await db_post("battingcardratings/calculate/basic")
|
|
if b_basic is not None:
|
|
p_run_time = datetime.datetime.now() - start_time
|
|
print(f"Finished basic batting in {round(p_run_time.total_seconds())} seconds")
|
|
|
|
start_time1 = datetime.datetime.now()
|
|
print("Running full batting...")
|
|
b_full = await db_post("battingcardratings/calculate/scouting")
|
|
if b_full is not None:
|
|
p_run_time = datetime.datetime.now() - start_time1
|
|
print(
|
|
f"Finished complete batting in {round(p_run_time.total_seconds())} seconds"
|
|
)
|
|
|
|
start_time2 = datetime.datetime.now()
|
|
print("Running basic pitching...")
|
|
p_basic = await db_post("pitchingcardratings/calculate/basic")
|
|
if p_basic is not None:
|
|
p_run_time = datetime.datetime.now() - start_time2
|
|
print(f"Finished basic pitching in {round(p_run_time.total_seconds())} seconds")
|
|
|
|
start_time3 = datetime.datetime.now()
|
|
print("Running full batting...")
|
|
p_full = await db_post("pitchingcardratings/calculate/scouting")
|
|
if p_full is not None:
|
|
p_run_time = datetime.datetime.now() - start_time3
|
|
print(
|
|
f"Finished complete pitching in {round(p_run_time.total_seconds())} seconds"
|
|
)
|
|
|
|
full_run_time = datetime.datetime.now() - start_time
|
|
print(f"Full run took {round(full_run_time.total_seconds())} seconds")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main(sys.argv[1:]))
|