Revert "fix(bisect): Ignore negative values" 98/42698/2
authorPeter Mikus <peter.mikus@icloud.com>
Mon, 7 Apr 2025 05:16:17 +0000 (05:16 +0000)
committerPeter Mikus <peter.mikus@icloud.com>
Mon, 7 Apr 2025 05:16:25 +0000 (05:16 +0000)
This reverts commit 88b4da3ad723f9e0d3f7157b61285bb4ec172e0d.

Reason for revert: Do not put logic into model!!!!

Change-Id: I633cc9601b618567bd4646c920d88a6a3f29f06b
Signed-off-by: Peter Mikus <peter.mikus@icloud.com>
resources/libraries/python/model/parse.py

index 6f45052..1e0aebf 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2025 Cisco and/or its affiliates.
+# Copyright (c) 2024 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -93,21 +93,19 @@ def parse(dirpath: str, fake_value: float = 1.0) -> Dict[str, List[float]]:
             result_object = data["result"]
             result_type = result_object["type"]
             if result_type == "mrr":
-                result_list = result_object["receive_rate"]["rate"]["values"]
+                results[name] = result_object["receive_rate"]["rate"]["values"]
             elif result_type == "ndrpdr":
-                result_list = [result_object["pdr"]["lower"]["rate"]["value"]]
+                results[name] = [result_object["pdr"]["lower"]["rate"]["value"]]
             elif result_type == "soak":
-                result_list = [
+                results[name] = [
                     result_object["critical_rate"]["lower"]["rate"]["value"]
                 ]
             elif result_type == "reconf":
-                result_list = [result_object["loss"]["time"]["value"]]
+                results[name] = [result_object["loss"]["time"]["value"]]
             elif result_type == "hoststack":
-                result_list = [result_object["bandwidth"]["value"]]
+                results[name] = [result_object["bandwidth"]["value"]]
             else:
                 raise RuntimeError(f"Unknown result type: {result_type}")
-            # Negative values from csit/issues/3983 need to be ignored.
-            results[name] = [float(val) for val in result_list if val >= 0]
     results = {test_id: results[test_id] for test_id in sorted(results)}
     with open(resultpath, "wt", encoding="utf8") as file_out:
         json.dump(results, file_out, indent=1, separators=(", ", ": "))