MCPcopy Create free account
hub / github.com/PyVRP/PyVRP / make_datum

Method make_datum

pyvrp/Statistics.py:129–139  ·  view source on GitHub ↗
(row)

Source from the content-addressed store, hash-verified

127 field2type = {field.name: field.type for field in fields(_Datum)}
128
129 def make_datum(row) -> _Datum:
130 datum = {}
131
132 for name, value in row.items():
133 if name in field2type:
134 if field2type[name] is bool:
135 datum[name] = bool(int(value))
136 else:
137 datum[name] = field2type[name](value) # type: ignore
138
139 return _Datum(**datum)
140
141 with open(where) as fh:
142 lines = fh.readlines()

Callers

nothing calls this directly

Calls 1

_DatumClass · 0.85

Tested by

no test coverage detected