Skip to content

Untrack the 128 MB of HRRR test fixtures that .gitignore already excludes #815

Description

@jlmaurer

Summary

test/gunw_azimuth_test_data/weather_files/ holds four HRRR weather-model files of ~32 MB each (128 MB total) that are tracked in git even though .gitignore already declares they should not be:

file size
test/gunw_azimuth_test_data/weather_files/HRRR_2021_07_11_T01_00_00_33N_36N_120W_115W.nc 32 MB
test/gunw_azimuth_test_data/weather_files/HRRR_2021_07_11_T02_00_00_33N_36N_120W_115W.nc 32 MB
test/gunw_azimuth_test_data/weather_files/HRRR_2021_07_23_T01_00_00_33N_36N_120W_115W.nc 32 MB
test/gunw_azimuth_test_data/weather_files/HRRR_2021_07_23_T02_00_00_33N_36N_120W_115W.nc 32 MB

.gitignore:29 contains gunw_azimuth_test_data/, and the rule does match these paths:

$ git check-ignore --no-index -v test/gunw_azimuth_test_data/weather_files/HRRR_2021_07_11_T01_00_00_33N_36N_120W_115W.nc
.gitignore:29:gunw_azimuth_test_data/	test/gunw_azimuth_test_data/weather_files/HRRR_2021_07_11_T01_00_00_33N_36N_120W_115W.nc

They are tracked only because tracking overrides .gitignore — they were committed before the rule existed, or force-added. So the repository currently disagrees with its own stated intent.

For scale: tracked .nc files total 340 MB, and these four are 38% of that.

Why this is awkward

Unlike the derived _timeInterp_ products removed in #814, these four are genuine inputs, not byproducts. They are consumed by weather_model_dict_for_azimuth_time_test and weather_model_dict_for_center_time_test in test/conftest.py, which feed test_azimuth_timing_interp_against_center_time_interp in test/test_GUNW.py. They cannot simply be deleted — removing them from the working tree breaks that test, and it is not marked long, so it runs by default.

That is why they were left alone in #814: untracking them needs a way to obtain them, which is a larger change than that PR's scope.

Recommendation

Untrack the four files and fetch them on demand, in this order of preference:

  1. Download-on-demand fixture (preferred). Host the four files as a release asset or in an S3 bucket alongside the other test data, and have a session-scoped fixture download-and-cache them into a scratch directory on first use (skipping the test with a clear message when the fetch fails or the network is unavailable). This keeps the repo small, removes the .gitignore contradiction, and makes the provenance explicit. conftest.py already documents how the files were generated, so a regeneration path exists.

  2. Git LFS. Simpler to implement and keeps git clone working unchanged, but adds an LFS dependency for all contributors and CI, and LFS bandwidth quotas can bite on a public repo.

  3. Mark the test long and untrack. Cheapest, but it removes real coverage of azimuth-time interpolation from the default suite, so I would not recommend it on its own.

Whichever route is chosen, git rm --cached on the four paths is enough to stop tracking them; .gitignore:29 already covers them afterwards, so no ignore change is needed.

Note that untracking does not shrink the repository history on its own — the blobs stay in the object database. Reclaiming that space would need a history rewrite, which is almost certainly not worth it here; the goal is to stop future growth and to make the tree consistent with .gitignore.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions