Merge pull request 'fix: use archetype role ratings in pitcher card creation (#11)' (#46) from ai/paper-dynasty-card-creation#11 into main

This commit is contained in:
cal 2026-03-23 12:41:20 +00:00
commit f2f70bfce5

View File

@ -179,7 +179,12 @@ class CustomCardCreator:
else: else:
calc = PitcherRatingCalculator(archetype) calc = PitcherRatingCalculator(archetype)
ratings = calc.calculate_ratings(pitchingcard_id=0) # Temp ID ratings = calc.calculate_ratings(pitchingcard_id=0) # Temp ID
card_data = {"ratings": ratings} card_data = {
"ratings": ratings,
"starter_rating": archetype.starter_rating,
"relief_rating": archetype.relief_rating,
"closer_rating": archetype.closer_rating,
}
# Step 4: Review and tweak loop # Step 4: Review and tweak loop
final_data = await self.review_and_tweak( final_data = await self.review_and_tweak(
@ -347,7 +352,7 @@ class CustomCardCreator:
vs_hand = rating["vs_hand"] vs_hand = rating["vs_hand"]
print(f"\nVS {vs_hand}{'HP' if player_type == 'batter' else 'HB'}:") print(f"\nVS {vs_hand}{'HP' if player_type == 'batter' else 'HB'}:")
print( print(
f" AVG: {rating['avg']:.3f} OBP: {rating['obp']:.3f} SLG: {rating['slg']:.3f} OPS: {rating['obp']+rating['slg']:.3f}" f" AVG: {rating['avg']:.3f} OBP: {rating['obp']:.3f} SLG: {rating['slg']:.3f} OPS: {rating['obp'] + rating['slg']:.3f}"
) )
# Show hit distribution # Show hit distribution
@ -364,7 +369,7 @@ class CustomCardCreator:
+ rating["bp_single"] + rating["bp_single"]
) )
print( print(
f" Hits: {total_hits:.1f} (HR: {rating['homerun']:.1f} 3B: {rating['triple']:.1f} 2B: {rating['double_pull']+rating['double_two']+rating['double_three']:.1f} 1B: {total_hits - rating['homerun'] - rating['bp_homerun'] - rating['triple'] - rating['double_pull'] - rating['double_two'] - rating['double_three']:.1f})" f" Hits: {total_hits:.1f} (HR: {rating['homerun']:.1f} 3B: {rating['triple']:.1f} 2B: {rating['double_pull'] + rating['double_two'] + rating['double_three']:.1f} 1B: {total_hits - rating['homerun'] - rating['bp_homerun'] - rating['triple'] - rating['double_pull'] - rating['double_two'] - rating['double_three']:.1f})"
) )
# Show walk/strikeout # Show walk/strikeout
@ -389,7 +394,7 @@ class CustomCardCreator:
) )
) )
print( print(
f" Outs: {outs:.1f} (K: {rating['strikeout']:.1f} LD: {rating['lineout']:.1f} FB: {rating['flyout_a']+rating['flyout_bq']+rating['flyout_lf_b']+rating['flyout_rf_b']:.1f} GB: {rating['groundout_a']+rating['groundout_b']+rating['groundout_c']:.1f})" f" Outs: {outs:.1f} (K: {rating['strikeout']:.1f} LD: {rating['lineout']:.1f} FB: {rating['flyout_a'] + rating['flyout_bq'] + rating['flyout_lf_b'] + rating['flyout_rf_b']:.1f} GB: {rating['groundout_a'] + rating['groundout_b'] + rating['groundout_c']:.1f})"
) )
# Calculate and display total OPS # Calculate and display total OPS
@ -580,9 +585,9 @@ class CustomCardCreator:
"name_first": player_info["name_first"], "name_first": player_info["name_first"],
"name_last": player_info["name_last"], "name_last": player_info["name_last"],
"hand": player_info["hand"], "hand": player_info["hand"],
"starter_rating": 5, # TODO: Get from archetype "starter_rating": card_data["starter_rating"],
"relief_rating": 5, # TODO: Get from archetype "relief_rating": card_data["relief_rating"],
"closer_rating": None, # TODO: Get from archetype "closer_rating": card_data["closer_rating"],
} }
] ]
} }