ericmandel / pyds9

Python connection to SAOimage DS9 via XPA
76 stars 41 forks source link

Properties and variables #57

Closed montefra closed 6 years ago

montefra commented 6 years ago

This first commit expose ds9Globals at module level as requested in #52.

Next I want to see if it is possible to use the property decorator for the read only attributes in DS9. I'll let you know if I have questions.

montefra commented 6 years ago

Commit 7b154ff remove DS9._privates = ['target', 'id', 'method'] attribute and the custom __setattr__ in favour of read only properties, defined using the property decorator without the corresponding setter.

This makes the code clearer (to me at least) and shouldn't require modifying the code for cases similar to #33.

@ericmandel I have one question:

In the original code, method is set as a read only attribute, but it is not assigned to self.__dict__ like the other two methods. What should I do with it: remove it or assign it to some value (likely XPA_METHOD)?

ericmandel commented 6 years ago

@montefra I think you should assign the read-only value of XPA_METHOD so that the user has an easy way to determine which method is being used. I'm sure that was my original (but unfulfilled?) intent ...

montefra commented 6 years ago

I think you should assign the read-only value of XPA_METHOD so that the user has an easy way to determine which method is being used. I'm sure that was my original (but unfulfilled?) intent ...

I'll do it soon

montefra commented 6 years ago

and now we have method

ericmandel commented 6 years ago

Thanks for doing this ... and fixing the original problem. Obviously, no one has really needed it, but I believe these minor details add to the quality and completeness of the implementation.