store tabulated densities as float32 npz to fit PyPI's 100 MB limit - #87
Merged
Conversation
The v3.0 wheel was 145 MB because the bskg3 and d1m density tables
shipped as 452 MB of 11-column ASCII, of which the loader only read the
radius, proton and neutron density columns. Each model is now one
compressed .npz (13 + 12 MB) holding just the two densities as float32
on a uniform grid; the original tables carry 5-6 significant digits and
round-trip to 6e-8 relative error. The wheel drops to 29 MB, the sdist
to 39 MB, and `import jitr` no longer parses 452 MB of text (8.8 s to
1.6 s).
- density.py: load <model>.npz at init; keep the .rad reader as
read_rad_file and add write_density_npz for conversion
- scripts/convert_density_tables.py: rebuild an npz from a .rad directory
- remove src/data/densities/{bskg3,d1m}/*.rad (kept in history, 71e4ea0)
- tests: rad -> npz round trip and uniform-grid check
Claude-Session: https://claude.ai/code/session_014PvAXNJiHj9E9CiGeH45Pm
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.
The v3.0 wheel was 145 MB because the bskg3 and d1m density tables shipped as 452 MB of 11-column ASCII, of which the loader only read the radius, proton and neutron density columns. Each model is now one compressed .npz (13 + 12 MB) holding just the two densities as float32 on a uniform grid; the original tables carry 5-6 significant digits and round-trip to 6e-8 relative error. The wheel drops to 29 MB, the sdist to 39 MB, and
import jitrno longer parses 452 MB of text (8.8 s to 1.6 s).