You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.
explicitly with use_kombine=True. The pytest output for that failure is as follows:
____________________________________ test_construct_kde[True] ____________________________________
kombine = True
@pytest.mark.parametrize('kombine', [
None, # test ImportError
False,
pytest.param(True, marks=skip_no_kombine),
])
def test_construct_kde(kombine):
samples = numpy.random.rand(5, 5)
if kombine is None:
with mock.patch.dict('sys.modules', {'kombine': None}):
with pytest.raises(ImportError):
scatter_histograms.construct_kde(samples, use_kombine=True)
return
> kde = scatter_histograms.construct_kde(samples, use_kombine=kombine)
test/test_results.py:109:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gwin/results/scatter_histograms.py:156: in construct_kde
kde = kombine.clustered_kde.KDE(samples_array)
../../opt/gwin-2.7/lib/python2.7/site-packages/kombine/clustered_kde.py:245: in __init__
self._set_bandwidth()
../../opt/gwin-2.7/lib/python2.7/site-packages/kombine/clustered_kde.py:272: in _set_bandwidth
self._cho_factor = la.cho_factor(self._kernel_cov)
../../opt/gwin-2.7/lib/python2.7/site-packages/scipy/linalg/decomp_cholesky.py:142: in cho_factor
check_finite=check_finite)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a = array([[ 0.06329217, -0.00541257, 0.02746434, -0.0176992 , -0.00789024],
...47],
[-0.00789024, -0.05523657, -0.02178179, 0.00170347, 0.11439074]])
lower = False, overwrite_a = False, clean = False, check_finite = True
def _cholesky(a, lower=False, overwrite_a=False, clean=True,
check_finite=True):
"""Common code for cholesky() and cho_factor()."""
a1 = asarray_chkfinite(a) if check_finite else asarray(a)
a1 = atleast_2d(a1)
# Dimension check
if a1.ndim != 2:
raise ValueError('Input array needs to be 2 dimensional but received '
'a {}d-array.'.format(a1.ndim))
# Squareness check
if a1.shape[0] != a1.shape[1]:
raise ValueError('Input array is expected to be square but has '
'the shape: {}.'.format(a1.shape))
# Quick return for square empty array
if a1.size == 0:
return a1.copy(), lower
overwrite_a = overwrite_a or _datacopied(a1, a)
potrf, = get_lapack_funcs(('potrf',), (a1,))
c, info = potrf(a1, lower=lower, overwrite_a=overwrite_a, clean=clean)
if info > 0:
raise LinAlgError("%d-th leading minor of the array is not positive "
> "definite" % info)
E LinAlgError: 5-th leading minor of the array is not positive definite
../../opt/gwin-2.7/lib/python2.7/site-packages/scipy/linalg/decomp_cholesky.py:40: LinAlgError
This is not reproducable 100% of the time, which suggests some issue with random numbers, but it could also be that using a simple 5x5 array of samples created by numpy isn't good enough to actually perform this test.
This test was only designed to make sure that gwin.results.scatter_histogram.construct_kde is doing something sensible, and not to test kombine.clustered_kde.KDE, so as long as we can create a KDE, I'm happy.
All that said, I'm not sure the best way to fix the issue, but it probably requires some combination of @cdcapano and @bfarr working out what is a good enough array of samples to successfully construct a KDE in order to test this code properly.
The text was updated successfully, but these errors were encountered:
Some of the time one of the unit tests fails, related to constructing a
KDE
withkombine
:The test function is:
gwin/test/test_results.py
Lines 95 to 110 in 0d50dca
The target code (being tested) is:
gwin/gwin/results/scatter_histograms.py
Lines 146 to 159 in 0d50dca
explicitly with
use_kombine=True
. The pytest output for that failure is as follows:This is not reproducable 100% of the time, which suggests some issue with random numbers, but it could also be that using a simple 5x5 array of samples created by numpy isn't good enough to actually perform this test.
This test was only designed to make sure that
gwin.results.scatter_histogram.construct_kde
is doing something sensible, and not to testkombine.clustered_kde.KDE
, so as long as we can create a KDE, I'm happy.All that said, I'm not sure the best way to fix the issue, but it probably requires some combination of @cdcapano and @bfarr working out what is a good enough array of samples to successfully construct a KDE in order to test this code properly.
The text was updated successfully, but these errors were encountered: