From b9359c459efee6c574bd81eb778601f6f853b043 Mon Sep 17 00:00:00 2001 From: David Vo Date: Tue, 16 Sep 2025 15:52:49 +1000 Subject: [PATCH] wpimath: Remove floorDiv and floorMod These provide identical results to the native Python operators `//` and `%`, with worse performance. --- .../robotpy-wpimath/semiwrap/MathUtil.yml | 20 ++++++------------- .../robotpy-wpimath/wpimath/__init__.py | 4 ---- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/subprojects/robotpy-wpimath/semiwrap/MathUtil.yml b/subprojects/robotpy-wpimath/semiwrap/MathUtil.yml index 94f459bbf..7fe142294 100644 --- a/subprojects/robotpy-wpimath/semiwrap/MathUtil.yml +++ b/subprojects/robotpy-wpimath/semiwrap/MathUtil.yml @@ -4,21 +4,13 @@ functions: - [double] AngleModulus: FloorDiv: - template_impls: - - [int64_t, int64_t] - # work around GCC 10 issue on raspbian - cpp_code: | - [](int64_t x, int64_t y) -> int64_t { - return frc::FloorDiv(x, y); - } + # Use // operator instead, it's more efficient + # - https://github.com/robotpy/mostrobotpy/pull/200 + ignore: true FloorMod: - template_impls: - - [int64_t, int64_t] - # work around GCC 10 issue on raspbian - cpp_code: | - [](int64_t x, int64_t y) -> int64_t { - return frc::FloorMod(x, y); - } + # Use % operator instead, it's more efficient + # - https://github.com/robotpy/mostrobotpy/pull/200 + ignore: true ApplyDeadband: param_override: maxMagnitude: diff --git a/subprojects/robotpy-wpimath/wpimath/__init__.py b/subprojects/robotpy-wpimath/wpimath/__init__.py index f85ba7db0..84d08d352 100644 --- a/subprojects/robotpy-wpimath/wpimath/__init__.py +++ b/subprojects/robotpy-wpimath/wpimath/__init__.py @@ -7,8 +7,6 @@ from ._wpimath import ( angleModulus, applyDeadband, - floorDiv, - floorMod, inputModulus, objectToRobotPose, slewRateLimit, @@ -17,8 +15,6 @@ __all__ = [ "angleModulus", "applyDeadband", - "floorDiv", - "floorMod", "inputModulus", "objectToRobotPose", "slewRateLimit",