Skip to content

Fix angle/unit parsing - #1388

Merged
mdboom merged 2 commits into
astropy:masterfrom
mdboom:coordinates/angle-unit-parsing
Sep 3, 2013
Merged

mdboom merged 2 commits into
astropy:masterfrom
mdboom:coordinates/angle-unit-parsing

Conversation

@mdboom

@mdboom mdboom commented Aug 30, 2013

Copy link
Copy Markdown
Contributor

This is a fix for a bug mentioned in #1387.

Angle('+6h7m8s', unit=u.degree)
<Angle [u'90d00m00.00000s' u'105d00m00.00000s' u'120d00m00.00000s']>

I don't know if it fixes the bulk of #1387, but it needs to be fixed regardless.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just to be clear, should this not raise an error? (inconsistent unit/separator)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It could raise an error, but I think it's best if it doesn't. Imagine loading in a bunch of angles from a file. You ultimately want them in degrees, but you don't care what their initial unit is.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree with @mdboom on the behavior here. I haven't looked at the code change, but the new test is what I would expect and looks good.

@taldcroft

Copy link
Copy Markdown
Member

Just out of curiosity, what does this fix do for the first two examples of unexpected behavior in #1387 when creating an ICRSCoordinate?

@mdboom

mdboom commented Sep 3, 2013

Copy link
Copy Markdown
Contributor Author

I think it fixes #1387 -- I've put the results with the PR over there, but @taldcroft should confirm.

mdboom added a commit that referenced this pull request Sep 3, 2013
@mdboom
mdboom merged commit a1171d5 into astropy:master Sep 3, 2013
@mdboom
mdboom deleted the coordinates/angle-unit-parsing branch May 21, 2014 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants