Skip to content

Commit 802fc4b

Browse files
committed
Docstring and API docs udpates
1 parent 8ebac37 commit 802fc4b

5 files changed

Lines changed: 25 additions & 1 deletion

File tree

docs/source/reference/plans.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ Plans
66
.. autofunction:: blop.plans.optimize_step
77

88
.. autofunction:: blop.plans.default_acquire
9+
10+
.. autofunction:: blop.plans.acquire_baseline
11+
12+
.. autofunction:: blop.plans.sample_suggestions

src/blop/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .ax import Agent, ChoiceDOF, DOFConstraint, Objective, OutcomeConstraint, RangeDOF, ScalarizedObjective
1+
from .ax import DOF, Agent, ChoiceDOF, DOFConstraint, Objective, OutcomeConstraint, RangeDOF, ScalarizedObjective
22
from .plans import acquire_baseline, default_acquire, optimize, optimize_step, sample_suggestions
33

44
try:
@@ -10,6 +10,7 @@
1010
"__version__",
1111
"Agent",
1212
"ChoiceDOF",
13+
"DOF",
1314
"DOFConstraint",
1415
"Objective",
1516
"OutcomeConstraint",

src/blop/ax/agent.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,18 +357,22 @@ def unsubscribe(self, callback: CallbackBase) -> None:
357357

358358
@property
359359
def sensors(self) -> Sequence[Sensor]:
360+
"""The sensors used for data acquisition."""
360361
return self._sensors
361362

362363
@property
363364
def actuators(self) -> Sequence[Actuator]:
365+
"""The actuators that control the degrees of freedom."""
364366
return self._actuators
365367

366368
@property
367369
def evaluation_function(self) -> EvaluationFunction:
370+
"""The function used to evaluate acquired data and produce outcomes."""
368371
return self._evaluation_function
369372

370373
@property
371374
def acquisition_plan(self) -> AcquisitionPlan | None:
375+
"""The acquisition plan for acquiring data, or ``None`` if using the default."""
372376
return self._acquisition_plan
373377

374378
def to_optimization_problem(self) -> OptimizationProblem:

src/blop/ax/optimizer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,17 @@ def from_checkpoint(cls, checkpoint_path: str) -> "AxOptimizer":
8787

8888
@property
8989
def checkpoint_path(self) -> str | None:
90+
"""The file path for saving and restoring optimizer state, or ``None`` if disabled."""
9091
return self._checkpoint_path
9192

9293
@property
9394
def ax_client(self) -> Client:
95+
"""The underlying Ax ``Client`` used for experiment management."""
9496
return self._client
9597

9698
@property
9799
def fixed_parameters(self) -> dict[str, Any] | None:
100+
"""Parameters held fixed during optimization, or ``None`` if all parameters are free."""
98101
return self._fixed_parameters
99102

100103
@fixed_parameters.setter

src/blop/protocols.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,18 @@ def __call__(
254254

255255
@dataclass(frozen=True)
256256
class BaseOptimizationProblem(Generic[TActuator, TSensor, TPlan]):
257+
"""Base class for optimization problem definitions.
258+
259+
Provides the common structure shared by all optimization problem types.
260+
Users should use the concrete subclasses :class:`OptimizationProblem` or
261+
:class:`QueueserverOptimizationProblem` instead of this class directly.
262+
263+
See Also
264+
--------
265+
OptimizationProblem : Concrete problem type for standard usage.
266+
QueueserverOptimizationProblem : Concrete problem type for queue server usage.
267+
"""
268+
257269
optimizer: Optimizer
258270
actuators: Sequence[TActuator]
259271
sensors: Sequence[TSensor]

0 commit comments

Comments
 (0)