Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

Avoid accessing protected class members from outside #75

Merged
merged 1 commit into from
Dec 7, 2015
Merged

Avoid accessing protected class members from outside #75

merged 1 commit into from
Dec 7, 2015

Conversation

proinsias
Copy link

Found a few cases of protected class members accessed from outside
their modules. Fixed these by either making the member public or by
using a property to access the member.

@astrojuanlu
Copy link
Member

Thanks for the pull request @proinsias! Travis CI is failing because of #73, I will fix it this weekend and then review your contribution.

@proinsias
Copy link
Author

Thanks @Juanlu001! This is only a minor change. This is my first code PR, so I wasn't sure whether I should submit it when the build of the master branch was failing.

@astrojuanlu
Copy link
Member

You've done the right thing! My policy is that master is always green, so if it's red it's my fault :)

@@ -134,7 +138,7 @@ def _repr_latex_(self):

"""
elem_names = [r"a", r"e", r"i", r"\Omega", r"\omega", r"\nu"]
elem_values = [elem._repr_latex_().strip("$")
elem_values = [elem.repr_latex().strip("$")
Copy link
Member

Choose a reason for hiding this comment

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

Not sure about this one, since it's calling _repr_latex_ of each of the elements, which is an astropy Quantity: https://github.com/astropy/astropy/blob/v1.0.7/astropy/units/quantity.py#L935

@astrojuanlu
Copy link
Member

I added a couple of comments, unfortunately I don't think the tests cover them so I made them based on my own judgement.

@proinsias
Copy link
Author

Sounds good! Anything else you need from me? Do you need me to undo the changes you disagreed with above?

@astrojuanlu
Copy link
Member

Yes please! As soon as you push the changes and the builds turn green I will merge the pull request :)

Found a few cases of protected class members accessed from outside
their modules. Fixed these by either making the member public or by
using a property to access the member.
@proinsias
Copy link
Author

Okay, I reverted those specific changes, and added a comment explaining why we could keep that private method. Let me know if that looks good.

@astrojuanlu
Copy link
Member

Looks good to me, merging!

astrojuanlu added a commit that referenced this pull request Dec 7, 2015
Avoid accessing certain protected class members from outside
@astrojuanlu astrojuanlu merged commit c22d8f1 into poliastro:master Dec 7, 2015
@astrojuanlu astrojuanlu removed the Ready label Dec 7, 2015
@proinsias proinsias deleted the protected_classes branch December 8, 2015 03:28
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.

None yet

2 participants