Skip to content

Add docstring to synchrotron class#1877

Open
Villtord wants to merge 11 commits intomainfrom
add_synchrotron_docstring
Open

Add docstring to synchrotron class#1877
Villtord wants to merge 11 commits intomainfrom
add_synchrotron_docstring

Conversation

@Villtord
Copy link
Contributor

Add docstring to synchrotron class.

Instructions to reviewer on how to test:

  1. Do thing x
  2. Confirm thing y happens

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}

@Villtord Villtord added documentation Improvements or additions to documentation Docsathon Tickets that may be tackled during the Docsathon, 27-8th August 2025 labels Jan 30, 2026
@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.05%. Comparing base (dffe1f8) to head (b30c45b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1877   +/-   ##
=======================================
  Coverage   99.05%   99.05%           
=======================================
  Files         312      312           
  Lines       11749    11761   +12     
=======================================
+ Hits        11638    11650   +12     
  Misses        111      111           

☔ 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.

@Villtord Villtord marked this pull request as ready for review February 10, 2026 09:41
@Villtord Villtord requested a review from a team as a code owner February 10, 2026 09:41
@Villtord Villtord enabled auto-merge (squash) February 10, 2026 09:41
Copy link
Contributor

@oliwenmandiamond oliwenmandiamond left a comment

Choose a reason for hiding this comment

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

"""A StandardReadable device representing a synchrotron facility.

This device provides access to key synchrotron parameters and operational
status information.

Attributes:
current (EpicsSignalR): Read-only signal for the synchrotron beam current.
energy (EpicsSignalR): Read-only signal for the beam energy.
probe (SoftSignalRW): Configurable signal for the probe type.
Defaults to "x-ray".
type (SoftSignalRW): Configurable signal for the synchrotron type.
Defaults to "Synchrotron X-ray Source".
synchrotron_mode (EpicsSignalR): Read-only signal for the current
synchrotron operating mode.
machine_user_countdown (EpicsSignalR): Read-only signal for the
machine user countdown timer.
top_up_start_countdown (EpicsSignalR): Read-only signal for the
top-up start countdown timer.
top_up_end_countdown (EpicsSignalR): Read-only signal for the
top-up end countdown timer.
"""

@Villtord
Copy link
Contributor Author

Here it is #1914

Copy link
Contributor

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

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

Thanks, I'm not a massive fan of docs like these. Like Read-only signal for the machine user countdown timer. gives me no additional context that the name machine_user_countdown doesn't already give me. If we want to write helpful docs then we should answer questions like "what is a machine user" maybe what units is the countdown in etc. As it stands it feels a bit like this is documenting things just for the sake of saying we have docs.

Comment on lines +43 to +45
signal_prefix (str, optional): Beamline part of PV. Defaults to Prefix.SIGNAL.
status_prefix (str, optional): Status part of PV. Defaults to Prefix.STATUS.
topup_prefix (str, optional): Top-up part of PV. Defaults to Prefix.TOP_UP.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I always thought having these as arguments was kind of silly. When would we ever change them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We probably will never change them, but if someone wants to reuse our code in a different synchrotron they would need it. Not that it is difficult to add though... That's the only reasoning I see behind it. But I get a feeling that we don't have such purpose of having this repo reused. Or do we?

@Villtord
Copy link
Contributor Author

Thanks, I'm not a massive fan of docs like these. Like Read-only signal for the machine user countdown timer. gives me no additional context that the name machine_user_countdown doesn't already give me. If we want to write helpful docs then we should answer questions like "what is a machine user" maybe what units is the countdown in etc. As it stands it feels a bit like this is documenting things just for the sake of saying we have docs.

I was more thinking of having more useful help() that gives list of Args and Attributes available.

@fajinyuan
Copy link
Contributor

What is the recommended or agreed pydoc style in Diamond II developments? sphinx, google stype, numpy, or pydoc? do we need to support cross-reference in the doc string or not?

@Villtord
Copy link
Contributor Author

What is the recommended or agreed pydoc style in Diamond II developments? sphinx, google stype, numpy, or pydoc? do we need to support cross-reference in the doc string or not?

Google style with few exceptions according to https://diamondlightsource.github.io/dodal/main/reference/style-guide.html

@Villtord Villtord self-assigned this Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docsathon Tickets that may be tackled during the Docsathon, 27-8th August 2025 documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments