Skip to content

Add device docstring to DeviceManager factory docstrings - #1829

Merged
oliwenmandiamond merged 26 commits into
mainfrom
device_manager_adds_device_doc_string
Feb 3, 2026
Merged

oliwenmandiamond merged 26 commits into
mainfrom
device_manager_adds_device_doc_string

Conversation

@oliwenmandiamond

@oliwenmandiamond oliwenmandiamond commented Jan 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #780

Examples

Device without documentation

>>> help(beamsize)
Help on DeviceFactory in module dodal.beamlines.i03:

beamsize = <beamsize: DeviceFactory(aperture_scatterguard: ...terguard) -> dodal.devices.i03.beamsize.Beamsize>
    Beamsize:
    
    No documentation available.

>>> 

Device with documentation

>>> help(robot)
Help on DeviceFactory in module dodal.beamlines.i03:

robot = <robot: DeviceFactory() -> dodal.devices.robot.BartRobot>
    BartRobot:
    
    The sample changing robot.

>>> 

Device with factory documentation and device documentation

>>> help(panda_fast_grid_scan)
Help on DeviceFactory in module dodal.beamlines.i03:

panda_fast_grid_scan = <panda_fast_grid_scan: DeviceFactory() -> dodal.devices.fast_grid_scan.PandAFastGridScan>
    This is used instead of the zebra_fast_grid_scan device when using the PandA.
    
    PandAFastGridScan:
    
    Device for panda constant-motion scan.
    
        In this scan, the goniometer's velocity
        is constant through each row. It doesn't slow down when going through trigger points.

>>> 

Instructions to reviewer on how to test:

  1. Check new tests make sense
  2. Check tests pass

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}

@oliwenmandiamond
oliwenmandiamond requested a review from a team as a code owner January 20, 2026 13:49
@oliwenmandiamond oliwenmandiamond changed the title Device manager adds device doc string to factory method DeviceManager adds device doc string to factory method Jan 20, 2026
@DominicOram

Copy link
Copy Markdown
Contributor

I was literally just thinking of doing this

@oliwenmandiamond

Copy link
Copy Markdown
Contributor Author

I was literally just thinking of doing this

Saved you the work 😄

@dan-fernandes dan-fernandes 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.

Looks good once the failing tests are sorted

Comment thread src/dodal/device_manager.py Resolved
Comment thread src/dodal/device_manager.py Resolved
Comment thread src/dodal/device_manager.py Resolved
Comment thread src/dodal/device_manager.py Resolved
@codecov

codecov Bot commented Jan 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.14%. Comparing base (e0514ae) to head (462ff36).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1829      +/-   ##
==========================================
- Coverage   99.15%   99.14%   -0.01%     
==========================================
  Files         304      304              
  Lines       11497    11509      +12     
==========================================
+ Hits        11400    11411      +11     
- Misses         97       98       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/dodal/device_manager.py Resolved
Comment thread tests/test_device_manager.py Resolved
Comment thread src/dodal/device_manager.py Resolved
Comment thread tests/test_device_manager.py Resolved
Comment thread tests/test_device_manager.py Resolved
Comment thread tests/test_device_manager.py Resolved
Comment thread src/dodal/device_manager.py Resolved
@tpoliaw tpoliaw changed the title DeviceManager adds device doc string to factory method Add device docstring to DeviceManager factories Jan 30, 2026
@tpoliaw tpoliaw changed the title Add device docstring to DeviceManager factories Add device docstring to DeviceManager factory docstrings Jan 30, 2026
@tpoliaw tpoliaw self-assigned this Feb 2, 2026
@tpoliaw
tpoliaw dismissed their stale review February 3, 2026 16:37

Changes have been made since

@oliwenmandiamond
oliwenmandiamond merged commit 7c3dd01 into main Feb 3, 2026
9 of 10 checks passed
@oliwenmandiamond
oliwenmandiamond deleted the device_manager_adds_device_doc_string branch February 3, 2026 16:43
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.

Expose help and docs from device factory functions.

4 participants