Skip to content

Increase coverage - #7697

Merged
mhvk merged 1 commit into
astropy:masterfrom
aleksandr-bakanov:increase-coverage
Aug 6, 2018
Merged

mhvk merged 1 commit into
astropy:masterfrom
aleksandr-bakanov:increase-coverage

Conversation

@aleksandr-bakanov

Copy link
Copy Markdown
Contributor

A small increasing of coverage for:

  • coordinates.distances
  • units.utils

@astropy-bot

astropy-bot Bot commented Aug 1, 2018 •

Copy link
Copy Markdown

Hi there @aleksandr-bakanov 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labeled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃.

Everything looks good from my point of view! 👍

If there are any issues with this message, please report them here.

@mhvk mhvk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for looking so carefully over the code. I like the added tests, and agree the private method in Distance can be removed. But let's leave the iscomplex part to #7649

Comment thread astropy/coordinates/distances.py Outdated
return Angle(self.to(u.milliarcsecond, u.parallax()))


# Looks like this function isn't used anywhere. Should it be removed?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Correct, looks like I didn't notice it in a155850, where I made Distance a subclass of SpecificTypeQuantity, which made this unnecessary.

Do delete it as part of this PR!

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.

Done, function has been removed.

Comment thread astropy/units/utils.py Outdated
return 1.0

if np.iscomplex(scale): # scale is complex
# Looks like this condition is always false. From np.iscomplex docs:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Coincidentally, I've been reworking this particular stanza in #7649, so I think it may be best to leave it out here. But I would appreciate if you could have a look at that PR...

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.

Got it, I've removed my comment.

Comment thread astropy/units/tests/test_utils.py Outdated

def test_sanitize_scale():
assert sanitize_scale( complex(2, _float_finfo.eps) ) == 2
assert sanitize_scale( complex(_float_finfo.eps, 2) ) == 2j No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing CR at end of file.

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.

CR has been added.

@mhvk
mhvk removed request for adrn and eteq August 4, 2018 13:34
@mhvk mhvk self-assigned this Aug 4, 2018
@mhvk

mhvk commented Aug 4, 2018

Copy link
Copy Markdown
Contributor

The travis failure is due to the missing newline; the circle-ci failure is unrelated, though may indicate you have to rebase off current master, as I think there were some fixes put in recently. @bsipocz?

@bsipocz

bsipocz commented Aug 4, 2018

Copy link
Copy Markdown
Member

Yes, circleCI is fixed in master, so a rebase should solve it.

Coverage is increased for coordinates.distances and units.utils.
@aleksandr-bakanov

Copy link
Copy Markdown
Contributor Author

@mhvk issues have been resolved, rebase is done. I will check #7649 later.

@mhvk

mhvk commented Aug 6, 2018

Copy link
Copy Markdown
Contributor

Looks all OK now, thanks! Merging...

@mhvk
mhvk merged commit 7745fad into astropy:master Aug 6, 2018
bsipocz pushed a commit that referenced this pull request Oct 4, 2018
bsipocz pushed a commit that referenced this pull request Oct 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants