Source code for archiver_test.details

from __future__ import annotations

from enum import Enum


[docs] class Detail(str, Enum): """Enum of detail types present in the archiver per PV"""
[docs] DBRType = "DBR Type"
[docs] PVAccess = "PVAccess?"
[docs] Method = "Sampling Method"
[docs] Period = "Sampling Period"
[docs] Capacity = "Buffer Capacity"
[docs] EventRate = "Est. Event Rate"
[docs] EventsLost = "Total Events Lost"
[docs] TotalEvents = "Total Events"
# Allows sorting
[docs] def __lt__(self, other: str) -> bool: """Compares two Detail enums by < so sorting works.""" if self == other: return False # the following works because the order of elements in the definition # is preserved for elem in Detail: if self == elem: return True elif other == elem: return False msg = "Bug: we should never arrive here" raise RuntimeError(msg) # I just like being pedantic