in ax/benchmark/benchmark_problem.py [0:0]
def __eq__(self, other: "BenchmarkProblem") -> bool:
for field in self.__dict__.keys():
self_val = getattr(self, field)
other_val = getattr(other, field)
if field == "f" and (
( # For synthetic functions, they are same if same class.
self.uses_synthetic_function
and self_val.__class__ is other_val.__class__
)
or ( # For custom callables, considered same if same name.
not self.uses_synthetic_function
and self_val.__name__ is other_val.__name__
)
):
continue
if self_val != other_val:
return False
return True