Summary
When a single fit evaluation fails (the model's execute() raises an
exception), the scatter-search run aborts entirely with
AttributeError: 'tuple' object has no attribute 'score'
instead of recording that parameter set as a failed simulation and
continuing. PyBNF's generic handler reports it as "an unknown error
occurred ... Please report this bug", so the crash is also user-facing.
Traceback
Sorry, an unknown error occurred: AttributeError: 'tuple' object has no attribute 'score'
Traceback (most recent call last):
File "pybnf/pybnf.py", line 249, in main
File "pybnf/algorithms.py", line 1385, in run
File "pybnf/algorithms.py", line 1063, in add_to_trajectory
if res.score is None: # Check if the objective wasn't evaluated on the workers
AttributeError: 'tuple' object has no attribute 'score'
Where
In the scatter-search run() loop (algorithms.py:1385), each completed
job res is passed to add_to_trajectory(res) and then read as
res.score. Both assume res is a Result. When the evaluation failed,
res arrives as a tuple, so add_to_trajectory (algorithms.py:1063,
res.score) raises.
PyBNF already has FailedSimulation(Result) for exactly this case — a
failed evaluation should yield a FailedSimulation with a penalizing
objective. The failing path here does not produce one; a bare tuple
reaches the trajectory code instead.
Reproduction context
Hit with bngl_backend=bngsim on a network-free fitting job: a model
action produced simulation output missing an expected .exp column, so
Model.execute() raised PybnfError. The underlying column issue was a
separate bug; the point here is the failure mode — any exception from a
fit evaluation crashes the whole run rather than penalizing that one
parameter set.
Expected behavior
A failed fit evaluation should:
- be turned into a
FailedSimulation (penalizing objective),
- be logged to
FailedSimLogs/,
- and let the scatter-search run continue.
A single bad parameter set should not abort an entire multi-hour fit.
Summary
When a single fit evaluation fails (the model's
execute()raises anexception), the scatter-search run aborts entirely with
instead of recording that parameter set as a failed simulation and
continuing. PyBNF's generic handler reports it as "an unknown error
occurred ... Please report this bug", so the crash is also user-facing.
Traceback
Where
In the scatter-search
run()loop (algorithms.py:1385), each completedjob
resis passed toadd_to_trajectory(res)and then read asres.score. Both assumeresis aResult. When the evaluation failed,resarrives as atuple, soadd_to_trajectory(algorithms.py:1063,res.score) raises.PyBNF already has
FailedSimulation(Result)for exactly this case — afailed evaluation should yield a
FailedSimulationwith a penalizingobjective. The failing path here does not produce one; a bare tuple
reaches the trajectory code instead.
Reproduction context
Hit with
bngl_backend=bngsimon a network-free fitting job: a modelaction produced simulation output missing an expected
.expcolumn, soModel.execute()raisedPybnfError. The underlying column issue was aseparate bug; the point here is the failure mode — any exception from a
fit evaluation crashes the whole run rather than penalizing that one
parameter set.
Expected behavior
A failed fit evaluation should:
FailedSimulation(penalizing objective),FailedSimLogs/,A single bad parameter set should not abort an entire multi-hour fit.