google-code-export / pysal

Automatically exported from code.google.com/p/pysal
Other
1 stars 1 forks source link

make dockest is raising failures #214

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Running the examples from the autocorrelation I reproduce the expected results:

    Doctest mode is: ON
    >>> import pysal
    >>> import numpy as np
    >>> np.random.seed(12345)
    >>> w=pysal.lat2W(4,4)
    >>> y=np.ones(16)
    >>> y[0:8]=0
    >>> g = pysal.Gamma(y,w)
    >>> g.g
    20.0
    >>> g.g_z
    3.1879280354548638
    >>> g.min_g
    0.0
    >>> g.max_g
    20.0
    >>> g.mean_g
    11.093093093093094
    >>> 

But when running make doctest we get different results which triggers failures:

    Document: users/tutorials/autocorrelation
    -----------------------------------------
    **********************************************************************
    File "users/tutorials/autocorrelation.txt", line 156, in default
    Failed example:
        g.g_z
    Expected:
        3.1879280354548638
    Got:
        3.1698825785682012
    **********************************************************************
    File "users/tutorials/autocorrelation.txt", line 160, in default
    Failed example:
        g.min_g
    Expected:
        0.0
    Got:
        4.0
    **********************************************************************
    File "users/tutorials/autocorrelation.txt", line 164, in default
    Failed example:
        g.mean_g
    Expected:
        11.093093093093094
    Got:
        11.27927927927928

Why the difference?

Original issue reported on code.google.com by sjsrey on 31 Jul 2012 at 5:33

GoogleCodeExporter commented 9 years ago
we were missing setting of the random seed

Original comment by sjsrey on 31 Jul 2012 at 6:37

GoogleCodeExporter commented 9 years ago
closed with http://code.google.com/p/pysal/source/detail?r=1286

Original comment by sjsrey on 31 Jul 2012 at 6:38