Source code for aoptk.relationships.relationship

from dataclasses import dataclass
from aoptk.chemical import Chemical
from aoptk.effect import Effect
from aoptk.relationship_type import RelationshipType


@dataclass
[docs] class Relationship: """Data structure representing relationship between a chemical and an effect."""
[docs] relationship_type: RelationshipType
[docs] chemical: Chemical
[docs] effect: Effect
[docs] context: str
[docs] def __str__(self) -> str: return ( f"relationship_type={self.relationship_type}, " f"chemical={self.chemical.name}, effect={self.effect.name}, " f"context={self.context})" )