Skip to content

Add mention about model_set_axis=False in Model's docstring - #7143

Merged
pllim merged 1 commit into
astropy:masterfrom
saimn:model_set_axis
Feb 1, 2018
Merged

pllim merged 1 commit into
astropy:masterfrom
saimn:model_set_axis

Conversation

@saimn

@saimn saimn commented Feb 1, 2018

Copy link
Copy Markdown
Contributor

Following #7142, use of model_set_axis=False is mentioned only in the Model sets section, it can be useful to have this in the docstring too.

@astropy-bot

astropy-bot Bot commented Feb 1, 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 nden February 1, 2018 15:12
@pllim pllim added this to the v2.0.4 milestone Feb 1, 2018

@pllim pllim 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.

Looks uncontroversial enough.

@pllim

pllim commented Feb 1, 2018

Copy link
Copy Markdown
Member

Circle CI failure is unrelated?

________________________________ 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([1.113545, 1.194334, 3.162268])
E        y: array([1. , 1.2, 3.2])

astropy/modeling/tests/test_constraints.py:511: AssertionError

@pllim pllim added the zzz 💤 merge-when-ci-passes Do not use: We have auto-merge option now. label Feb 1, 2018
@saimn

saimn commented Feb 1, 2018

Copy link
Copy Markdown
Contributor Author

@pllim - Yep, it's unrelated, see #7134 (comment). (btw I thought that [docs only] would also skip builds on CircleCI and AppVeyor ?).

@pllim
pllim merged commit 15aa9f1 into astropy:master Feb 1, 2018
@saimn
saimn deleted the model_set_axis branch February 1, 2018 16:09
bsipocz pushed a commit that referenced this pull request Feb 4, 2018
Add mention about model_set_axis=False in Model's docstring
bsipocz pushed a commit that referenced this pull request Feb 4, 2018
Add mention about model_set_axis=False in Model's docstring
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