From e0287c3b0cc50f228446a0bba5410a685e222ffa Mon Sep 17 00:00:00 2001 From: Joshua Bloom Date: Mon, 13 Apr 2026 07:26:16 -0400 Subject: [PATCH] fix(main): remove dead HAS_HDF5 conditional gate HAS_HDF5 was referenced at Main.py:582 but never defined, causing every job to crash at the end of episode 0 with: NameError: name 'HAS_HDF5' is not defined The conditional was a leftover from an earlier optional-h5py state. h5py is now a hard dependency of src.hdf5_logger (it's imported unconditionally at the top of that module), so the gate was always-true dead code. Surfaced by the same smoke test that found the data_logger leftover. Co-Authored-By: Claude Opus 4.6 (1M context) --- rl_code/Main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rl_code/Main.py b/rl_code/Main.py index bd41c12..36578de 100644 --- a/rl_code/Main.py +++ b/rl_code/Main.py @@ -579,8 +579,10 @@ if hasattr(model, 'reset_hidden_states'): model.reset_hidden_states() run_time = time.time() - episode_start_time - if HAS_HDF5: - hdf5_writer.write_episode(ep_counter) + # h5py is a hard dep of src.hdf5_logger, so the previous HAS_HDF5 + # gate was always-true dead code. Removed during the same cleanup + # that dropped the data_logger references. + hdf5_writer.write_episode(ep_counter) log.info( "Episode %d done: success=%s duration=%.1fs timesteps=%d", ep_counter, reached_goal, run_time, time_steps,