Repository navigation
fzd: do not leave an empty iterNNN_<timestamp> directory per iteration - #108
Merged
Merged
Conversation
#106) fzd created analysis_dir/iterNNN/ before calling fzr() on it; fzr() renames an existing results_dir with a timestamp, so every iteration of a file-based model left an empty iterNNN_<timestamp>/ next to the real iterNNN/. The directory is no longer created before fzr() (which creates it); the function-model branch, which writes values.csv itself, creates it there. Results and cross-run cache reuse are unchanged (checked: a re-run into the same analysis_dir reuses every case from cache://). tests/test_fzd_iteration_dirs.py: no iter*_* directory after a 2-iteration file-based run (fails on main), and the function model still writes values.csv. NEWS (2.0, Robustness). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RjXvVRjM6aMvKvvSFoxpZ6
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.
Pull Request
Description
With a file-based model,
fzdleft an emptyiterNNN_<timestamp>/directory next to eachiterNNN/of itsanalysis_dir, even in a fresh directory. It createditerNNN/and then calledfzr()on it, andfzr()renames an existingresults_dirwith a timestamp before running.The directory is no longer created before
fzr(), which creates it itself. The function-model branch writesvalues.csvinto it directly, so it still creates it there.Related Issues
Fixes #106
Type of Change
Changes Made
fz/core.py(iteration loop offzd):iteration_result_dir.mkdir(...)is moved into the function-model branch, just before_save_function_model_iteration_csv. The file-based path leaves the creation tofzr().tests/test_fzd_iteration_dirs.py:bfgs,max_iter=2),analysis_dircontains onlyiter001/anditer002/, each with case directories. This test fails onmain, which leaves['iter001', 'iter001_<ts>', 'iter002', 'iter002_<ts>'];iter001/values.csv.NEWS.md: one entry in the 2.0 "Robustness" section, since the2.0tag does not exist yet.Testing Performed
main(4ed796e) with the new test before the fix.fzdtests pass (test_fzd*.py, including the new file);fzdinto the sameanalysis_dirreuses all cases fromcache://…/an_<timestamp>/iter001, so the cross-run cache path mentioned in the issue still works;flake8check (--select=E9,F63,F7,F82) reports 0 errors.ci.yml--ignorelist):5 failed, 1082 passed, 86 skipped. The 5 failures are the pre-existing environmental ones, identical onmain: 3 permission tests that fail when run as root, and 2yqtests that need a differentyq.Generated by Claude Code