Skip to content

Add experimental binning endpoints#20

Open
hyperrealist wants to merge 1 commit intobluesky:mainfrom
hyperrealist:scanspec-endpoint
Open

Add experimental binning endpoints#20
hyperrealist wants to merge 1 commit intobluesky:mainfrom
hyperrealist:scanspec-endpoint

Conversation

@hyperrealist
Copy link

This PR implements two experimental endpoints that can plug into Tiled if configured at deployment.

from typing import Any, Optional, List
from collections.abc import Callable
from fastapi import Request, Depends, Query, Security
from scanspec import specs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be added as a dependency?

try:
with record_timing(request.state.metrics, "read"):
data = await ensure_awaitable(entry.read)
if structure_family == StructureFamily.array:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if it's not?

@hyperrealist
Copy link
Author

To test, add the following to config.yaml:

routers:
  - bluesky_tiled_plugins.routers:router

and new endpoints should be accessible using something like

c.context.http_client.get("<host:port>/api/v1/binned/<path>")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants