Skip to content

Commit 6b3c165

Browse files
authored
Fix q78 problematic value comparison (#210)
* Fix q78 problematic value comparison Signed-off-by: Yinqing Hao <[email protected]> * Fix license header Signed-off-by: Yinqing Hao <[email protected]> --------- Signed-off-by: Yinqing Hao <[email protected]>
1 parent ce6a80e commit 6b3c165

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

nds/nds_validate.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33
#
4-
# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4+
# SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
55
# SPDX-License-Identifier: Apache-2.0
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -179,14 +179,12 @@ def rowEqual(row1, row2, epsilon, is_q78, q78_problematic_col):
179179
problematic_val_row2 = row2.pop(q78_problematic_col-1)
180180
problematic_val_eq = False
181181
# this value could be none in some rows
182-
if all([problematic_val_row1, problematic_val_row2]):
182+
if problematic_val_row1 is not None and problematic_val_row2 is not None:
183183
# this value is rounded to its pencentile: round(ss_qty/(coalesce(ws_qty,0)+coalesce(cs_qty,0)),2)
184184
# so we allow the diff <= 0.01 + default epsilon 0.00001
185185
problematic_val_eq = abs(problematic_val_row1 - problematic_val_row2) <= 0.01001
186-
elif problematic_val_row1 == None and problematic_val_row2 == None:
187-
problematic_val_eq = True
188186
else:
189-
problematic_val_eq = False
187+
problematic_val_eq = problematic_val_row1 is None and problematic_val_row2 is None
190188
return problematic_val_eq and all([compare(lhs, rhs, epsilon) for lhs, rhs in zip(row1, row2)])
191189
else:
192190
return all([compare(lhs, rhs, epsilon) for lhs, rhs in zip(row1, row2)])

0 commit comments

Comments
 (0)