Skip to content

Preserve numeric symbols for unsigned Lempel-Ziv inputs - #58

Draft
AHMETHAKANBEZIR1 wants to merge 1 commit into
raphaelvallat:masterfrom
AHMETHAKANBEZIR1:fix/lziv-unsigned-symbols
Draft

AHMETHAKANBEZIR1 wants to merge 1 commit into
raphaelvallat:masterfrom
AHMETHAKANBEZIR1:fix/lziv-unsigned-symbols

Conversation

@AHMETHAKANBEZIR1

Copy link
Copy Markdown

lziv_complexity dispatches unsigned integer arrays through the string branch instead of the documented numeric-symbol branch. Decimal representations are then concatenated, changing the sequence and its normalization. For example, [10, 11, 10] as uint8 gives raw complexity 4 and normalized complexity about 1.7233, while the same integer symbols as int64 give 3 and about 1.5850.

Include NumPy's unsigned-integer dtype kind alongside booleans, floats and signed integers in the existing conversion to uint32. This preserves the existing numeric casting policy and string-input behavior; it does not change the LZ parsing algorithm or the handling of values outside uint32's range.

Validation on Windows CPU, Python 3.12.14:

  • 32 regression cases cover uint8/16/32/64, raw/normalized output, binary and relabeled multi-digit alphabets, and two independently known sequence complexities. On unmodified master 6843920, 12 fail and 20 controls pass; with the fix all 32 pass. Inputs are checked for mutation.
  • Full suite: 66 passed with NumPy 1.26.4, and 66 passed with NumPy 2.5.4 (Numba 0.68.0, SciPy 1.17.1, scikit-learn 1.9.1).
  • Repository Ruff lint/format checks and whitespace check passed.

Other operating systems, doctests and performance benchmarks were not run.

AI disclosure: OpenAI Codex autonomously investigated and implemented the fix/tests, wrote this description and ran the reported checks. No independent human pre-submission review has been performed.

@raphaelvallat

Copy link
Copy Markdown
Owner

Thank you for your contribution!

AntroPy now has guidelines for pull requests, including specific steps for AI-assisted PRs: #61

Before I review this PR, could you please go through those steps and update the PR accordingly? In particular: state the user-impact rating (P1-P3) with a short justification, start the description with a summary in your own words, report the exact AI model used (if any), and run an AI review and post a summary of it as a comment. Thanks!

@AHMETHAKANBEZIR1
AHMETHAKANBEZIR1 marked this pull request as draft October 24, 2026 12:27

This branch has not been deployed

No deployments
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