-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Issue with formatting coordinates with colons #2183 #2197
Conversation
elif len(sep) == 1 and fields == 2: | ||
sep = sep + ('','') | ||
elif len(sep) == 1 and fields == 1: | ||
sep = ('','','') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a really silly nitpick about putting spaces after commas, but other than that this looks good to me. I'll wait to let others more familiar with this code comment though.
@embray Hi, I am new to open source development and changing others code. This was the best I could think of to make it work without having to change a lot of code. But I hope this solves the issue. |
@QuanTakeuchi - this looks good! As @embray pointed out, could you make sure you include spaces after the commas? That is, |
Added spaces after comma
Done including the spaces. |
@QuanTakeuchi - could you add the tests to One last request - can you add an entry in the |
@astrofrog - made the changes you mentioned. Is the entry made by me in Also wouldn't it be better if I include the test in the file |
@QuanTakeuchi - ah yes, I guess @eteq - could you review this too? |
Adding the test to test_formatting.py instead
looks fine to me, except that the most recent tests are still failing. I think this is a transient error, so I restarted the tests. Assuming they pass it looks good. |
@@ -529,8 +529,12 @@ def sexagesimal_to_string(values, precision=None, pad=False, sep=(':',), | |||
|
|||
if not sep: # empty string, False, or None, etc. | |||
sep = ('', '', '') | |||
elif len(sep) == 1: | |||
elif len(sep) == 1 and fields == 3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for a late and somewhat nitpicky comment, but a nested if
statement would seem more logical (and faster):
elif len(sep) == 1:
if fields == 1:
...
elif fields == 2:
...
else:
...
and then also move the check that 1 <= fields <= 3
so that we know that fields is correct here.
@mhvk Did the changes you mentioned. I hope that's what you meant by moving the check. |
Issue with formatting coordinates with colons #2183
@QuanTakeuchi - yes, this was exactly what I meant. Since travis is happy, I'll merge... |
p.s. Thanks! |
I think astropy#2112 changes this from ``pytest-cov`` to ``coverage`` Don't generate .pyc files when running tests Ensure name-less columns can be printed, plus test case and bug-fix note. str -> six.text_type, move change to 0.3.2 bug-fix section Update development_workflow.rst typo fix Merge pull request astropy#2197 from QuanTakeuchi/master Issue with formatting coordinates with colons astropy#2183 WCS accepts coordinates objects modified WCS accepts coordinate objects minor spaces removal
Issue with formatting coordinates with colons #2183 Conflicts: astropy/coordinates/tests/test_formatting.py
Fixed the ugly appearance of colon when fields is specified to 2