-
Notifications
You must be signed in to change notification settings - Fork 0
/
groups.py
executable file
·29 lines (22 loc) · 920 Bytes
/
groups.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
import os
from directions import Transversal, Longitudinal
import config
class GeometryGroup():
def __init__(self, group_name):
self.group_name = group_name
self.geometries = self.list_geometries()
self.transversal = self.init_transversal()
self.longitudinal = self.init_longitudinal()
def list_geometries(self):
geometries = [g for g in os.listdir("geometries") if g.startswith(self.group_name)]
geometries.sort(reverse=True)
return geometries
def init_transversal(self):
tr_args = config.trace.transversal.values()
return [Transversal(*tr_args, g) for g in self.geometries]
def init_longitudinal(self):
ln_args = config.trace.longitudinal.values()
return [Longitudinal(*ln_args, g) for g in self.geometries]
ideal = GeometryGroup("ideal")
errors = GeometryGroup("errors")
virtual = GeometryGroup("virtual")