-
Notifications
You must be signed in to change notification settings - Fork 5
/
knoedler.py
executable file
·53 lines (46 loc) · 1.29 KB
/
knoedler.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
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python3 -B
import os
import sys
import csv
import bonobo
from cromulent import model, vocab
from cromulent.model import factory
from pipeline.projects.knoedler import KnoedlerFilePipeline, KnoedlerPipeline
from settings import project_data_path, output_file_path, arches_models, DEBUG
### Pipeline
if __name__ == '__main__':
factory.cache_hierarchy()
if DEBUG:
LIMIT = int(os.environ.get('GETTY_PIPELINE_LIMIT', 10))
else:
LIMIT = int(os.environ.get('GETTY_PIPELINE_LIMIT', 10000000))
data = {
'header_file': 'knoedler_0.csv',
'files_pattern': 'knoedler.csv',
}
# factory.production_mode()
vocab.conceptual_only_parts()
vocab.add_linked_art_boundary_check()
vocab.add_attribute_assignment_check()
print_dot = False
if 'dot' in sys.argv[1:]:
print_dot = True
sys.argv[1:] = [a for a in sys.argv[1:] if a != 'dot']
parser = bonobo.get_argument_parser()
with bonobo.parse_args(parser) as options:
try:
data_path = project_data_path('knoedler')
pipeline = KnoedlerFilePipeline( # KnoedlerPipeline
data_path,
data=data,
output_path=output_file_path,
models=arches_models,
limit=LIMIT,
debug=DEBUG
)
if print_dot:
print(pipeline.get_graph()._repr_dot_())
else:
pipeline.run(**options)
except RuntimeError:
raise ValueError()