Skip to content

added 99-pvscan which includes methods to get pv types - #20

Open
Dan Henriksen (dihenriksen) wants to merge 2 commits into
mainfrom
get-pv-types
Open

Dan Henriksen (dihenriksen) wants to merge 2 commits into
mainfrom
get-pv-types

Conversation

@dihenriksen

Copy link
Copy Markdown
Contributor

No description provided.

@dihenriksen
Dan Henriksen (dihenriksen) marked this pull request as ready for review February 5, 2026 20:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Datatype handling can abort exports, and discovery omits existing classic ophyd devices and signals.

2 open issues
What changed in this PR

Adds PV inventory helpers to the startup profile, mapping configured signals to their PV sources and datatypes.

Changes:

  • Adds recursive signal discovery and enum metadata conversion.
  • Provides device/signal mappings and a flat JSON export.
  • Ignores the generated pv_types.json file.
File Description
startup/​99-pvscan.py Adds signal traversal, datatype conversion, and PV inventory export.
.gitignore Excludes generated PV inventory output.

Review effort: Balanced

Comment thread startup/99-pvscan.py
Comment on lines +77 to +99
if issubclass(signal._connector.backend.datatype, Enum)
else signal._connector.backend.datatype.__name__
),
}
for signal in walk_signals(device).values()
if isinstance(signal, Signal)
}
for device in devices
}
return pvs


def get_pv_types():
"""
This is a dictionary that maps all of the PVs in the profile to their types.
"""

devices = [g for g in globals().values() if isinstance(g, Device)]
pv_types = {
signal.source: (
enum_to_dict(signal._connector.backend.datatype)
if issubclass(signal._connector.backend.datatype, Enum)
else signal._connector.backend.datatype.__name__
Comment thread startup/99-pvscan.py
This is a dictionary that maps the Devices and Signals in the profile to their pvs and types.
"""

devices = [g for g in globals().values() if isinstance(g, Device)]
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.

2 participants