Skip to content

AbstractAnnotation

Bases: ABC

Source code in src/library_analyzer/processing/annotations/model/_annotations.py
@dataclass
class AbstractAnnotation(ABC):
    target: str
    authors: list[str]
    reviewers: list[str]
    comment: str
    reviewResult: EnumReviewResult  # noqa: N815

    @staticmethod
    def from_dict(d: dict[str, Any]) -> AbstractAnnotation:
        review_result = EnumReviewResult(d.get("reviewResult", ""))

        return AbstractAnnotation(
            d["target"],
            d["authors"],
            d["reviewers"],
            d.get("comment", ""),
            review_result,
        )

    def to_dict(self) -> dict[str, Any]:
        return asdict(self, dict_factory=EnumReviewResult.to_dict)

authors: list[str] instance-attribute

comment: str instance-attribute

reviewResult: EnumReviewResult instance-attribute

reviewers: list[str] instance-attribute

target: str instance-attribute

__init__(target, authors, reviewers, comment, reviewResult)

from_dict(d) staticmethod

Source code in src/library_analyzer/processing/annotations/model/_annotations.py
@staticmethod
def from_dict(d: dict[str, Any]) -> AbstractAnnotation:
    review_result = EnumReviewResult(d.get("reviewResult", ""))

    return AbstractAnnotation(
        d["target"],
        d["authors"],
        d["reviewers"],
        d.get("comment", ""),
        review_result,
    )

to_dict()

Source code in src/library_analyzer/processing/annotations/model/_annotations.py
def to_dict(self) -> dict[str, Any]:
    return asdict(self, dict_factory=EnumReviewResult.to_dict)