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

Added document logging & unit tests #11

Merged
merged 12 commits into from
Aug 9, 2024

Conversation

jackbdoughty
Copy link
Contributor

@jackbdoughty jackbdoughty commented Aug 9, 2024

  • Creates a new callback function that the BlueSky run engine subscribes to which records every document in a log file under "C:\","instrument","var","logs","bluesky","raw_documents".
  • Added a unit test that checks that the file to be written to is opened 3 times, for open, descriptor then stop. Also in the stop document to be written, checks that the run is successful with no interruptions.
  • Callback returns an ID of 0 if it is ever needed to unsubscribe

Ticket6

Copy link
Contributor

@Tom-Willemsen Tom-Willemsen left a comment

Choose a reason for hiding this comment

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

Could you write some docs (just some markdown in the docs folder) about what this does, how it works, where the logs go, how to use it for debugging etc?

src/ibex_bluesky_core/callbacks/document_logger.py Outdated Show resolved Hide resolved
src/ibex_bluesky_core/callbacks/document_logger.py Outdated Show resolved Hide resolved
src/ibex_bluesky_core/callbacks/document_logger.py Outdated Show resolved Hide resolved
src/ibex_bluesky_core/run_engine.py Outdated Show resolved Hide resolved
tests/test_run_engine.py Outdated Show resolved Hide resolved
tests/test_run_engine.py Outdated Show resolved Hide resolved
tests/test_run_engine.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Tom-Willemsen Tom-Willemsen 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.

We might need to do something cleverer if we ever end up doing nested multi-run plans, but this is fine for the simple plans we'll be doing in the immediate future.

@Tom-Willemsen Tom-Willemsen merged commit 3c9500b into main Aug 9, 2024
9 checks passed
@Tom-Willemsen Tom-Willemsen deleted the Ticket6_callbacks_document_logging branch August 9, 2024 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants