Skip to content
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

RH Added some tests for the units #3

Closed
wants to merge 1 commit into from
Closed

Conversation

reneehlozek
Copy link

Just a few tests of the different units within the angle functions.

Copy link
Collaborator

@rmjarvis rmjarvis left a comment

Choose a reason for hiding this comment

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

I'll suggest a slight rearrangement of the tests. Mostly, since this is supposed to be testing the built-in units, it seems like they should be the primary term in the ==, asserting that their values are equal to the right thing.

pass

angle_rad = coord.AngleUnit(pi)
assert angle_rad.value == 180.*coord.degrees.value
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this might be clearer as e.g.

assert coord.degrees.value == pi/180.

rather than doing this via the angle_rad.value, which is really just another name for pi here.

assert angle_rad.value == 180.*coord.degrees.value
assert angle_rad.value == 12.*coord.hours.value
assert angle_rad.value == 180.* 60.* coord.arcmin.value
assert angle_rad.value == 180. * 3600 * coord.arcsec.value
Copy link
Collaborator

Choose a reason for hiding this comment

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

I notice that you are missing a similar test for coord.radians, which is probably worth including, since it is also a built-in unit.

@rmjarvis rmjarvis closed this Aug 8, 2017
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.

2 participants