Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Rose Yemelyanova committed Oct 3, 2023
1 parent 340d0f3 commit 7f1278b
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 119 deletions.
18 changes: 18 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,22 @@
},
"esbonio.server.enabled": true,
"esbonio.sphinx.confDir": "",
"cloudcode.kubeconfigs": [
{
"name": "/home/rose/.kube/config_k8s-p38",
"configPath": "/home/rose/.kube/config_k8s-p38"
},
],
"cloudcode.active-kubeconfig": "/home/rose/.kube/config_k8s-p38",
"cloudcode.apigee.dockerOptions": {
"environmentVariables": {
"XTERM": "xterm-256color"
},
"dns": "8.8.8.8",
"detached": true,
"privileged": true,
"labels": {},
"volumes": {},
"additionalArguments": ""
},
}
5 changes: 0 additions & 5 deletions src/blueapi/core/bluesky_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,3 @@ def watch(self, __func: Callable) -> None:
"""

...


@runtime_checkable
class HasComponents(Protocol):
component_names: List[str]
17 changes: 0 additions & 17 deletions src/blueapi/core/device_walk.py

This file was deleted.

76 changes: 0 additions & 76 deletions src/blueapi/plugins/data_writing_server.py

This file was deleted.

Empty file.
42 changes: 21 additions & 21 deletions tests/plugins/test_data_writing.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from blueapi.core import DataEvent, MsgGenerator
from blueapi.plugins.data_writing import (
DATA_COLLECTION_NUMBER,
DATA_SESSION,
DataCollectionProvider,
InMemoryDataCollectionProvider,
data_writing_wrapper,
Expand Down Expand Up @@ -79,15 +79,15 @@ def stageless_count() -> MsgGenerator:
return (yield from bps.one_shot(detectors))

def inner_plan() -> MsgGenerator:
yield from run_wrapper(stageless_count(), md={DATA_COLLECTION_NUMBER: 1})
yield from run_wrapper(stageless_count(), md={DATA_COLLECTION_NUMBER: 1})
yield from run_wrapper(stageless_count(), md={DATA_COLLECTION_NUMBER: 2})
yield from run_wrapper(stageless_count(), md={DATA_COLLECTION_NUMBER: 2})
yield from run_wrapper(stageless_count(), md={DATA_SESSION: 1})
yield from run_wrapper(stageless_count(), md={DATA_SESSION: 1})
yield from run_wrapper(stageless_count(), md={DATA_SESSION: 2})
yield from run_wrapper(stageless_count(), md={DATA_SESSION: 2})

yield from stage_wrapper(inner_plan(), detectors)


@run_decorator(md={DATA_COLLECTION_NUMBER: 12345})
@run_decorator(md={DATA_SESSION: 12345})
@set_run_key_decorator("outer")
def nested_run_with_metadata(detectors: List[FakeFileWritingDetector]) -> MsgGenerator:
yield from set_run_key_wrapper(bp.count(detectors), "inner")
Expand All @@ -114,7 +114,7 @@ def test_simple_run_gets_scan_number(
provider,
)
assert docs[0].name == "start"
assert docs[0].doc[DATA_COLLECTION_NUMBER] == 0
assert docs[0].doc[DATA_SESSION] == 0
assert_all_detectors_used_collection_numbers(docs, detectors, [0])


Expand All @@ -132,8 +132,8 @@ def test_multi_run_gets_scan_numbers(
)
start_docs = find_start_docs(docs)
assert len(start_docs) == 2
assert start_docs[0].doc[DATA_COLLECTION_NUMBER] == 0
assert start_docs[1].doc[DATA_COLLECTION_NUMBER] == 1
assert start_docs[0].doc[DATA_SESSION] == 0
assert start_docs[1].doc[DATA_SESSION] == 1
assert_all_detectors_used_collection_numbers(docs, detectors, [0, 1])


Expand All @@ -149,8 +149,8 @@ def test_multi_run_single_stage(
)
start_docs = find_start_docs(docs)
assert len(start_docs) == 2
assert start_docs[0].doc[DATA_COLLECTION_NUMBER] == 0
assert start_docs[1].doc[DATA_COLLECTION_NUMBER] == 0
assert start_docs[0].doc[DATA_SESSION] == 0
assert start_docs[1].doc[DATA_SESSION] == 0
assert_all_detectors_used_collection_numbers(docs, detectors, [0, 0])


Expand All @@ -166,10 +166,10 @@ def test_multi_run_single_stage_multi_group(
)
start_docs = find_start_docs(docs)
assert len(start_docs) == 4
assert start_docs[0].doc[DATA_COLLECTION_NUMBER] == 0
assert start_docs[1].doc[DATA_COLLECTION_NUMBER] == 0
assert start_docs[2].doc[DATA_COLLECTION_NUMBER] == 0
assert start_docs[3].doc[DATA_COLLECTION_NUMBER] == 0
assert start_docs[0].doc[DATA_SESSION] == 0
assert start_docs[1].doc[DATA_SESSION] == 0
assert start_docs[2].doc[DATA_SESSION] == 0
assert start_docs[3].doc[DATA_SESSION] == 0
assert_all_detectors_used_collection_numbers(docs, detectors, [0, 0, 0, 0])


Expand All @@ -185,9 +185,9 @@ def test_nested_run_with_metadata(
)
start_docs = find_start_docs(docs)
assert len(start_docs) == 3
assert start_docs[0].doc[DATA_COLLECTION_NUMBER] == 0
assert start_docs[1].doc[DATA_COLLECTION_NUMBER] == 1
assert start_docs[2].doc[DATA_COLLECTION_NUMBER] == 2
assert start_docs[0].doc[DATA_SESSION] == 0
assert start_docs[1].doc[DATA_SESSION] == 1
assert start_docs[2].doc[DATA_SESSION] == 2
assert_all_detectors_used_collection_numbers(docs, detectors, [1, 2])


Expand All @@ -203,9 +203,9 @@ def test_nested_run_without_metadata(
)
start_docs = find_start_docs(docs)
assert len(start_docs) == 3
assert start_docs[0].doc[DATA_COLLECTION_NUMBER] == 0
assert start_docs[1].doc[DATA_COLLECTION_NUMBER] == 1
assert start_docs[2].doc[DATA_COLLECTION_NUMBER] == 2
assert start_docs[0].doc[DATA_SESSION] == 0
assert start_docs[1].doc[DATA_SESSION] == 1
assert start_docs[2].doc[DATA_SESSION] == 2
assert_all_detectors_used_collection_numbers(docs, detectors, [1, 2])


Expand Down

0 comments on commit 7f1278b

Please sign in to comment.