Cleanup: low-risk simplifications + image/gzip docs + v0.2.0#3
Merged
Conversation
Low-risk reductions identified by analysis; no behavior change (all tests,
including the funpack/astropy bit-exact suites, still pass):
- keyword.rs: collapse format_float; strip_suffix('&') for continuation;
extract logical_str() and fortran_exp() helpers (reused in ascii_table.rs).
- header.rs: single END-card check; cards.resize() for padding.
- checksum.rs: extract fold_carries() (end-around carry, was written 3x).
- hdu.rs: extract data_bytes() (was duplicated in write_impl/verify_datasum).
- tile_compress.rs: make gather_tile generic <T: Copy> and drop the duplicate
gather_tile_f64; tile_dims_at method delegates to the free fn; iseed advance
uses % N_RANDOM.
- image_conv.rs: extract luma16_to_image() shared by the Luma16/other arms.
(The bintable big-endian decode consolidation was intentionally skipped — too
risky to refactor published bit-exact decode for a modest LOC gain.)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- README + lib.rs: add an `image`-crate interop example (to_dynamic_image / from_dynamic_image) and a `gzip`-feature note; the lib.rs image doctest is cfg-gated + no_run so default and --all-features doctests both pass. - Cargo.toml: version 0.1.0 -> 0.2.0 (additive features since 0.1.0: encode path, PLIO/HCOMPRESS/float decode, WCS). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Combines the approved code-simplification pass with the
image/gzipdocumentation and a version bump. No behavior change — all tests (incl. the funpack/astropy bit-exact suites) pass; default build stays zero-dependency; clippy clean on--all-features --all-targets -D warnings.Simplifications (behavior-preserving)
keyword.rs: collapseformat_float;strip_suffix('&'); extractlogical_str/fortran_exp(reused inascii_table.rs).header.rs: single END-card check;cards.resize()for padding.checksum.rs: extractfold_carries(was written 3×).hdu.rs: extractdata_bytes(duplicated inwrite_impl/verify_datasum).tile_compress.rs: genericgather_tile<T>(drops duplicategather_tile_f64);tile_dims_atdelegates to the free fn;iseedadvance via% N_RANDOM.image_conv.rs: extractluma16_to_imageshared by the Luma16/other arms.Intentionally skipped: the
bintable.rsbig-endian decode consolidation — too risky to refactor published bit-exact decode for a modest LOC gain. Also held (separate careful pass): theDitherRngextraction and the keyword comment-column refactor.Docs
image-crate interop example (to_dynamic_image/from_dynamic_image) and agzip-feature note in both README andlib.rs. The lib.rs image doctest is#[cfg(feature = "image")]+no_run, so default and--all-featuresdoctests both pass.Version
0.1.0→0.2.0(additive features since the 0.1.0 publish: encode path, PLIO/HCOMPRESS/float decode, WCS).Net: −21 LOC (≈ −70 code, + new docs examples).