Skip to content

TST: Fix cosmology test warnings#7992

Merged
bsipocz merged 2 commits intoastropy:masterfrom
pllim:fix-warn-cosmo
Oct 27, 2018
Merged

TST: Fix cosmology test warnings#7992
bsipocz merged 2 commits intoastropy:masterfrom
pllim:fix-warn-cosmo

Conversation

@pllim
Copy link
Member

@pllim pllim commented Oct 26, 2018

This PR gets rid of most of the warnings seen when removing addopts = -p no:warnings in setup.cfg and then running python setup.py test -P cosmology --remote-data.

These still exist because I am not sure how to handle them:

Also see #7928

@astropy-bot
Copy link

astropy-bot bot commented Oct 26, 2018

Hi there @pllim 👋 - 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.

cosmo = core.FlatLambdaCDM(H0=70, Om0=0.27, Tcmb0=2.0)
assert cosmo.comoving_distance(1.0).unit == u.Mpc
with pytest.warns(RuntimeWarning, match='numpy.dtype size changed'):
assert cosmo.comoving_distance(1.0).unit == u.Mpc
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious where this warning comes from - that's normally the kind of warning that happens when numpy has some installation issues... Do you understand why the warning happens?

Copy link
Member

Choose a reason for hiding this comment

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

I don't see the warning locally, so part of me thinks this is an issue specific to your installation (maybe scipy was compiled with an older version of numpy). I think this warning check should be removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you understand why the warning happens?

I don't know. I probably did something unholy in my conda environment.

@bsipocz bsipocz added this to the v2.0.10 milestone Oct 26, 2018
Copy link
Contributor

@aconley aconley left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Thanks for doing this.

@pllim
Copy link
Member Author

pllim commented Oct 27, 2018

Need another approval for merging 😬 . Thanks for review, @aconley !

@bsipocz bsipocz merged commit 7981392 into astropy:master Oct 27, 2018
@bsipocz
Copy link
Member

bsipocz commented Oct 27, 2018

Thanks @pllim!

@pllim pllim deleted the fix-warn-cosmo branch October 27, 2018 05:00
bsipocz added a commit that referenced this pull request Oct 30, 2018
TST: Fix cosmology test warnings
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