Stop test runs writing derived weather models into the repo - #814
Open
jlmaurer wants to merge 2 commits into
Open
Stop test runs writing derived weather models into the repo#814jlmaurer wants to merge 2 commits into
jlmaurer wants to merge 2 commits into
Conversation
combine_weather_files writes the time-interpolated model next to its inputs
(wfiles[0].parent), which is right for a real weather-model cache but means
the test fixtures -- which point that cache at tracked directories -- deposit
derived files into the working tree on every run:
* test/gunw_test_data/weather_files/GMAO_*_timeInterp_*.nc overwrites two
tracked files, producing binary diffs that are easy to commit by accident;
* test/gunw_azimuth_test_data/weather_files/HRRR_*_timeInterp*.nc drops
~165 MB into the tree invisibly, since .gitignore hides that directory.
The two GMAO products are pure byproducts: derived from the tracked inputs
beside them, referenced by no test, and regenerated when deleted. They also
churn without any change in the science -- comparing a committed copy against
a regenerated one, the delays are bit-identical and the entire 1.80 -> 2.20 MB
difference is wet/hydro widening from float32 to float64 because the
interpolation weights are numpy float64 scalars.
Untrack them, ignore the derived name patterns, and route the three
weather-file fixtures through a scratch directory of symlinks. Nothing is
copied (the HRRR inputs are 128 MB), the links read through transparently,
and since the delay workflow never resolves paths, wfiles[0].parent is the
scratch directory, so the output lands there instead.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
jlmaurer
added a commit
to jlmaurer/RAiDER-1
that referenced
this pull request
Aug 15, 2026
The processed fixtures store precomputed wet/hydro refractivity and wet_total/hydro_total, and the tests that assert delay values read those stored cubes rather than recomputing them. They therefore encoded the old k1*P/T refractivity and trapezoid quadrature, and would have kept passing unchanged while silently asserting superseded numbers. Recompute the derived cubes from each fixture's own stored t/p/e. Every step that produces t/p/e is untouched here, so this reproduces exactly what the current pipeline would write for the same raw input, with no re-download. The reconstruction was checked before anything was overwritten: recomputing wet, whose formula is unchanged, reproduced the stored values bit-exactly, as did recomputing hydro under the old k1*P/T form -- confirming both that the stored t/p/e are the true inputs and that the fixtures carried the old physics. All four fixtures behind golden values are native model-level grids, so the shift is dominated by the virtual-temperature correction rather than the quadrature change, and it scales with water vapour as expected: the surface hydrostatic delay drops 1.2 mm over dry HRRR CONUS and 4.95 mm over equatorial Brazil. The four 33.7 MB HRRR inputs under gunw_azimuth_test_data are deliberately left alone: no golden value depends on them, regenerating would add ~135 MB of binary churn, and dbekaert#815 proposes untracking them entirely. The derived GMAO _timeInterp_ products are left alone too; dbekaert#814 untracks them. Co-Authored-By: Claude Opus 5 <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.
Problem
Running the test suite rewrites files inside the repository.
combine_weather_fileswrites the time-interpolated weather model next to its inputs:https://github.com/dbekaert/RAiDER/blob/dev/tools/RAiDER/cli/raider.py#L845
That is reasonable for a real weather-model cache, but the test fixtures point that cache at tracked directories, so every run with
-interp center_timeor-interp azimuth_time_griddeposits derived files into the working tree:test/gunw_test_data/weather_files/GMAO_*_timeInterp_*.nc— two tracked files overwritten, showing up as binary diffs ingit statusthat are easy to commit by accident.test/gunw_azimuth_test_data/weather_files/HRRR_*_timeInterp*.nc— four files, ~41 MB each (~165 MB) written into the tree on every run and invisible togit status, because.gitignore:29hides that directory.Checksumming all 24 tracked
.ncfiles before and after a fullpytest -m "not long"run confirms exactly two tracked files change, both_timeInterp_; the other 22 are read-only.The two overwritten GMAO files are pure byproducts:
conftest.pylists only the inputs;pytest test/test_GUNW.pyregenerates them and passes.They also churn without any change in the science. Comparing the committed copy against a regenerated one, the delay values are bit-identical; the whole 1.80 MB → 2.20 MB size difference is
wet/hydrowidening fromfloat32tofloat64(2 × 394400 − 2 × 197200 = 394400 bytes, matching exactly), because the interpolation weights are numpyfloat64scalars. A numpy promotion-behaviour difference alone produces a 400 KB binary diff.Changes
Untrack the two derived GMAO
_timeInterp_files (git rm --cached; the files stay on disk) and add.gitignorerules for*_timeInterp_*.nc/*_timeInterpAziGrid_*.nc.Stop the tests writing into the repo at all. A new
_linked_weather_fileshelper intest/conftest.pysymlinks the tracked input files into a session-scoped scratch directory and hands the tests those paths. Since the delay workflow never calls.resolve(),wfiles[0].parentis the scratch directory, so the derived output lands there instead. Symlinks mean nothing is copied — this matters for the 128 MB of HRRR inputs.Applied to all three weather-file fixtures:
weather_model_dict_for_gunw_integration_test,weather_model_dict_for_azimuth_time_test, andweather_model_dict_for_center_time_test.Verification
With every derived file deleted from both fixture directories beforehand:
passes, and neither fixture directory receives any
_timeInterp_/_timeInterpAziGrid_output afterwards.git statusis clean.(
test_hrrr_availability_check_using_gunw_idsis deselected above only because it hits live HRRR servers and fails with a socket timeout on this network; it is unrelated to these changes.)Not included
The four tracked 32 MB HRRR input files under
test/gunw_azimuth_test_data/weather_files/are left alone here. They are already matched by.gitignore:29but tracked anyway, and unlike the derived products they cannot simply be removed —test_azimuth_timing_interp_against_center_time_interpneeds them. Fixing that requires a way to fetch them, which is out of scope for this PR. Tracked separately in #815.