From fa0d2a7dd0a5e1864cd36cca50d6e0b43df797a3 Mon Sep 17 00:00:00 2001 From: troyyyyy Date: Thu, 16 Nov 2023 09:22:19 +0800 Subject: [PATCH] [FIX] remove obsolete function in utils --- abl/utils/utils.py | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/abl/utils/utils.py b/abl/utils/utils.py index 1480045..1a6f615 100644 --- a/abl/utils/utils.py +++ b/abl/utils/utils.py @@ -144,34 +144,6 @@ def block_sample(X, Z, Y, sample_num, seg_idx): return (data[start_idx:end_idx] for data in (X, Z, Y)) -def check_equal(a, b, max_err=0): - """ - Check whether two numbers a and b are equal within a maximum allowable error. - - Parameters - ---------- - a, b : int or float - The numbers to compare. - max_err : int or float, optional - The maximum allowable absolute difference between a and b for them to be considered equal. - Default is 0, meaning the numbers must be exactly equal. - - Returns - ------- - bool - True if a and b are equal within the allowable error, False otherwise. - - Raises - ------ - TypeError - If a or b are not of type int or float. - """ - if not (isinstance(a, (int, float)) and isinstance(b, (int, float))): - raise TypeError("Input values must be int or float.") - - return abs(a - b) <= max_err - - def to_hashable(x): """ Convert a nested list to a nested tuple so it is hashable.