ErrorCollector standarisiert. Warnings werden von getpositions zur routing zu draw durchgereicht.
This commit is contained in:
+10
-4
@@ -160,9 +160,13 @@ def prepare_data(rawdata:dict):
|
||||
errors_sensors = rawdata["not_found"]["missing_sensors"]
|
||||
if "missing_attributes" in rawdata["not_found"]:
|
||||
errors_attributes = rawdata["not_found"]["missing_attributes"]
|
||||
|
||||
|
||||
return (dracks, dsensors, dsubdists, mapping, dtunnels, dtunlength, errors_dists, errors_sensors, errors_attributes)
|
||||
|
||||
# Warnungen aus getpositions übernehmen
|
||||
warnings = dict()
|
||||
if "warnings" in rawdata:
|
||||
warnings = rawdata["warnings"]
|
||||
|
||||
return (dracks, dsensors, dsubdists, mapping, dtunnels, dtunlength, errors_dists, errors_sensors, errors_attributes, warnings)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
@@ -188,7 +192,7 @@ if __name__ == "__main__":
|
||||
|
||||
# Einlesen und Vorbereiten der Daten
|
||||
rawdata = load_json(sensors_path)
|
||||
(racks, sensors, subdists, mapping, tunnels, tunlength, errors_dists, errors_sensors, errors_attributes) = prepare_data(rawdata)
|
||||
(racks, sensors, subdists, mapping, tunnels, tunlength, errors_dists, errors_sensors, errors_attributes, warnings) = prepare_data(rawdata)
|
||||
|
||||
config = configparser.ConfigParser(allow_no_value=True, delimiters=("="))
|
||||
config.optionxform = lambda optionstr: optionstr # preserve case for letters
|
||||
@@ -212,6 +216,8 @@ if __name__ == "__main__":
|
||||
cable_paths["errors_dists_not_in_layout"] = errors_dists
|
||||
cable_paths["errors_sensors_not_in_layout"] = errors_sensors
|
||||
cable_paths["errors_missing_attributes"] = errors_attributes
|
||||
# Warnungen aus getpositions übertragen
|
||||
cable_paths["warnings"] = warnings
|
||||
write_results(to_json(cable_paths), work_dir, f"{basename}.json")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user