Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move logic pertaining to writing/controlling detectors from i22 branch #24

Merged
merged 40 commits into from
Oct 20, 2023

Conversation

rosesyrett
Copy link
Collaborator

@coretl has a branch, i22, which contains logic that we need merged into main in order to make a directory provider singleton that can be created in dodal and accessed in blueapi.

@rosesyrett rosesyrett requested a review from coretl October 6, 2023 16:42
@rosesyrett rosesyrett marked this pull request as draft October 6, 2023 16:51
Copy link
Collaborator

@coretl coretl left a comment

Choose a reason for hiding this comment

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

I think we have to discuss structuring again, but I think this is a larger discussion than just you and me, so let's get this ready to merge before we do. Thanks for doing this, look good.

src/ophyd_async/core/_detector/detector_control.py Outdated Show resolved Hide resolved
src/ophyd_async/core/_detector/detector_writer.py Outdated Show resolved Hide resolved
src/ophyd_async/core/_detector/standard_detector.py Outdated Show resolved Hide resolved
src/ophyd_async/core/_detector/standard_detector.py Outdated Show resolved Hide resolved
src/ophyd_async/core/providers.py Outdated Show resolved Hide resolved
src/ophyd_async/epics/areadetector/pilatus.py Outdated Show resolved Hide resolved
tests/epics/areadetector/test_hdf_streamer_det.py Outdated Show resolved Hide resolved
src/ophyd_async/core/_detector/standard_detector.py Outdated Show resolved Hide resolved
tests/epics/areadetector/test_hdf_streamer_det.py Outdated Show resolved Hide resolved
tests/epics/areadetector/test_hdf_streamer_det.py Outdated Show resolved Hide resolved
@rosesyrett rosesyrett marked this pull request as ready for review October 12, 2023 16:01
Copy link
Collaborator

@coretl coretl left a comment

Choose a reason for hiding this comment

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

Looks good thanks, just a few points

src/ophyd_async/core/detector.py Outdated Show resolved Hide resolved
src/ophyd_async/core/detector.py Outdated Show resolved Hide resolved
src/ophyd_async/core/sim_signal_backend.py Outdated Show resolved Hide resolved
tests/core/test_flyer.py Outdated Show resolved Hide resolved
@rosesyrett
Copy link
Collaborator Author

getting the following linting errors:

