Skip to content

Fix -0 and --fast in the igzip command line interface - #300

Merged
rhpvorderman merged 1 commit into
pycompression:developfrom
ptweezy:cli-fast-level
Oct 28, 2026
Merged

rhpvorderman merged 1 commit into
pycompression:developfrom
ptweezy:cli-fast-level

Conversation

@ptweezy

@ptweezy ptweezy commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

python -m isal.igzip -0 and --fast compress at level 2. main() picks the level with args.compresslevel or _COMPRESS_LEVEL_TRADEOFF, and 0 is falsy. For example, on the first 200,000 bytes of the FASTQ file in tests/data/test.fastq.gz, -0 and -2 both give 96,708 bytes. With this PR, -0 gives 129,336 bytes with the XFL byte set to 4 (fastest), and the other levels give the same output as before.

This PR sets the default level with set_defaults() in the argument parser. test_compress_stdin_stdout now also checks the XFL byte. On develop, that check fails for level 0.

Checklist

  • Pull request details were added to CHANGELOG.rst
  • Documentation was updated (if needed)

main() chose the level with `args.compresslevel or _COMPRESS_LEVEL_TRADEOFF`, so level 0 fell back to level 2. Set the default level in the argument parser instead.
@rhpvorderman

Copy link
Copy Markdown
Collaborator

Thanks!

@rhpvorderman
rhpvorderman merged commit 6f8997a into pycompression:develop Oct 28, 2026
22 checks passed
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