Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion autofit/aggregator/search_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def instance(self):
try:
return self.samples.max_log_likelihood()
except (AttributeError, NotImplementedError):
return None
return self.samples_summary.instance
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

This change introduces a potential AttributeError that is not caught. The samples_summary property (line 227) calls self.value("samples_summary") which can return None if the file doesn't exist. When summary is None, line 228 will fail with AttributeError: 'NoneType' object has no attribute 'model'. Additionally, even if samples_summary is not None, accessing its instance property could raise exceptions since it internally calls max_log_likelihood().

The docstring on line 248 states "None if samples cannot be loaded", but the new code path doesn't handle these potential failures. Consider wrapping the fallback in a try-except block similar to the pattern used in autofit/non_linear/result.py:115-120, or add proper null checking.

Copilot uses AI. Check for mistakes.

@property
def id(self) -> str:
Expand Down
Loading