Skip to content

Fix wheel_pattern regex to support negative Count and Deg values#139

Merged
rcpeene merged 1 commit intomainfrom
copilot/update-wheel-pattern-regex
Apr 17, 2026
Merged

Fix wheel_pattern regex to support negative Count and Deg values#139
rcpeene merged 1 commit intomainfrom
copilot/update-wheel-pattern-regex

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

The wheel_pattern regex in _reconstruct_encoder_from_logger failed to match wheel events with negative Count or Deg values, silently dropping those encoder readings.

Changes

  • Count group: (\d+)(-?\d+) to handle negative integer counts
  • Deg group: ([0-9eE+\.-]+)([-+\d\.eE]+) to explicitly handle negative degrees and preserve ± sign support in scientific notation
# Before
wheel_pattern = re.compile(r'^Wheel-Index-(\d+)-Count-(\d+)-Deg-([0-9eE+\.-]+)$')

# After
wheel_pattern = re.compile(
    r'^Wheel-Index-(\d+)-Count-(-?\d+)-Deg-([-+\d\.eE]+)$'
)

@rcpeene rcpeene marked this pull request as ready for review March 23, 2026 22:47
@rcpeene rcpeene merged commit 024cb1b into main Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants