Source code for nrel.hive.reporting.handler.handler

from __future__ import annotations

from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, List

if TYPE_CHECKING:
    from nrel.hive.reporting.reporter import Report
    from nrel.hive.runner.runner_payload import RunnerPayload


[docs]class Handler(ABC): """ A reporting.Handler handles simulation reports in varying ways. """
[docs] @abstractmethod def handle(self, reports: List[Report], runner_payload: RunnerPayload): """ called at each log step. :param reports: :param runner_payload: :return: """
[docs] @abstractmethod def close(self, runner_payload: RunnerPayload): """ wrap up anything here. called at the end of the simulation :return: """