Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
host-os: ["ubuntu-latest"]
python-version: ["py310-cpu", "py311-cpu", "py312-cpu", "py313-cpu"]
python-version: ["py311-cpu", "py312-cpu", "py313-cpu"]
fail-fast: false

defaults:
Expand Down
28 changes: 28 additions & 0 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,34 @@ To install the package using the ``conda`` package manager, run the following co
:start-after: .. snippet-conda-standard-start
:end-before: .. snippet-conda-standard-end

Optional Extras
^^^^^^^^^^^^^^^

``blop`` is modular — install only what you need by appending one or more extras:

.. list-table::
:header-rows: 1
:widths: auto

* - Extra
- Installs
- Notes
* - ``blop[ax]``
- ``ax-platform``, ``botorch``, ``gpytorch``, ``torch``
- GPU torch by default; pair with ``[cpu]`` for CPU-only
* - ``blop[queueserver]``
- ``bluesky-queueserver-api``
- Transport layer only; pair with ``[ax]`` for ``QueueserverAgent``
* - ``blop[cpu]``
- *(uv index routing)*
- Routes ``torch`` to the CPU-only PyTorch index; requires ``uv``
* - ``blop[all]``
- All backends + ``[queueserver]``
- No dev tooling; will grow as new backends are added
* - ``blop[dev]``
- ``blop[all]`` + dev tooling
- For contributors

PyTorch Acceleration Options
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
2 changes: 1 addition & 1 deletion docs/source/reference/agent.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Agent
:show-inheritance:
:inherited-members:

.. autoclass:: blop.ax.QueueserverAgent
.. autoclass:: blop.ax.queueserver_agent.QueueserverAgent
:members:
:undoc-members:
:show-inheritance:
Expand Down
3 changes: 2 additions & 1 deletion docs/source/tutorials/queueserver.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ tiled_client = from_uri("http://localhost:8000", api_key="tutorialkey")
Just as in the simple experiment tutorial, we define **DOFs** and **objectives**. The key difference: since devices exist only in the remote queueserver environment, DOFs reference device names as strings (no `actuator` objects).

