@@ -831,8 +831,8 @@ def push(self, task: ExplorationTask) -> bool:
831831
832832 task .priority = self .compute_priority (task )
833833
834- self ._task_counter += 1
835834 task_id = self ._task_counter
835+ self ._task_counter += 1
836836 self ._tasks [task_id ] = task
837837
838838 heapq .heappush (self ._heap , (- task .priority , self ._push_counter , task_id ))
@@ -1987,6 +1987,15 @@ def _validate_mapper_settings(cls, config: dict) -> None:
19871987 f"from 'mapper_settings'."
19881988 )
19891989 val = ms [key ]
1990+ # bool is a subclass of int in Python, so isinstance(True, int) is True.
1991+ # Reject booleans explicitly to prevent silent mis-configuration such as
1992+ # temperature_K: true (= 1 K) or max_iterations: false (= 0).
1993+ if isinstance (val , bool ):
1994+ raise ValueError (
1995+ f"Config validation failed: 'mapper_settings.{ key } ' must be "
1996+ f"{ expected_type } but got bool ({ val !r} ). "
1997+ f"Boolean values are not accepted for numeric fields."
1998+ )
19901999 if not isinstance (val , expected_type ):
19912000 raise ValueError (
19922001 f"Config validation failed: 'mapper_settings.{ key } ' must be "
@@ -2031,7 +2040,8 @@ def _validate_mapper_settings(cls, config: dict) -> None:
20312040 # ── n_parallel: int >= 1 ──────────────────────────────────────────
20322041 if "n_parallel" in ms :
20332042 np_val = ms ["n_parallel" ]
2034- if not isinstance (np_val , int ) or np_val < 1 :
2043+ # bool is a subclass of int — reject it explicitly (same reason as above).
2044+ if isinstance (np_val , bool ) or not isinstance (np_val , int ) or np_val < 1 :
20352045 raise ValueError (
20362046 f"Config validation failed: 'mapper_settings.n_parallel' must be "
20372047 f"an integer >= 1 (got { np_val !r} )."
0 commit comments