From 81b68e47a61839f05f3a41b8ca1764ddd47fee10 Mon Sep 17 00:00:00 2001 From: Sergio Pascual Date: Jul 11 2019 10:02:21 +0000 Subject: Add patch to fix the faulty test "test_nan_lnprob" --- diff --git a/fix_nan_lnprob.patch b/fix_nan_lnprob.patch new file mode 100644 index 0000000..56dca3a --- /dev/null +++ b/fix_nan_lnprob.patch @@ -0,0 +1,12 @@ +diff -ur emcee-2.2.1/emcee/tests.py emcee-2.2.1.btest/emcee/tests.py +--- emcee-2.2.1/emcee/tests.py 2016-07-15 10:12:21.000000000 +0200 ++++ emcee-2.2.1.btest/emcee/tests.py 2019-07-11 11:48:15.264302724 +0200 +@@ -178,7 +178,7 @@ + + # If a walker is right at zero, ``lnprobfn`` returns ``np.nan``. + p0 = self.p0 +- p0[0] = 0.0 ++ p0[0] = np.zeros_like(p0[0]) + + try: + self.check_sampler(p0=p0) diff --git a/python-emcee.spec b/python-emcee.spec index 6ef6179..d870c4e 100644 --- a/python-emcee.spec +++ b/python-emcee.spec @@ -8,12 +8,15 @@ used in several published projects in the Astrophysics literature. Name: python-%{srcname} Version: 2.2.1 -Release: 12%{?dist} +Release: 13%{?dist} Summary: The Python ensemble sampling toolkit for affine-invariant MCMC License: MIT URL: http://dan.iel.fm/emcee/current/ Source0: https://pypi.io/packages/source/e/emcee/emcee-%{version}.tar.gz +# Patch to fix +# https://github.com/dfm/emcee/issues/293 +Patch0: fix_nan_lnprob.patch BuildRequires: python3-devel BuildArch: noarch @@ -34,7 +37,7 @@ Requires: python3-numpy %{common_description} %prep -%setup -qn %{srcname}-%{version} +%autosetup -n %{srcname}-%{version} -p1 %build %py3_build @@ -43,10 +46,8 @@ Requires: python3-numpy %py3_install %check -# Allow faillure -# https://github.com/dfm/emcee/issues/293 pushd %{buildroot}/%{python3_sitelib} - nosetests-%{python3_version} -v emcee || : + nosetests-%{python3_version} -v emcee popd %files -n python3-%{srcname} @@ -55,6 +56,9 @@ popd %{python3_sitelib}/* %changelog +* Thu Jul 11 2019 Sergio Pascual - 2.2.1-13 +- Add patch to fix the faulty test "test_nan_lnprob" + * Wed Feb 13 2019 Sergio Pascual - 2.2.1-12 - Allow faillures in test suite