Skip to content

Update test_showtable to split lines as in other tests - #7134

Merged
bsipocz merged 1 commit into
astropy:masterfrom
saimn:test-showtable
Apr 23, 2018
Merged

bsipocz merged 1 commit into
astropy:masterfrom
saimn:test-showtable

Conversation

@saimn

@saimn saimn commented Jan 30, 2018

Copy link
Copy Markdown
Contributor

Following #7126, which recalled me that in #6859 at some point I used .splitlines in all tests but forgot one.

@astropy-bot

astropy-bot Bot commented Jan 30, 2018

Copy link
Copy Markdown

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

@saimn
saimn requested a review from astrofrog January 30, 2018 16:47
@saimn

saimn commented Jan 30, 2018

Copy link
Copy Markdown
Contributor Author

@astrofrog - There is a new (?) failure on CircleCI, maybe related to your recent docker changes ?

=================================== FAILURES ===================================
________________________________ test_2d_model _________________________________
[gw0] linux -- Python 3.6.4 /opt/python/cp36-cp36m/bin/python

    @pytest.mark.skipif('not HAS_SCIPY')
    def test_2d_model():
        # 2D model with LevMarLSQFitter
        gauss2d = models.Gaussian2D(10.2, 4.3, 5,2, 1.2, 1.4)
        fitter = fitting.LevMarLSQFitter()
        X = np.linspace(-1, 7)
        Y = np.linspace(-1, 7)
        x, y = np.meshgrid(X, Y)
        z = gauss2d(x, y)
        w = np.ones(x.size)
        w.shape = x.shape
        rsn = RandomState(1234567890)
        n = rsn.randn(x.size)
        n = np.random.randn(x.size)
        n.shape = x.shape
        m = fitter(gauss2d, x, y, z+2*n, weights=w)
        utils.assert_allclose(m.parameters, gauss2d.parameters, rtol=1e-1)
        m = fitter(gauss2d, x, y, z+2*n, weights=None)
        utils.assert_allclose(m.parameters, gauss2d.parameters, rtol=1e-1)
        # 2D model with LevMarLSQFitter, fixed constraint
        gauss2d.x_stddev.fixed = True
        m = fitter(gauss2d, x, y, z+2*n, weights=w)
        utils.assert_allclose(m.parameters, gauss2d.parameters, rtol=1e-1)
        m = fitter(gauss2d, x, y, z+2*n, weights=None)
        utils.assert_allclose(m.parameters, gauss2d.parameters, rtol=1e-1)
        # Polynomial2D, col_fit_deriv=False
        p2 = models.Polynomial2D(1, c0_0=1, c1_0=1.2, c0_1=3.2)
        z = p2(x, y)
        m = fitter(p2, x, y, z + 2 * n, weights=None)
>       utils.assert_allclose(m.parameters, p2.parameters, rtol=1e-1)
E       AssertionError: 
E       Not equal to tolerance rtol=0.1, atol=0
E       
E       (mismatch 33.33333333333333%)
E        x: array([0.819143, 1.271661, 3.18927 ])
E        y: array([1. , 1.2, 3.2])

astropy/modeling/tests/test_constraints.py:511: AssertionError
=============================== warnings summary ===============================

@astrofrog

Copy link
Copy Markdown
Member

I think the tolerance needs to be increased a bit - e.g 0.2 would do. I think maybe the random numbers are changing from run to run (I noticed this goes away when re-running)

@bsipocz

bsipocz commented Apr 20, 2018

Copy link
Copy Markdown
Member

@saimn @astrofrog - Is this good to go? If yes, please rebase to make sure CI is still happy.

@saimn

saimn commented Apr 21, 2018

Copy link
Copy Markdown
Contributor Author

@bsipocz - Yes, it is pretty straightforward, I rebased to be sure.

@bsipocz bsipocz left a comment

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.

Indeed looks straightforward, so for the sake of the release I approve and merge.

@bsipocz
bsipocz merged commit 5c3d853 into astropy:master Apr 23, 2018
bsipocz added a commit that referenced this pull request Apr 23, 2018
Update test_showtable to split lines as in other tests
@saimn
saimn deleted the test-showtable branch April 24, 2018 04:05
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.

3 participants