Skip to content

fix: handle rejected final samples in test mode 1 - #1463

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/test-mode-fit-exception-finalization
Aug 11, 2026
Merged

fix: handle rejected final samples in test mode 1#1463
Jammy2211 merged 1 commit into
mainfrom
feature/test-mode-fit-exception-finalization

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Prevent PYAUTO_TEST_MODE=1 from finalizing a sampler point whose model reconstruction raises FitException. Reduced searches now replace that rejected point with bounded, deterministic, fully validated representative samples, preserving valid result creation and downstream chaining while failing clearly when no valid representative exists.

Fixes #1462.

API Changes

NonLinearSearch.fit() changes behavior only under PYAUTO_TEST_MODE=1: a final sample rejected with FitException is replaced by valid representative test-mode samples. Normal searches, test modes 2/3, and non-FitException failures are unchanged.
See full details below.

Test Plan

  • Focused rejected-final-sample regression tests: 4 passed
  • Surrounding search tests: 32 passed
  • Full PyAutoFit suite: 1707 passed, 2 skipped
  • git diff --check
Full API Changes (for automation & release notes)

Changed Behaviour

  • autofit.non_linear.search.abstract_search.NonLinearSearch.fit() — under PYAUTO_TEST_MODE=1, validates the final summary instance and replaces a FitException-rejected result with bounded deterministic representative samples.
  • Replacement samples are all validated before result creation; failure after 100 attempts raises a clear FitException.
  • Production behavior and unrelated exception propagation are unchanged.

Migration

  • None required.

Generated by the PyAutoLabs agent workflow.

@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Aug 11, 2026
@Jammy2211
Jammy2211 marked this pull request as ready for review August 11, 2026 02:56
@Jammy2211
Jammy2211 merged commit 18aae0f into main Aug 11, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/test-mode-fit-exception-finalization branch August 11, 2026 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: handle rejected final samples in test mode 1

1 participant