Skip to content

trading_agent.doctor.doctor_check

The base class for one doctor check, and the result each check returns.

Typical usage example:

result = check.run() print(result.status, result.message)

CheckStatus

Bases: StrEnum

How a check turned out.

CheckResult dataclass

CheckResult(status, message)

The outcome of one check.

Attributes:

Name Type Description
status CheckStatus

Whether the check passed, passed with a warning, or failed.

message str

A sentence explaining the outcome and, if needed, how to fix it.

DoctorCheck

One thing the doctor checks. Subclasses provide the name and the check.

Attributes:

Name Type Description
name

A short name shown in the doctor's report.

run

run()

Runs the check.

Returns:

Type Description
CheckResult

The outcome.

Raises:

Type Description
NotImplementedError

Always, because subclasses must override this method.

Source code in src/trading_agent/doctor/doctor_check.py
def run(self) -> CheckResult:
    """Runs the check.

    Returns:
        CheckResult: The outcome.

    Raises:
        NotImplementedError: Always, because subclasses must override this method.
    """
    raise NotImplementedError