Skip to content

Commit 5ffa5f4

Browse files
rpwallinclaude
andcommitted
fix: portfolio KeyError and deprecated matplotlib style
- Use .get() for total_current_value to prevent KeyError when metrics are incomplete - Replace deprecated "seaborn" style with "default" (removed in matplotlib 3.6+) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1864e0a commit 5ffa5f4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

maverick_mcp/api/routers/portfolio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ def get_my_portfolio(
906906
"positions": positions_list,
907907
"metrics": {
908908
"total_invested": metrics["total_invested"],
909-
"total_current_value": metrics["total_current_value"],
909+
"total_current_value": metrics.get("total_current_value", 0),
910910
"total_unrealized_gain_loss": metrics["total_unrealized_gain_loss"],
911911
"total_return_percent": metrics["total_return_percent"],
912912
"number_of_positions": len(positions_list),

maverick_mcp/backtesting/visualization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def set_chart_style(theme: str = "light") -> None:
1919
Args:
2020
theme (str): Chart theme, either 'light' or 'dark'
2121
"""
22-
plt.style.use("seaborn")
22+
plt.style.use("default")
2323

2424
if theme == "dark":
2525
plt.style.use("dark_background")

0 commit comments

Comments
 (0)