Sam 3a34759094
Some checks failed
Build Simulation and Test / Run All Tests (push) Failing after 8m17s
Add core simulation components and configuration classes
Major rewrite.
2025-11-08 19:17:40 -06:00

20 lines
518 B
Python

"""JSON formatter for output data."""
import json
from typing import Any
from .base_formatter import BaseFormatter
class JSONFormatter(BaseFormatter):
"""Formats data as JSON."""
def __init__(self, indent: int = 2):
self.indent = indent
def format(self, data: Any) -> str:
"""Format data as JSON string."""
return json.dumps(data, indent=self.indent, default=str)
def get_file_extension(self) -> str:
"""Get file extension for JSON format."""
return "json"