Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

DeviceAttribute.is_empty was not working correctly with latest cpp tango version #273

Merged
merged 1 commit into from
Apr 11, 2019

Conversation

jairomoldes
Copy link
Contributor

fixes #271

tiagocoutinho
tiagocoutinho approved these changes Apr 10, 2019
Copy link
Contributor

@tiagocoutinho tiagocoutinho left a comment

Choose a reason for hiding this comment

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

the PR should be against develop, not stable

@ajoubertza ajoubertza changed the base branch from stable to develop April 10, 2019 19:37
ajoubertza added a commit that referenced this pull request Apr 10, 2019
- Verify basic reading and writing of spectrum attributes.
- Verify that clients reading empty spectrum attributes get a
  `None` value.  The string spectrum attriubte is a special case as
  it doesn't reduce its length when written to.

Relates to issue #271, and PR #273
Copy link
Member

@ajoubertza ajoubertza left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix @jairomoldes (and remembering a cppTango change from a year an a half ago!)

@jairomoldes
Copy link
Contributor Author

the PR should be against develop, not stable

You are right. Sorry. My mistake.

@ajoubertza
Copy link
Member

the PR should be against develop, not stable

@tiagocoutinho This has been fixed, so I'm going to merge this.

@ajoubertza ajoubertza merged commit 6179390 into develop Apr 11, 2019
@ajoubertza ajoubertza deleted the issue-271 branch April 11, 2019 12:04
tiagocoutinho pushed a commit to tiagocoutinho/pytango that referenced this pull request Apr 21, 2019
- Verify basic reading and writing of spectrum attributes.
- Verify that clients reading empty spectrum attributes get a
  `None` value.  The string spectrum attriubte is a special case as
  it doesn't reduce its length when written to.

Relates to issue tango-controls#271, and PR tango-controls#273
@cpascual
Copy link

Just one comment:
IMHO, this PR is "patching" a backwards-incompatible change in Tango C++ regarding the zero-length arrays.
I completely agree with restoring the the previous behaviour, but I think that this should (also) be done in TangoC++ to avoid the tango binding to differ in behaviour from the C++ library

@ajoubertza
Copy link
Member

@cpascual Thanks for the comment - that sounds like an issue you need to raise in https://github.com/tango-controls/cppTango

@tiagocoutinho
Copy link
Contributor

tiagocoutinho commented May 29, 2019

By principle, PyTango tries not to change the behaviour of the C++ library. Since a backward compatibility was introduced, I also think that the previous behaviour should be restored at the C++ level.

Regardless of the C++ team decision, this PR should be reverted because it masks some behaviour changes.

@ajoubertza
Copy link
Member

By principle, PyTango tries not to change the behaviour of the C++ library. Since a backward compatibility was introduced, I also think that the previous behaviour should be restored at the C++ level.

Agree that PyTango behaviour should match the C++ library, but don't agree that this PR makes PyTango behave differently. It makes PyTango's behaviour more accurate. If the C++ library indicates that an attribute is empty, PyTango now correctly matches that behaviour. Importantly, it makes PyTango's behaviour consistent with its previous behaviour.

Regardless of the C++ team decision, this PR should be reverted because it masks some behaviour changes.

I don't think this PR should be reverted. That would break PyTango functionality. With this patch, PyTango works correctly with the C++ library 9.2.x and 9.3.x. Why would we want to lose that?

@ajoubertza ajoubertza changed the title DeviceAttribute.is_empty was not correctly with latest cpp tango version DeviceAttribute.is_empty was not working correctly with latest cpp tango version Jul 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttributeError: 'DeviceAttribute' object has no attribute 'value' for zero length arrays
4 participants