-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
66 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from .base import BlueskyControllerBase | ||
from .context import BlueskyContext | ||
from .controller import BlueskyController | ||
|
||
__all__ = ["BlueskyControllerBase", "BlueskyController", "BlueskyContext"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from abc import ABC, abstractmethod | ||
from typing import Any, Mapping | ||
|
||
from blueapi.core import Ability, Plan | ||
|
||
|
||
class BlueskyControllerBase(ABC): | ||
""" | ||
Object to control Bluesky, bridge between API and worker | ||
""" | ||
|
||
@abstractmethod | ||
async def run_workers(self) -> None: | ||
... | ||
|
||
@abstractmethod | ||
async def run_plan(self, __name: str, __params: Mapping[str, Any]) -> None: | ||
""" | ||
Run a named plan with parameters | ||
Args: | ||
__name (str): The name of the plan to run | ||
__params (Mapping[str, Any]): The parameters for the plan in | ||
deserialized form | ||
""" | ||
|
||
... | ||
|
||
@property | ||
@abstractmethod | ||
def plans(self) -> Mapping[str, Plan]: | ||
""" | ||
Get a all plans that can be run | ||
Returns: | ||
Mapping[str, Plan]: Mapping of plans for quick lookup by name | ||
""" | ||
|
||
... | ||
|
||
@property | ||
@abstractmethod | ||
def abilities(self) -> Mapping[str, Ability]: | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
from .bluesky_types import BLUESKY_PROTOCOLS, Ability, Plan, PlanGenerator | ||
from .context import Ability, AbilityRegistry, BlueskyContext | ||
from .controller import BlueskyController, BlueskyControllerBase | ||
from .device_lookup import create_bluesky_protocol_conversions | ||
from .event import EventStream, EventStreamBase | ||
from .schema import nested_deserialize_with_overrides, schema_for_func | ||
|
||
__all__ = [ | ||
"Plan", | ||
"PlanGenerator", | ||
"BlueskyControllerBase", | ||
"BlueskyController", | ||
"BlueskyContext", | ||
"AbilityRegistry", | ||
"Ability", | ||
"BLUESKY_PROTOCOLS", | ||
"EventStreamBase", | ||
"EventStream", | ||
"schema_for_func", | ||
"nested_deserialize_with_overrides", | ||
"create_bluesky_protocol_conversions", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters