Skip to content
Open
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
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ classifiers = [
]
description = "Lightweight bluesky-as-a-service wrapper application. Also usable as a library."
dependencies = [
"bluesky[plotting]>=1.14.0", # plotting includes matplotlib, required for BestEffortCallback in run plans
"bluesky[plotting]>=1.16.0", # plotting includes matplotlib, required for BestEffortCallback in run plans
"ophyd-async>=0.13.5",
"pydantic>=2.0",
"pydantic-settings",
Expand Down Expand Up @@ -47,6 +47,7 @@ server = [
"graypy>=2.1.0",
"aioca",
"tiled[client]==0.2.18",
"bluesky-tiled-plugins", # TiledWriter moved here from bluesky in 1.16
"httpx>=0.28.1", # used by service/numtracker.py and service/authentication.py's TiledAuth
]

Expand Down
2 changes: 1 addition & 1 deletion src/blueapi/core/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def find_device(self, addr: str | list[str]) -> Device | None:

def with_config(self, config: EnvironmentConfig) -> None:
if config.metadata is not None:
self.run_engine.md |= config.metadata.model_dump()
self.run_engine.md.update(config.metadata.model_dump())

package_map = metadata.packages_distributions()
packages = {src.module.split(".")[0] for src in config.sources}
Expand Down
6 changes: 3 additions & 3 deletions src/blueapi/service/interface.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import json
import logging
from collections.abc import Mapping
from collections.abc import Mapping, MutableMapping
from dataclasses import dataclass
from functools import cache
from multiprocessing.connection import Connection
from typing import Any

from bluesky.callbacks.tiled_writer import TiledWriter
from bluesky_stomp.messaging import StompClient
from bluesky_stomp.models import Broker, DestinationBase, MessageTopic
from bluesky_tiled_plugins import TiledWriter
from fastapi import status
from tiled.client import from_uri
from tiled.client.utils import ClientError
Expand Down Expand Up @@ -63,7 +63,7 @@ def context() -> BlueskyContext:
ctx = BlueskyContext(config())
if (nt_conf := config().numtracker) is not None and (nt := numtracker()):

async def _update_scan_num(md: dict[str, Any]) -> int:
async def _update_scan_num(md: MutableMapping[str, Any]) -> int:
scan = await nt.create_scan(md["instrument_session"], md["instrument"])
md["data_session_directory"] = str(scan.scan.directory.path)
md["detector_file_template"] = nt_conf.detector_file_template
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/core/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ class ConcreteStoppable(Stoppable):
def name(self) -> str:
return "Concrete"

def stop(self, success: bool = True):
def stop(self, *, success: bool = True):
pass


Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/service/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def test_get_plan(context_mock: MagicMock):
class MyDevice(Stoppable):
name: str

def stop(self, success: bool = True) -> None:
def stop(self, *, success: bool = True) -> None:
pass


Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/service/test_rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def pytest_generate_tests(metafunc: pytest.Metafunc):
class MinimalDevice(Stoppable):
name: str

def stop(self, success: bool = True):
def stop(self, *, success: bool = True):
pass


Expand Down
60 changes: 56 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.