fix: Hyperopt-magic - allow parent classes within the same file

This commit is contained in:
Matthias
2025-02-09 19:48:26 +01:00
parent b9c77124fc
commit a8ae767576

View File

@@ -122,7 +122,8 @@ class HyperOptimizer:
"""
for modules in bases:
if modules.__name__ != "IStrategy":
cloudpickle.register_pickle_by_value(sys.modules[modules.__module__])
if mod := sys.modules.get(modules.__module__):
cloudpickle.register_pickle_by_value(mod)
self.hyperopt_pickle_magic(modules.__bases__)
def _get_params_dict(