-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlight_scenario.py
More file actions
37 lines (25 loc) · 781 Bytes
/
light_scenario.py
File metadata and controls
37 lines (25 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from dataclasses import dataclass
from typing import List, Dict, Hashable
@dataclass(frozen=True, eq=False)
class LightInstance:
"""
A lighter `Instance` with only text fields.
"""
input: str
"""The input"""
references: List[str]
"""References that help us evaluate"""
@dataclass(frozen=True)
class LightScenarioKey:
"""Unique key representing a `LightScenario` instance."""
metadata: Dict[str, Hashable]
def __hash__(self):
return hash(tuple((k, self.metadata[k]) for k in sorted(self.metadata.keys())))
@dataclass(frozen=True, eq=False)
class LightScenario:
"""
A lighter `Scenario`.
"""
light_scenario_key: LightScenarioKey
light_instances: List[LightInstance]
"""Instances of this scenario"""