Skip to content

Commit

Permalink
add force_isolation flag on create, add docstring (#263)
Browse files Browse the repository at this point in the history
* add force_isolation flag on create, add docstring

* add force_isolation to RFPFoldXStabilityAndSASA

---------
  • Loading branch information
RMichae1 authored Sep 27, 2024
1 parent 784a584 commit ab6fbdf
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/poli/objective_repository/foldx_rfp_lambo/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,35 @@ def create(
parallelize: bool = False,
num_workers: int = None,
evaluation_budget: int = float("inf"),
force_isolation: bool = False,
) -> Problem:
"""
Creates a FoldX-RFP Lambo-specific black box instance, alongside initial
observations.
Parameters
----------
seed : int, optional
The seed value for random number generation, by default None.
batch_size : int, optional
The batch size for parallel evaluation, by default None.
parallelize : bool, optional
Flag indicating whether to parallelize evaluation, by default False.
num_workers : int, optional
The number of workers for parallel evaluation, by default None.
evaluation_budget : int, optional
The evaluation budget, by default float("inf").
force_isolation : bool, optional
Should the problem
Returns
-------
f : RaspBlackBox
The FoldXRFP black box instance.
x0 : np.ndarray
The initial observations.
y0 : np.ndarray
The initial observations (i.e. the stability of the wildtypes).
"""
# TODO: allow for bigger batch_sizes
# For now (and because of the way the black box is implemented)
# we only allow for batch_size=1
Expand All @@ -103,6 +131,7 @@ def create(
num_workers=num_workers,
batch_size=batch_size,
evaluation_budget=evaluation_budget,
force_isolation=force_isolation,
)
x0 = black_box.inner_function.x0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def create(
parallelize: bool = False,
num_workers: int = None,
evaluation_budget: int = float("inf"),
force_isolation: bool = False,
) -> Problem:
"""
Create a RFPFoldXSASABlackBox object and compute the initial values of wildtypes.
Expand Down Expand Up @@ -177,6 +178,7 @@ def create(
parallelize=parallelize,
num_workers=num_workers,
evaluation_budget=evaluation_budget,
force_isolation=force_isolation,
)

# We need to compute the initial values of all wildtypes
Expand Down

0 comments on commit ab6fbdf

Please sign in to comment.