diff --git a/src/poli/core/util/isolation/instancing.py b/src/poli/core/util/isolation/instancing.py index 3d312816..89015f04 100644 --- a/src/poli/core/util/isolation/instancing.py +++ b/src/poli/core/util/isolation/instancing.py @@ -3,6 +3,7 @@ import configparser import importlib import logging +import shutil import subprocess from pathlib import Path @@ -307,6 +308,16 @@ def instance_function_as_isolated_process( quiet: bool = False, **kwargs_for_black_box, ) -> ExternalFunction: + # Check if the user has conda installed + if shutil.which("conda") is None: + raise RuntimeError( + "Conda is not installed. For poli's isolation mechanisms to work, " + "we need conda to be installed.\n" + "If you are not interested in using conda, you can install all the " + "relevant dependencies for black boxes using pip and optional arguments.\n" + "Check the documentation of the black box you are interested in for more information." + ) + # Register the problem if it hasn't been registered. register_isolated_function(name=name, quiet=quiet) diff --git a/src/poli/objective_repository/ehrlich/register.py b/src/poli/objective_repository/ehrlich/register.py index 48cd689d..8f7d9614 100644 --- a/src/poli/objective_repository/ehrlich/register.py +++ b/src/poli/objective_repository/ehrlich/register.py @@ -25,6 +25,8 @@ from __future__ import annotations +import warnings + import numpy as np from poli.core.abstract_black_box import AbstractBlackBox @@ -106,6 +108,12 @@ def __init__( num_workers: int = None, evaluation_budget: int = float("inf"), ): + warnings.warn( + "The EhrlichBlackBox class is deprecated and will be removed in a future version. " + " Please use EhrlichHoloBlackBox after installing with pip install poli[ehrlich].", + DeprecationWarning, + ) + super().__init__(batch_size, parallelize, num_workers, evaluation_budget) self.alphabet = alphabet self.sequence_length = sequence_length @@ -434,6 +442,11 @@ def create( Closed-Form Test Functions for Biophysical Sequence Optimization Algorithms. arXiv preprint arXiv:2407.00236. https://arxiv.org/abs/2407.00236 """ + warnings.warn( + "The EhrlichProblemFactory class is deprecated and will be removed in a future version. " + " Please use EhrlichHoloProblemFactory after installing with pip install poli[ehrlich].", + DeprecationWarning, + ) if seed is not None: seed_python_numpy_and_torch(seed)