diff --git a/.lockfiles/py310-dev.lock b/.lockfiles/py310-dev.lock index fc821f7613..d0da179b99 100644 --- a/.lockfiles/py310-dev.lock +++ b/.lockfiles/py310-dev.lock @@ -111,8 +111,6 @@ cyclonedx-python-lib==7.5.1 # via pip-audit dask==2024.7.1 # via xyzpy -datasketch==1.6.5 - # via scikit-fingerprints debugpy==1.8.2 # via ipykernel decorator==5.1.1 @@ -374,7 +372,7 @@ markupsafe==2.1.5 # via # jinja2 # nbconvert -matplotlib==3.9.1 +matplotlib==3.10.0 # via # baybe (pyproject.toml) # lifelines @@ -456,7 +454,6 @@ numpy==1.26.4 # autograd # botorch # contourpy - # datasketch # descriptastorus # e3fp # formulaic @@ -805,7 +802,7 @@ ruff==0.5.2 # via baybe (pyproject.toml) s3transfer==0.10.4 # via boto3 -scikit-fingerprints==1.9.0 +scikit-fingerprints==1.13.1 # via baybe (pyproject.toml) scikit-image==0.25.0 # via lime @@ -826,7 +823,6 @@ scipy==1.14.0 # baybe (pyproject.toml) # autograd-gamma # botorch - # datasketch # descriptastorus # e3fp # formulaic diff --git a/CHANGELOG.md b/CHANGELOG.md index 71299a338c..e1f61da8f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] +### Added +- `BCUT2D` encoding for `SubstanceParameter` + ## [0.12.2] - 2025-01-31 ### Changed - More robust settings for the GP fitting diff --git a/baybe/constraints/continuous.py b/baybe/constraints/continuous.py index d5d5be47e7..91fa4c17e7 100644 --- a/baybe/constraints/continuous.py +++ b/baybe/constraints/continuous.py @@ -103,7 +103,7 @@ def to_botorch( """Cast the constraint in a format required by botorch. Used in calling ``optimize_acqf_*`` functions, for details see - https://botorch.org/api/optim.html#botorch.optim.optimize.optimize_acqf + :func:`botorch.optim.optimize.optimize_acqf` Args: parameters: The parameter objects of the continuous space. diff --git a/baybe/parameters/enum.py b/baybe/parameters/enum.py index 79a4e8df61..5f0bbe1c19 100644 --- a/baybe/parameters/enum.py +++ b/baybe/parameters/enum.py @@ -39,6 +39,9 @@ class SubstanceEncoding(ParameterEncoding): AVALON = "AVALON" """:class:`skfp.fingerprints.AvalonFingerprint`""" + BCUT2D = "BCUT2D" + """:class:`skfp.fingerprints.BCUT2DFingerprint`""" + E3FP = "E3FP" """:class:`skfp.fingerprints.E3FPFingerprint`""" diff --git a/baybe/utils/chemistry.py b/baybe/utils/chemistry.py index 6e42bcd9c1..41fdca02b6 100644 --- a/baybe/utils/chemistry.py +++ b/baybe/utils/chemistry.py @@ -152,7 +152,7 @@ def smiles_to_fingerprint_features( feature_names_out = fingerprint_encoder.get_feature_names_out() no_descriptor_names = all("fingerprint" in f for f in feature_names_out) suffixes = [ - f.split("fingerprint")[1] if no_descriptor_names else f + f.split("fingerprint")[1] if no_descriptor_names else f.replace(" ", "_") for f in feature_names_out ] col_names = [prefix + name + suffix for suffix in suffixes] diff --git a/docs/conf.py b/docs/conf.py index 62326b973d..2a7ebcc123 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -247,6 +247,7 @@ # Mappings to all external packages that we want to have clickable links to intersphinx_mapping = { + "botorch": ("https://botorch.readthedocs.io/en/latest", None), "python": ("https://docs.python.org/3", None), "pandas": ("https://pandas.pydata.org/docs/", None), "polars": ("https://docs.pola.rs/api/python/stable/", None), @@ -256,7 +257,7 @@ "numpy": ("https://numpy.org/doc/stable/", None), "torch": ("https://pytorch.org/docs/main/", None), "rdkit": ("https://rdkit.org/docs/", None), - "shap": ("https://shap.readthedocs.io/en/latest/", None), + "shap": ("https://shap.readthedocs.io/en/stable/", None), } # --- Options for autodoc typehints and autodoc ------------------------------- diff --git a/examples/Transfer_Learning/backtesting.py b/examples/Transfer_Learning/backtesting.py index 3d4bca784e..8f1c6d9745 100644 --- a/examples/Transfer_Learning/backtesting.py +++ b/examples/Transfer_Learning/backtesting.py @@ -49,7 +49,7 @@ ### Creating the Search Space -# This example uses the [Hartmann Function](https://botorch.org/api/test_functions.html#botorch.test_functions.synthetic.Hartmann) +# This example uses the [Hartmann Function](botorch.test_functions.synthetic.Hartmann) # as implemented by `botorch`. # The bounds of the search space are dictated by the test function and can be extracted # from the function itself. diff --git a/pyproject.toml b/pyproject.toml index 2a0519d29a..3bf1c36ace 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,7 +68,7 @@ Issues = "https://github.com/emdgroup/baybe/issues/" [project.optional-dependencies] chem = [ - "scikit-fingerprints>=1.7.0", + "scikit-fingerprints>=1.13.1", ] onnx = [ @@ -116,7 +116,7 @@ examples = [ "baybe[chem]", # Required for some of the examples "baybe[onnx]", # Required for some of the examples "baybe[simulation]", # Required for some of the examples - "matplotlib>=3.7.3", + "matplotlib>=3.7.3,!=3.9.1", "openpyxl>=3.0.9", "pillow>=10.0.1", # Necessary due to vulnerability "plotly>=5.10.0", diff --git a/tests/conftest.py b/tests/conftest.py index 8c8c766f3f..b6b789d4b0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -333,7 +333,7 @@ def fixture_parameters( ], *[ SubstanceParameter( - name=f"Substance_1_{encoding}", + name=f"Substance_1_{encoding.name}", data=mock_substances, encoding=encoding, ) diff --git a/tests/test_substance_parameter.py b/tests/test_substance_parameter.py index 2d6fc18b1e..7561321f4b 100644 --- a/tests/test_substance_parameter.py +++ b/tests/test_substance_parameter.py @@ -13,9 +13,11 @@ ) @pytest.mark.parametrize( "parameter_names", - [["Categorical_1", f"Substance_1_{enc}"] for enc in SubstanceEncoding], + [["Categorical_1", f"Substance_1_{enc.name}"] for enc in SubstanceEncoding], ids=[enc.name for enc in SubstanceEncoding], ) +@pytest.mark.parametrize("n_grid_points", [8], ids=["g8"]) +@pytest.mark.parametrize("batch_size", [1], ids=["b3"]) def test_run_iterations(campaign, batch_size, n_iterations): """Test running some iterations with fake results and a substance parameter.""" run_iterations(campaign, n_iterations, batch_size)