```{code-cell} ipython3
from blop.ax import QueueserverAgent, RangeDOF, Objective
from blop.ax import RangeDOF, Objective
from blop.ax.queueserver_agent import QueueserverAgent

dofs = [
RangeDOF(actuator="motor1", bounds=(-5.0, 5.0), parameter_type="float"),
Expand Down
2 changes: 1 addition & 1 deletion docs/wip/qserver-experiment.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ The EvaluationFunction is called every time a stop document is recieved. It must
from blop.protocols import EvaluationFunction
from tiled.client.container import Container
from tiled.queries import Eq
from blop.ax import QueueserverAgent
from blop.ax.queueserver_agent import QueueserverAgent
from bluesky.callbacks.zmq import RemoteDispatcher
import numpy as np

Expand Down
15 changes: 3 additions & 12 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ authors = [
channels = ["conda-forge"]
name = "blop"
platforms = ["linux-64", "osx-arm64"]
version = "0.9.0"
version = "1.0.0b1"

[dependencies]
python = ">=3.10.0,<3.14"
python = ">=3.11.0,<3.14"

[feature.dev.dependencies]

Expand All @@ -32,7 +32,6 @@ tests = "pytest src/blop/tests"
graphviz = ">=14.1.2,<15"

[feature.docs.pypi-dependencies]
blop = { path = ".", editable = true, extras = ["cpu"] }
blop-sim = { path = "sim", editable = true }
numpydoc = "*"
sphinx-copybutton = "*"
Expand All @@ -46,9 +45,6 @@ bluesky-tiled-plugins = "*"
ophyd-async = "*"
opencv-python = "*"

[feature.py310.dependencies]
python = "3.10.*"

[feature.py311.dependencies]
python = "3.11.*"

Expand All @@ -58,10 +54,6 @@ python = "3.12.*"
[feature.py313.dependencies]
python = "3.13.*"

[feature.dev.tasks]
check = "pre-commit run --all-files"
tests = "pytest src/blop/tests"

[feature.docs.tasks]
start-queueserver = "docker compose -f docs/source/tutorials/queueserver/docker-compose.yml up -d --build --wait"
stop-queueserver = "docker compose -f docs/source/tutorials/queueserver/docker-compose.yml down"
Expand All @@ -77,8 +69,7 @@ convert-tutorials-to-ipynb = "jupytext --to notebook docs/source/tutorials/*.md"
[environments]
dev = ["dev"]
dev-cpu = ["dev-cpu"]
docs = ["docs"]
py310-cpu = ["dev-cpu", "py310"]
docs = ["dev-cpu", "docs"]
py311-cpu = ["dev-cpu", "py311"]
py312-cpu = ["dev-cpu", "py312"]
py313-cpu = ["dev-cpu", "py313"]
22 changes: 6 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,8 @@ maintainers = [
{ name = "Jennefer Maldonado", email = "jmaldonad@bnl.gov" },
{ name = "Roman Chernikov", email = "rcherniko@bnl.gov" },
]
requires-python = ">=3.10"
dependencies = [
"ax-platform>=1.1.0,<1.3",
"bluesky>=1.14.2",
"bluesky-queueserver-api>=0.0.12",
"torch",
"botorch>=0.16.0",
"gpytorch",
"scipy",
"networkx>=3",
"numpy",
"rich>=13",
]
requires-python = ">=3.11"
dependencies = ["bluesky>=1.14.2", "networkx>=3", "numpy", "rich>=13"]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: BSD License",
Expand All @@ -45,18 +34,19 @@ classifiers = [
dynamic = ["version"]

[project.optional-dependencies]
qs = ["bluesky-queueserver-api"]
ax = ["ax-platform>=1.3.0,<1.4", "botorch>=0.18.0,<0.19.0", "gpytorch", "torch"]
queueserver = ["bluesky-queueserver-api"]
all = ["blop[ax,queueserver]"]
dev = [
"pytest",
"pytest-cov",
"ipykernel",
"ruff",
"nbstripout",
"pre-commit",
"pandas-stubs",
"coverage",
"pyright",
"blop[qs]",
"blop[all]",
]
cpu = [
# Empty extra - the source configuration below routes to CPU-only index
Expand Down
4 changes: 2 additions & 2 deletions sim/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ version = "0.0.0"
description = "Example simulations and benchmarks for blop (not published to PyPI)"
readme = "README.md"
authors = [{ name = "Thomas Hopkins", email = "thopkins1@bnl.gov" }]
requires-python = ">=3.10"
requires-python = ">=3.11"
dependencies = [
"blop",
"ophyd-async",
"ophyd-async<0.17",
"h5py",
"area-detector-handlers",
"bluesky-tiled-plugins",
Expand Down
9 changes: 0 additions & 9 deletions src/blop/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from .ax import DOF, Agent, ChoiceDOF, DOFConstraint, Objective, OutcomeConstraint, RangeDOF, ScalarizedObjective
from .plans import acquire_baseline, default_acquire, optimize, optimize_step, sample_suggestions

try:
Expand All @@ -8,14 +7,6 @@

__all__ = [
"__version__",
"Agent",
"ChoiceDOF",
"DOF",
"DOFConstraint",
"Objective",
"OutcomeConstraint",
"RangeDOF",
"ScalarizedObjective",
"acquire_baseline",
"default_acquire",
"optimize",
Expand Down
15 changes: 7 additions & 8 deletions src/blop/ax/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from ..queueserver import OptimizationResult
from .agent import Agent as Agent
from .agent import QueueserverAgent as QueueserverAgent
from .dof import DOF, ChoiceDOF, DOFConstraint, RangeDOF
from .objective import Objective, OutcomeConstraint, ScalarizedObjective, to_ax_objective_str
from .optimizer import AxOptimizer
try:
from .agent import Agent as Agent
from .dof import DOF, ChoiceDOF, DOFConstraint, RangeDOF
from .objective import Objective, OutcomeConstraint, ScalarizedObjective, to_ax_objective_str
from .optimizer import AxOptimizer
except ImportError as e:
raise ImportError("The ax integration requires additional dependencies. Install them with: pip install blop[ax]") from e

__all__ = [
"Agent",
"QueueserverAgent",
"DOF",
"RangeDOF",
"ChoiceDOF",
Expand All @@ -17,5 +17,4 @@
"ScalarizedObjective",
"to_ax_objective_str",
"AxOptimizer",
"OptimizationResult",
]
Loading
Loading