src/ophyd_async/core/detector.py:166: error: Return type "AsyncIterator[tuple[Literal['resource'], Any] | tuple[Literal['datum'], Any] | tuple[Literal['stream_resource'], Any] | tuple[Literal['stream_datum'], Any]]" of "collect_asset_docs" incompatible with return type "Iterator[Iterator[tuple[Literal['resource'], Any] | tuple[Literal['datum'], Any] | tuple[Literal['stream_resource'], Any] | tuple[Literal['stream_datum'], Any]]] | AsyncIterator[Iterator[tuple[Literal['resource'], Any] | tuple[Literal['datum'], Any] | tuple[Literal['stream_resource'], Any] | tuple[Literal['stream_datum'], Any]]]" in supertype "WritesExternalAssets"  [override]
src/ophyd_async/core/detector.py:169: error: "Coroutine[Any, Any, AsyncIterator[tuple[Literal['resource'], Any] | tuple[Literal['datum'], Any] | tuple[Literal['stream_resource'], Any] | tuple[Literal['stream_datum'], Any]]]" has no attribute "__aiter__" (not async iterable)  [attr-defined]
src/ophyd_async/core/detector.py:169: note: Maybe you forgot to use "await"?
src/ophyd_async/core/flyer.py:109: error: Argument 1 to "gather_list" has incompatible type "Awaitable[list[AsyncStatus]]"; expected "Iterable[Awaitable[Any]]"  [arg-type]
src/ophyd_async/core/flyer.py:109: note: Maybe you forgot to use "await"?
src/ophyd_async/core/flyer.py:113: error: Return type "AsyncIterator[tuple[Literal['resource'], Any] | tuple[Literal['datum'], Any] | tuple[Literal['stream_resource'], Any] | tuple[Literal['stream_datum'], Any]]" of "collect_asset_docs" incompatible with return type "Coroutine[Any, Any, AsyncIterator[tuple[Literal['resource'], Any] | tuple[Literal['datum'], Any] | tuple[Literal['stream_resource'], Any] | tuple[Literal['stream_datum'], Any]]]" in supertype "DetectorGroupLogic"  [override]
src/ophyd_async/core/flyer.py:124: error: "Coroutine[Any, Any, AsyncIterator[tuple[Literal['resource'], Any] | tuple[Literal['datum'], Any] | tuple[Literal['stream_resource'], Any] | tuple[Literal['stream_datum'], Any]]]" has no attribute "__aiter__" (not async iterable)  [attr-defined]
src/ophyd_async/core/flyer.py:124: note: Maybe you forgot to use "await"?
src/ophyd_async/core/flyer.py:229: error: Return type "AsyncIterator[tuple[Literal['resource'], Any] | tuple[Literal['datum'], Any] | tuple[Literal['stream_resource'], Any] | tuple[Literal['stream_datum'], Any]]" of "collect_asset_docs" incompatible with return type "Iterator[Iterator[tuple[Literal['resource'], Any] | tuple[Literal['datum'], Any] | tuple[Literal['stream_resource'], Any] | tuple[Literal['stream_datum'], Any]]] | AsyncIterator[Iterator[tuple[Literal['resource'], Any] | tuple[Literal['datum'], Any] | tuple[Literal['stream_resource'], Any] | tuple[Literal['stream_datum'], Any]]]" in supertype "WritesExternalAssets"  [override]
src/ophyd_async/core/flyer.py:231: error: "Coroutine[Any, Any, AsyncIterator[tuple[Literal['resource'], Any] | tuple[Literal['datum'], Any] | tuple[Literal['stream_resource'], Any] | tuple[Literal['stream_datum'], Any]]]" has no attribute "__aiter__" (not async iterable)  [attr-defined]
src/ophyd_async/core/flyer.py:231: note: Maybe you forgot to use "await"?
tests/core/test_flyer.py:94: error: Return type "AsyncIterator[tuple[Literal['resource'], Any] | tuple[Literal['datum'], Any] | tuple[Literal['stream_resource'], Any] | tuple[Literal['stream_datum'], Any]]" of "collect_stream_docs" incompatible with return type "Coroutine[Any, Any, AsyncIterator[tuple[Literal['resource'], Any] | tuple[Literal['datum'], Any] | tuple[Literal['stream_resource'], Any] | tuple[Literal['stream_datum'], Any]]]" in supertype "DetectorWriter"  [override]
tests/core/test_async_status.py:68: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/ophyd_async/epics/areadetector/writers/hdf_writer.py:89: error: Return type "AsyncIterator[tuple[Literal['resource'], Any] | tuple[Literal['datum'], Any] | tuple[Literal['stream_resource'], Any] | tuple[Literal['stream_datum'], Any]]" of "collect_stream_docs" incompatible with return type "Coroutine[Any, Any, AsyncIterator[tuple[Literal['resource'], Any] | tuple[Literal['datum'], Any] | tuple[Literal['stream_resource'], Any] | tuple[Literal['stream_datum'], Any]]]" in supertype "DetectorWriter"  [override]

@rosesyrett
Copy link
Collaborator Author

once tom's async-status branch is rebased on top of bluesky, lint will pass

Rose Yemelyanova and others added 9 commits October 16, 2023 17:02
* Move missing types from i22 branch for Pandas

* lint

* expose seq_table_from_arrays

* Document seq_table_from_ functions

- Make seq_table_from_arrays kwarg only and make time2 a required argument
- Add docstrings

* Linting

* Prevent exception on truthiness of non-empty array

* Add tests for from_array

* linting

* Mypy formatting

* Made correct path for saxs sum detector; see dodal commit

* made flyer work

* Renamed ADDriver to ADBase and removed ad aravis as not generic enough

---------

Co-authored-by: Ware, Joseph (DLSLtd,RAL,LSCI) <joseph.ware@diamond.ac.uk>
@rosesyrett rosesyrett merged commit 30ffafe into main Oct 20, 2023
14 checks passed
@rosesyrett rosesyrett deleted the add-detector-logic branch October 20, 2023 15:29
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.

None yet

4 participants