Skip to content

Ignore the .h5 files generated by the scripts - #265

Merged
michakraus merged 2 commits into
mainfrom
T3-ignore-generated-h5
Sep 15, 2026
Merged

michakraus merged 2 commits into
mainfrom
T3-ignore-generated-h5

Conversation

@michakraus

Copy link
Copy Markdown
Member

scripts/symplectic_autoencoders/integration.jl writes a 7.9 MiB snapshot_matrix.h5 into the
source tree on every run, and .gitignore did not cover it. The script passes a bare relative name
to h5open, so the file lands in the process working directory — at the repository root when the
script is run from there, or in the script's own directory when run from there. Two anchored rules
cover both, and the six committed network weights under docs/src/tutorials/ stay tracked.

Sub-task T3 of Tasks/Restructure the GeometricMachineLearning test and script trees.md.

Note what this does and does not do: the script still writes the file on every run, and deleting it
is still manual. What changed is that git status no longer reports it.

Pre-PR verification

Fixed

  • .gitignore:15 — dropped the trailing full stop from the block's header comment, which the file's other ten header comments do not carry.

Unresolved — none.

Pre-existing, adjacent — none fixed. scripts/symplectic_autoencoders/integration.jl passes a bare relative file name to h5open; changing that is a behaviour decision, and training.jl and plot_waves.jl read the same bare name.

Checked and clean

  • Pattern behaviour, with git check-ignore -v: snapshot_matrix.h5 and snapshot_matrix2.h5 at the root match /snapshot_matrix*.h5; scripts/**/*.h5 matches at every depth under scripts/, including directly in it; docs/src/tutorials/sae_parameters.h5 and a hypothetical seventh weight file there are not ignored. git ls-files -c -i --exclude-standard is empty — no tracked file became ignored.
  • No workflow under .github/ references .h5.
  • Comment tense: both .gitignore comment blocks describe the rules as they are, and carry no history markers.
  • Changelog accuracy: the 7.9 MiB figure re-derives exactly (260×4000 Float64 = 8 320 000 B = 7.9346 MiB) from Ñ = 128, n_params = 20, n_time_steps = 200; p_zero = false as committed; the six tracked weight files are exactly those named, and all six are loaded from @setup or @example blocks in the two tutorials. The entry sits under ### Fixed within ## [Unreleased] — 0.8.0, both existing headings.

Not checked

  • Type piracy, type instability, allocations, imports, fatou lint, the load test and the test suite: not applicable — the diff contains no Julia source.
  • Doctests: not applicable — the diff touches no file under docs/.
  • Whether another Julia job was running: ps is blocked in the sandbox. No measured point depended on it.

Verification

integration.jl was run in an isolated process both ways — from the repository root, and with
its own directory as the working directory — each writing 8,322,056 bytes. After each run
git status --short was empty, and git ls-files '*.h5' returned the same six
docs/src/tutorials/ weights before and after the change.

The one counterfactual claim the changelog makes — that a bare *.h5 would leave the six tracked
weights alone but would make git add refuse a seventh — was reproduced in a throwaway repository
rather than reasoned about.

🤖 Generated with Claude Code

scripts/symplectic_autoencoders/integration.jl writes a ~7.9 MB snapshot
matrix, and .gitignore did not cover it, so every run left the working
tree dirty and put the artefact one staging sweep away from the history.

The file name reaches h5open as a bare relative string, so it lands in
the process working directory rather than beside the script: at the
repository root, or in scripts/symplectic_autoencoders/, depending on
where the script is started from. A pattern confined to scripts/ covers
only the second case, so the root is matched as well, by an anchored
/snapshot_matrix*.h5 that also takes in the snapshot_matrix2.h5 named by
the script's p_zero branch -- a branch not taken as committed.

Neither pattern reaches docs/src/tutorials/, where the six committed
network weights are .h5 too and the tutorials load them in @setup and
@example blocks instead of retraining.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved issues were identified, and tracked tutorial weights remain preserved.

Pull request overview

This pull request prevents generated .h5 snapshot files from appearing as untracked changes while preserving tracked tutorial weights.

Changes:

  • Adds scoped ignore rules for generated snapshot files.
  • Documents the behavior and scope in the changelog.
File summaries
File Summary
CHANGELOG.md Documents the ignore-rule behavior and scope.
.gitignore Ignores generated HDF5 files in supported locations.
Review details
  • Files reviewed: 1/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.40%. Comparing base (2d48e94) to head (128db38).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #265   +/-   ##
=======================================
  Coverage   72.40%   72.40%           
=======================================
  Files          99       99           
  Lines        3606     3606           
=======================================
  Hits         2611     2611           
  Misses        995      995           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@michakraus
michakraus merged commit 6a3cadf into main Sep 15, 2026
9 of 10 checks passed
@michakraus
michakraus deleted the T3-ignore-generated-h5 branch September 15, 2026 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants