Skip to content

Commit c616413

Browse files
committed
Improve docstrings and wordings
1 parent e513875 commit c616413

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

baybe/constraints/continuous.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ class ContinuousLinearConstraint(ContinuousConstraint):
5959
6060
While intrapoint constraints impose conditions on each individual point of a batch,
6161
interpoint constraints do so **across** the points of the batch. That is, an
62-
interpoint constraint of the form ``x_1 + x_2 <= 1`` enforces that the sum of all
63-
``x_1`` values plus the sum of all ``x_2`` values in the batch must not exceed 1.
62+
interpoint constraint of the form ``x + y <= 1`` technically encodes
63+
``sum(x_i) + sum(y_i) <= 1`` for all points ``i`` in the batch.
6464
"""
6565

6666
@coefficients.validator

docs/userguide/constraints.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,12 @@ A more detailed example can be found
8787
The constraints discussed in the previous paragraph belong to the class of so called
8888
"intrapoint constraints". That is, they impose conditions on each individual point of a batch.
8989
In contrast to this, interpoint constraints do so **across** the points of the batch.
90-
That is, an interpoint constraint of the form ``x_1 + x_2 <= 1`` enforces that the sum of all
91-
``x_1`` values plus the sum of all ``x_2`` values in the batch must not exceed 1.
90+
That is, an interpoint constraint of the form ``x + y <= 1`` technically encodes
91+
$$
92+
\sum_{i\text{ in batch}}x_i + \sum_{i\text{ in batch}}y_i <= 1
93+
$$
9294
A possible relevant constraint might be that only 100ml of a given solvent are available for
93-
a full batch, but there is no limit for the amount of solvent to use for a single experiment
94-
within that batch.
95+
a full batch.
9596

9697
They can be defined by using the `interpoint` keyword of the [`ContinuousLinearConstraint`](baybe.constraints.continuous.ContinuousLinearConstraint)
9798
class.

examples/Constraints_Continuous/interpoint.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@
33
# Example for optimizing a synthetic test functions in a continuous space with linear
44
# interpoint constraints.
55
# While intrapoint constraints impose conditions on each individual point of a batch,
6-
# interpoint constraints do so **across** the points of the batch. That is, an
7-
# interpoint constraint of the form ``x_1 + x_2 <= 1`` enforces that the sum of all
8-
# ``x_1`` values plus the sum of all ``x_2`` values in the batch must not exceed 1.
9-
# A possible relevant constraint might be that only 100ml of a given solvent are available for
10-
# a full batch, but there is no limit for the amount of solvent to use for a single experiment
11-
# within that batch.
6+
# interpoint constraints do so **across** the points of the batch.
127

138
# This example is a variant of the example for linear constraints, and we thus refer
149
# to [`linear_constraints`](./linear_constraints.md) for more details and explanations.

0 commit comments

Comments
 (0)