class Observer:
    """Observer class for gathering and recording simulation data."""

    def __init__(self):
        """Initialize an Observer."""
        self.data = []

    def record(self, step, data):
        """
        Record data at a specific time step.

        Args:
            step: Time step identifier
            data: Data to record
        """
        self.data.append({"step": step, "data": data})

    def get_data(self):
        """
        Get all recorded data.

        Returns:
            List of recorded data entries
        """
        return self.data

    def clear(self):
        """Clear all recorded data."""
        self.data = []

    def __repr__(self):
        return f"Observer(records={len(self.data)})"