Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot use summary() method of CalcoutRecord object #518

Closed
prjemian opened this issue Jun 23, 2021 · 6 comments
Closed

TypeError: Cannot use summary() method of CalcoutRecord object #518

prjemian opened this issue Jun 23, 2021 · 6 comments
Assignees
Labels
Milestone

Comments

@prjemian
Copy link
Contributor

Tried to demonstrate the .summary() method of an ophyd Device subclass today (apstools.devices.synApps.calcout.CalcoutRecord) and it failed with a TypeError as shown.
error

While the exception trace shows an error in ophyd, it seems likely that a fix could be applied here to prevent that exception in the first place.

@prjemian prjemian added the bug label Jun 23, 2021
@prjemian prjemian added this to the 1.5.1 milestone Jun 23, 2021
@prjemian prjemian self-assigned this Jun 23, 2021
@prjemian
Copy link
Contributor Author

Same problem with SwaitRecord.

@prjemian
Copy link
Contributor Author

Something is wrong with how these classes use hints and read_attrs.

@prjemian
Copy link
Contributor Author

When these lines are commented out, no TypeError exception is raised:

read_attrs = APS_utils.itemizer("channels.%s", CHANNEL_LETTERS_LIST)
hints = {"fields": read_attrs}

The other occurrences of hints and read_attrs does not affect this issue.

@prjemian
Copy link
Contributor Author

prjemian commented Jun 30, 2021

It's an upstream problem in ophyd.device.Device:

~/.local/lib/python3.8/site-packages/ophyd/device.py in _summary(self)
   1080         read_attrs = self.read_attrs
   1081         config_attrs = self.configuration_attrs
-> 1082         used_attrs = set(read_attrs + config_attrs)
   1083         extra_attrs = [a for a in self.component_names
   1084                        if a not in used_attrs]

type(config_attrs) is ophyd.device.Device.OphydAttrList. If it was wrapped with list(config_attrs), then 1082 would succeed.

@prjemian
Copy link
Contributor Author

FYI

(bluesky_2021_2) prjemian@zap:~/.../BCDA-APS/apstools$ conda list ophyd
# packages in environment at /home/prjemian/.conda/envs/bluesky_2021_2:
#
# Name                    Version                   Build  Channel
ophyd                     1.6.1              pyhd8ed1ab_0    conda-forge

@prjemian
Copy link
Contributor Author

Since this is a problem with the .summary() method (which is not called typically within automation code, only by user's choice from a command line), resolution of the problem is not critical to the next release here.

No work to do here, so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant