-
Notifications
You must be signed in to change notification settings - Fork 38
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
KeyError: "no such member 'display.description' in 'display.description'" for NTScalar string types #113
Comments
Should be fixed by 2797fd3 (in 4.1.8) |
Thank you for such a quick response! I've just upgraded to >>> pv = SharedPV(nt=NTScalar('d', display=True), initial={'value': 0.0, 'display.description':'test'})
>>> pv.current().raw.todict()
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/p4p/server/raw.py", line 182, in current
return self._unwrap()
TypeError: NTScalar.unwrap() missing 1 required positional argument: 'value'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.10/site-packages/p4p/server/raw.py", line 184, in current
raise ValueError("Unable to unwrap %r with %r"%(V, self._unwrap))
ValueError: Unable to unwrap Value(id:epics:nt/NTScalar:1.0, 0.0) with <bound method NTScalar.unwrap of <class 'p4p.nt.scalar.NTScalar' The same error occurs without I've checked and the error does not exist in version 4.1.7: >>>pv = SharedPV(nt=NTScalar('d', display=True), initial={'value': 0.0, 'display.description':'test'})
>>>pv.current().raw.todict()
{'value': 0.0, 'alarm': {'severity': 0, 'status': 0, 'message': ''}, 'timeStamp': {'secondsPastEpoch': 0, 'nanoseconds': 0, 'userTag': 0}, 'display': {'limitLow': 0.0, 'limitHigh': 0.0, 'description': 'test', 'format': '', 'units': ''}} |
This seems to be a regression. @mdavidsaver I think the issue is here: |
Thanks! Using 4.1.9 I'm able to create the string PV with a description as I need. I'm not expecting to be able to specify the format or units with a string PV because they don't really need it but I get the same error as before when I pass a dictionary that contains the format and units, even if they're blank. For my application this is fine but I thought I'd check whether this is the intention?
|
Yes. In part because |
360c131 adds an argument |
Hi there, I am trying to create a string PV with a description and I am using the same construction method as I have for similar Double PVs. However, when passing type 's' to the NTScalar class, I get the following error:
Is this the expected behaviour for string PVs?
I am using p4p version 4.1.5 with python 3.10.12
The text was updated successfully, but these errors were encountered: