Skip to content

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

Open
Copilot wants to merge 1 commit intomainfrom
copilot/update-wheel-pattern-regex
Open

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

Conversation

Copy link
Copy Markdown

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]+)$'
)

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