diff --git a/src/ga4gh/va_spec/base/core.py b/src/ga4gh/va_spec/base/core.py index f60ae09..15afbcf 100644 --- a/src/ga4gh/va_spec/base/core.py +++ b/src/ga4gh/va_spec/base/core.py @@ -5,7 +5,7 @@ from abc import ABC from datetime import date from enum import Enum -from typing import Annotated, Any, Literal, TypeVar +from typing import Annotated, Any, Literal from ga4gh.cat_vrs.models import CategoricalVariant from ga4gh.core.models import Entity, MappableConcept, iriReference @@ -409,6 +409,7 @@ class DataSet(Entity): description="A specific license that dictates legal permissions for how a data set can be used (by whom, where, for what purposes, with what additional requirements, etc.)", ) + class EvidenceLine(InformationEntity): """An independent, evidence-based argument that may support or refute the validity of a specific Proposition. The strength and direction of this argument is based on @@ -426,9 +427,7 @@ class EvidenceLine(InformationEntity): None, description="The possible fact against which evidence items contained in an Evidence Line were collectively evaluated, in determining the overall strength and direction of support they provide. For example, in an ACMG Guideline-based assessment of variant pathogenicity, the support provided by distinct lines of evidence are assessed against a target proposition that the variant is pathogenic for a specific disease.", ) - hasEvidenceItems: ( - list[Statement | EvidenceLine | iriReference] | None - ) = Field( + hasEvidenceItems: list[Statement | EvidenceLine | iriReference] | None = Field( None, description="An individual piece of information that was evaluated as evidence in building the argument represented by an Evidence Line.", ) @@ -449,9 +448,10 @@ class EvidenceLine(InformationEntity): description="A term summarizing the overall outcome of the evidence assessment represented by the Evidence Line, in terms of the direction and strength of support it provides for or against the target Proposition.", ) - @field_serializer("hasEvidenceItems") - def serialize_value(self, value: list[Statement | EvidenceLine | iriReference] | None) -> dict | str: + def serialize_value( + self, value: list[Statement | EvidenceLine | iriReference] | None + ) -> dict | str: """Create custom serializer for ``hasEvidenceItems`` This is to resolve Pydantic serialization warnings @@ -467,6 +467,7 @@ def serialize_value(self, value: list[Statement | EvidenceLine | iriReference] | return value + class Statement(InformationEntity): """A claim of purported truth as made by a particular agent, on a particular occasion. Statements may be used to put forth a possible fact (i.e. a 'Proposition')