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

ENH: raise an error if the daq has not yet been configured #76

Merged
merged 2 commits into from
Aug 9, 2023

Conversation

klauer
Copy link
Contributor

@klauer klauer commented Aug 9, 2023

Description

Raise an error if the daq object is not available/has not been instantiated/configured in the current session.

Motivation and Context

@vespos reported that a simple daq scan raised the following error:

>>> RE(bp.daq_ascan([], sim.fast_motor1, 920, 930, 11, events=120, record=False))
...
AttributeError: 'NoneType' object has no attribute 'parent'

This indicates to me that None is making its way into the detector list in bluesky.
Getting a confusing error like this isn't very friendly, so let's catch it early.

How Has This Been Tested?

Where Has This Been Documented?

This PR text.

Pre-merge checklist

  • Code works interactively
  • Code contains descriptive docstrings, including context and API
  • New/changed functions and methods are covered in the test suite where possible
  • Test suite passes locally
  • Test suite passes on GitHub Actions
  • Ran docs/pre-release-notes.sh and created a pre-release documentation page
  • Pre-release docs include context, functional descriptions, and contributors as appropriate

@klauer klauer marked this pull request as ready for review August 9, 2023 15:49
@klauer klauer requested review from ZLLentz and tangkong August 9, 2023 15:49
Copy link
Contributor

@tangkong tangkong left a comment

Choose a reason for hiding this comment

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

This looks good to me on the whole, I was concerned about other apps / code paths that might rely on this, but after some brief poking around I think this is appropriate

Copy link
Member

@ZLLentz ZLLentz left a comment

Choose a reason for hiding this comment

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

Same thoughts as in the pcdsdaq-side PR, the original traceback without this was rough to parse

@klauer klauer merged commit 47f21f1 into pcdshub:master Aug 9, 2023
9 checks passed
@klauer klauer deleted the enh_raise_no_daq branch August 9, 2023 19:23
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.

3 participants