
from openmdao.recorders.case_recorder import CaseRecorder

class {class_name}(CaseRecorder):
    """
    Describe recorder here...
    """

    def __init__(self, filepath, record_viewer_data=True):
        """
        Initialize the {class_name}.

        Parameters
        ----------
        filepath : str
            Path to the recorder file.
        record_viewer_data : bool, optional
            If True, record data needed for visualization.
        """
        super().__init__(record_viewer_data)

        # initialize attributes here...

    def startup(self, recording_requester):
        """
        Prepare for a new run.

        Parameters
        ----------
        recording_requester : object
            Object to which this recorder is attached.
        """
        super().startup(recording_requester)

        # put any necessary startup code here...

    def record_iteration_driver(self, driver, data, metadata):
        """
        Record data and metadata from a Driver.

        Parameters
        ----------
        driver : object
            Driver in need of recording.
        data : dict
            Dictionary containing desvars, objectives, constraints, responses, and System vars.
        metadata : dict
            Dictionary containing execution metadata.
        """
        pass

        # record a driver case

    def record_iteration_problem(self, problem, data, metadata):
        """
        Record data and metadata from a Problem.

        Parameters
        ----------
        problem : object
            Problem in need of recording.
        data : dict
            Dictionary containing desvars, objectives, and constraints.
        metadata : dict
            Dictionary containing execution metadata.
        """
        pass

        # record a Problem case

    def record_iteration_system(self, system, data, metadata):
        """
        Record data and metadata from a System.

        Parameters
        ----------
        system : System
            System in need of recording.
        data : dict
            Dictionary containing inputs, outputs, and residuals.
        metadata : dict
            Dictionary containing execution metadata.
        """
        pass

        # record a System case

    def record_iteration_solver(self, solver, data, metadata):
        """
        Record data and metadata from a Solver.

        Parameters
        ----------
        solver : Solver
            Solver in need of recording.
        data : dict
            Dictionary containing outputs, residuals, and errors.
        metadata : dict
            Dictionary containing execution metadata.
        """
        pass

        # record a solver case

    def record_viewer_data(self, model_viewer_data, key='Driver'):
        """
        Record model viewer data.

        Parameters
        ----------
        model_viewer_data : dict
            Data required to visualize the model.
        key : str, optional
            The unique ID to use for this data in the table.
        """
        pass

        # record data needed for, e.g., the N2 viewer

    def record_metadata_system(self, system):
        """
        Record system metadata.

        Parameters
        ----------
        system : System
            The System that would like to record its metadata.
        """
        pass

        # record metadata from a System

    def record_metadata_solver(self, solver):
        """
        Record solver metadata.

        Parameters
        ----------
        solver : Solver
            The Solver that would like to record its metadata.
        """
        pass

        # record metadata from a solver.

    def record_derivatives_driver(self, driver, data, metadata):
        """
        Record derivatives data from a Driver.

        Parameters
        ----------
        driver : object
            Driver in need of recording.
        data : dict
            Dictionary containing derivatives keyed by 'of,wrt' to be recorded.
        metadata : dict
            Dictionary containing execution metadata.
        """
        pass

        # record derivatives from driver

    def shutdown(self):
        """
        Shut down the recorder.
        """
        pass

        # free any necessary resources here...
