Compatibility break with bayesian-optimization > 1.5.1
@peanutfun arbeitet bereits daran.
Seit 16.5.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Description
Integration tests are failing due to an ImportError in climada/util/calibrate/bayesian_optimizer.py. The bayesian-optimization package removed UtilityFunction from its top-level namespace in versions following 1.5.1.
Further down the road, Events class (also imported in integration tests) is removed after 2.0.4
Error Traceback
Traceback:
climada/test/test_util_calibrate.py:31: in <module>
from climada.util.calibrate import (
climada/util/calibrate/__init__.py:22: in <module>
from .bayesian_optimizer import (
climada/util/calibrate/bayesian_optimizer.py:36: in <module>
from bayes_opt import BayesianOptimization, Events, ScreenLogger, UtilityFunction
E ImportError: cannot import name 'UtilityFunction' from 'bayes_opt'
Root Cause
Versions of bayesian-optimization > 1.5.1 introduced breaking API changes:
UtilityFunction: Removed/Refactored (https://github.com/bayesian-optimization/BayesianOptimization/pull/447)
Futur problem
Versions of bayesian-optimization > 2.0.4 introduced other breaking API changes:
Events: Removed or refactored. (https://github.com/bayesian-optimization/BayesianOptimization/pull/557)
Proposed Fix
- Immediate: Pin the dependency in the environment/requirements:
bayesian-optimization <= 1.5.1
- Long-term: Refactor
bayesian_optimizer.pyto support the updated API.
Quick Fix for Devs
To resolve this locally and run tests:
mamba install "bayesian-optimization<=1.5.1"
- Vorherrschende Sprache
- Jupyter Notebook
- Sterne
- 478
- Forks
- 166
- Ø Merge
- 1 T. 20 Std.
- Gemergte PRs (30 T.)
- 2
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus CLIMADA-project/climada_python
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
CLIMADA-project/climada_python#1337 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
CLIMADA-project/climada_python#1336 ·
-
CartoDB basemaps now need an API key (somewhat urgent)Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
CLIMADA-project/climada_python#1332 · 4 Kommentare · 1 Reaktion ·
-
warnings
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
CLIMADA-project/climada_python#1241 ·
-
ResourceWarningOffenwarnings
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
CLIMADA-project/climada_python#1239 ·