From 57d9d2df33d4fbd735d576859983162d187c0d06 Mon Sep 17 00:00:00 2001 From: Leonardo Schwarz Date: Tue, 15 Oct 2024 13:02:42 +0200 Subject: [PATCH] `math_helper.py` has been removed --- docs/changelog.md | 1 + src/bfabric/utils/math_helper.py | 9 --------- tests/bfabric/utils/test_math_helper.py | 15 --------------- 3 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 src/bfabric/utils/math_helper.py delete mode 100644 tests/bfabric/utils/test_math_helper.py diff --git a/docs/changelog.md b/docs/changelog.md index 0e80e294..b659ab7a 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -28,6 +28,7 @@ Versioning currently follows `X.Y.Z` where ### Removed - `bfabric_legacy.py` has been removed. +- `math_helper.py` has been removed. ## \[1.13.8\] - 2024-10-03 diff --git a/src/bfabric/utils/math_helper.py b/src/bfabric/utils/math_helper.py deleted file mode 100644 index 7e20278f..00000000 --- a/src/bfabric/utils/math_helper.py +++ /dev/null @@ -1,9 +0,0 @@ -def div_int_ceil(n: int, d: int) -> int: - """ - :param n: Numerator - :param d: Denominator - :return: Performs integer ceiling division - Theoretically equivalent to math.ceil(n/d), but not subject to floating-point errors. - """ - q, r = divmod(n, d) - return q + bool(r) diff --git a/tests/bfabric/utils/test_math_helper.py b/tests/bfabric/utils/test_math_helper.py deleted file mode 100644 index 0f81be22..00000000 --- a/tests/bfabric/utils/test_math_helper.py +++ /dev/null @@ -1,15 +0,0 @@ -import unittest - -import bfabric.utils.math_helper as math_helper - - -class BfabricTestMath(unittest.TestCase): - def test_integer_division(self): - # Main purpose of dictionary sorting is that they appear consistent when printed - self.assertEqual(math_helper.div_int_ceil(120, 100), 2) - self.assertEqual(math_helper.div_int_ceil(200, 100), 2) - self.assertEqual(math_helper.div_int_ceil(245, 100), 3) - - -if __name__ == "__main__": - unittest.main(verbosity=2)