Skip to content

Prevent Type checking issues with injecting default device arguments - #599

Merged
DiamondJoseph merged 2 commits into
mainfrom
adjust_inject_typing
Jun 6, 2024
Merged

DiamondJoseph merged 2 commits into
mainfrom
adjust_inject_typing

Conversation

@DiamondJoseph

Copy link
Copy Markdown
Contributor

Instructions to reviewer on how to test:

  1. Write a plan that takes a device of type D with a default of inject()
  2. Confirm that type checking (mypy, pylance, ruff...) do not flag the inject return as the wrong type.

Checks for reviewer

  • Would the PR title make sense to a scientist on a set of release notes
  • If a new device has been added does it follow the standards
  • If changing the API for a pre-existing device, ensure that any beamlines using this device have updated their Bluesky plans accordingly
  • Have the connection tests for the relevant beamline(s) been run via dodal connect ${BEAMLINE}

Comment thread src/dodal/common/coordination.py Outdated
e.g. For a 1-dimensional scan, that is usually performed on a consistent Movable
axis with name "stage_x"
Function to mark a defaulted argument of a plan as a reference to a device stored
in another context and are not available to be used when writing plans.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not available for use when

@DominicOram DominicOram left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great, thank you!

@DiamondJoseph
DiamondJoseph force-pushed the adjust_inject_typing branch from d03ebb2 to fd63afb Compare June 6, 2024 12:01
@DiamondJoseph
DiamondJoseph force-pushed the adjust_inject_typing branch from fd63afb to fb33a7a Compare June 6, 2024 12:01
@DiamondJoseph
DiamondJoseph merged commit 5991410 into main Jun 6, 2024
@DiamondJoseph
DiamondJoseph deleted the adjust_inject_typing branch June 6, 2024 13:15
@DiamondJoseph DiamondJoseph mentioned this pull request Oct 14, 2024
4 tasks
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