Skip to content

Move assert_quantity_allclose import to lower level in bls.core#7932

Closed
pllim wants to merge 1 commit intoastropy:masterfrom
pllim:bls-import
Closed

Move assert_quantity_allclose import to lower level in bls.core#7932
pllim wants to merge 1 commit intoastropy:masterfrom
pllim:bls-import

Conversation

@pllim
Copy link
Member

@pllim pllim commented Oct 19, 2018

This is because assert_quantity_allclose requires pytest but bls in general can be used without pytest. In other words, pytest should only be required when one runs tests. bls was added in #7391.

xref astropy/astropy-benchmarks#68

@pllim pllim added testing stats Affects-dev PRs and issues that do not impact an existing Astropy release labels Oct 19, 2018
@pllim pllim added this to the v3.1 milestone Oct 19, 2018
@pllim pllim requested a review from larrybradley October 19, 2018 20:49
@astropy-bot
Copy link

astropy-bot bot commented Oct 19, 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.

The other results object to compare.

"""
from ...tests.helper import assert_quantity_allclose
Copy link
Member

Choose a reason for hiding this comment

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

Is the assert_allclose actually meant to be used by users or is it just for the tests? (maybe @dfm can clarify?)

If it's meant to be used by users, I wonder if we should instead import from astropy.units.quantity import _unquantify_allclose_arguments and use np.assert_allclose here? (to avoid the pytest dependency)

Copy link
Member Author

Choose a reason for hiding this comment

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

Usually, "assert" is used in testing. In a non-testing case, maybe use is_allclose that returns a boolean instead, or maybe that ship has sailed now...?

Copy link
Member

Choose a reason for hiding this comment

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

it hasn't sailed at all, the bls module is only in dev so any fixes should be done now

Copy link
Member

Choose a reason for hiding this comment

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

actually, @dfm, I wonder whether we need this convenience at all?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi team! This is just for testing and it's not meant as a user facing method... perhaps we should move it to the tests script anyways?

Copy link
Member

@astrofrog astrofrog Oct 20, 2018

Choose a reason for hiding this comment

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

@dfm - thanks for confirming - indeed this should definitely be moved inside the tests directory in this case.

@eteq
Copy link
Member

eteq commented Oct 21, 2018

In #7938 I made an alternative to this that moves the whole thing over into the testing suite. Based on #7932 (comment) I think that's the way to go?

@crawfordsm crawfordsm closed this Oct 21, 2018
@pllim pllim deleted the bls-import branch October 21, 2018 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Affects-dev PRs and issues that do not impact an existing Astropy release stats testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants