Skip to content

Conversation

@phys-cgarnier
Copy link
Collaborator

Added error handling to catch the exception raised get searching for a PV that doesn't have a corresponding device in the lattice.

Please review the changes and let me know if you find it problematic in any way.

…a PV that doesn't have a corresponding device in the lattice
Comment on lines +310 to +316
try:
value = self.virtual_accelerator.get_pvs([reason])[reason]
except AttributeError as e:
if reason not in self.omitted:
self.omitted.append(reason)
print(f"Error getting param for {reason}: {e}, do not use {reason}")
return 0
Copy link
Member

Choose a reason for hiding this comment

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

I think this would error out when caget-ing SOMETHING.DRVL. It might be worthwhile to ignore PVs with a .XYZ suffix.

@JJL772
Copy link
Member

JJL772 commented Dec 5, 2025

I have applied a similar fix to #19, since we've both changed the same code in our PRs.

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