fix(utils): correct bbox_inches default from invalid string to None
This commit is contained in:
@@ -20,7 +20,7 @@ def save_chart(
|
|||||||
filename: str,
|
filename: str,
|
||||||
output_dir: str = "output/charts",
|
output_dir: str = "output/charts",
|
||||||
dpi: int = EXPORT_DPI,
|
dpi: int = EXPORT_DPI,
|
||||||
bbox_inches: str = "default",
|
bbox_inches: Optional[str] = None,
|
||||||
) -> str:
|
) -> str:
|
||||||
"""Save a matplotlib figure as high-resolution PNG.
|
"""Save a matplotlib figure as high-resolution PNG.
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ def save_chart(
|
|||||||
filename: Output filename (e.g., '01_shiller_cape.png')
|
filename: Output filename (e.g., '01_shiller_cape.png')
|
||||||
output_dir: Base output directory
|
output_dir: Base output directory
|
||||||
dpi: Resolution (default 300)
|
dpi: Resolution (default 300)
|
||||||
bbox_inches: Bbox mode for tight layout
|
bbox_inches: Bbox mode for tight layout (default None, matplotlib auto)
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Full path to saved file
|
Full path to saved file
|
||||||
@@ -74,7 +74,6 @@ def list_output_charts(output_dir: str = "output/charts") -> list[str]:
|
|||||||
|
|
||||||
def get_chart_metadata(filepath: str) -> dict:
|
def get_chart_metadata(filepath: str) -> dict:
|
||||||
"""Get basic metadata about a saved chart file."""
|
"""Get basic metadata about a saved chart file."""
|
||||||
from PIL import Image # Try PIL first, fallback below
|
|
||||||
|
|
||||||
p = Path(filepath)
|
p = Path(filepath)
|
||||||
if not p.exists():
|
if not p.exists():
|
||||||
|
|||||||
Reference in New Issue
Block a user