-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_driving.py
44 lines (37 loc) · 1023 Bytes
/
generate_driving.py
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
38
39
40
41
42
43
44
import pickle
import re
from itertools import chain, zip_longest
from pathlib import Path
from typing import Union
from causalFM.query_helpers import questions, AttrDict, instantiate_questions, store_query_instances
dry_run = False
queries_path = "./queries/driving"
variables = [
AttrDict.make({
"name": "fuel",
"expression": "remaining fuel",
"singular": True,
"alt": []
}),
AttrDict.make({
"name": "driveStyle",
"expression": "driving style",
"singular": True,
"optionalThe": True,
"alt": []
}),
AttrDict.make({
"name": "carType",
"expression": "car type",
"singular": True,
"optionalThe": True,
"alt": []
})
]
def main():
question_instances = instantiate_questions(questions, variables)
if not dry_run:
store_query_instances(queries_path, question_instances)
print("done.")
if __name__ == "__main__":
main()