Commit a875b847 authored by Kipp Cannon's avatar Kipp Cannon

lalburst: require scipy 0.19

- this removes the stone-throwing code for computing Poisson coincidence
  rates, making the convex hull version required, which makes scipy's qhull
  and half-space intersection interfaces a requirement
parent 3f6fedd9
Pipeline #192496 failed with stages
in 62 minutes and 40 seconds
......@@ -71,10 +71,12 @@ MIN_LAL_VERSION="7.1.0"
MIN_LALFRAME_VERSION="1.5.2"
MIN_LALMETAIO_VERSION="2.0.0"
MIN_LALSIMULATION_VERSION="2.5.0"
MIN_SCIPY_VERSION="0.19"
AC_SUBST([MIN_LAL_VERSION])
AC_SUBST([MIN_LALFRAME_VERSION])
AC_SUBST([MIN_LALMETAIO_VERSION])
AC_SUBST([MIN_LALSIMULATION_VERSION])
AC_SUBST([MIN_SCIPY_VERSION])
AC_CANONICAL_HOST
......
......@@ -111,6 +111,7 @@ Depends:
python-ligo-segments,
python-matplotlib,
python-scipy,
python-scipy (>= @MIN_SCIPY_VERSION@~),
Description: Python bindings for LALBurst
The LSC Algorithm Burst Library for gravitational wave data analysis.
This package contains Python bindings for the LAL Burst library.
......@@ -141,7 +142,7 @@ Depends:
python3-ligo-lw,
python3-ligo-segments,
python3-matplotlib,
python3-scipy,
python3-scipy (>= @MIN_SCIPY_VERSION@~),
Description: Python 3 bindings foar LALBurst
The LSC Algorithm Burst Library for gravitational wave data analysis.
This package contains Python 3 bindings for the LAL Burst library.
......
......@@ -133,7 +133,7 @@ Requires: python2-lalsimulation >= @MIN_LALSIMULATION_VERSION@
Requires: python2-ligo-lw
Requires: python2-ligo-segments
Requires: python2-numpy >= @MIN_NUMPY_VERSION@
Requires: python2-scipy
Requires: python2-scipy >= @MIN_SCIPY_VERSION@
Provides: %{name}-python = %{version}-%{release}
Provides: deprecated()
Obsoletes: %{name}-python < %{version}-%{release}
......@@ -156,7 +156,7 @@ Requires: python%{python3_pkgversion}-lalsimulation >= @MIN_LALSIMULATION_VERSIO
Requires: python%{python3_pkgversion}-ligo-lw
Requires: python%{python3_pkgversion}-ligo-segments
Requires: python%{python3_pkgversion}-numpy >= @MIN_NUMPY_VERSION@
Requires: python%{python3_pkgversion}-scipy
Requires: python%{python3_pkgversion}-scipy >= @MIN_SCIPY_VERSION@
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}}
%description -n python%{python3_pkgversion}-%{name}
The LSC Algorithm Library for gravitational wave data analysis.
......
......@@ -1259,66 +1259,7 @@ class CoincRates(object):
# the origin is in the interior
interior = numpy.zeros((len(instruments),), dtype = "double")
# compute volume
try:
self.rate_factors[key] = spatial.ConvexHull(spatial.HalfspaceIntersection(halfspaces, interior).intersections).volume
except AttributeError:
# fall-through to old version
pass
else:
# it worked, continue
continue
# old stone-throwing version in case qhull
# is not available. FIXME: remove when we
# are sure it's not needed. for each
# instrument 2...N, the interval within
# which an event is coincident with
# instrument 1
windows = tuple((-self.tau[frozenset((anchor, instrument))], +self.tau[frozenset((anchor, instrument))]) for instrument in instruments)
# pre-assemble a sequence of instrument
# index pairs and the maximum allowed
# \Delta t between them to avoid doing the
# work associated with assembling the
# sequence inside a loop
ijseq = tuple((i, j, self.tau[frozenset((instruments[i], instruments[j]))]) for (i, j) in itertools.combinations(range(len(instruments)), 2))
# compute the numerator and denominator of
# the fraction of events coincident with
# the anchor instrument that are also
# mutually coincident. this is done by
# picking a vector of allowed \Delta ts and
# testing them against the coincidence
# windows. the loop's exit criterion is
# arrived at as follows. after d trials,
# the number of successful outcomes is a
# binomially-distributed RV with variance =
# d p (1 - p) <= d/4 where p is the
# probability of a successful outcome. we
# quit when the ratio of the bound on the
# standard deviation of the number of
# successful outcomes (\sqrt{d/4}) to the
# actual number of successful outcomes (n)
# falls below rel accuracy: \sqrt{d/4} / n
# < rel accuracy, or
#
# \sqrt{d} < 2 * rel accuracy * n
#
# note that if the true probability is 0,
# so that n=0 identically, then the loop
# will never terminate; from the nature of
# the problem we know 0<p<1 so the loop
# will, eventually, terminate.
math_sqrt = math.sqrt
random_uniform = random.uniform
two_epsilon = 2. * abundance_rel_accuracy
n, d = 0, 0
while math_sqrt(d) >= two_epsilon * n:
dt = tuple(random_uniform(*window) for window in windows)
if all(abs(dt[i] - dt[j]) <= maxdt for i, j, maxdt in ijseq):
n += 1
d += 1
self.rate_factors[key] = float(n) / float(d)
for instrument in instruments:
self.rate_factors[key] *= 2. * self.tau[frozenset((anchor, instrument))]
self.rate_factors[key] = spatial.ConvexHull(spatial.HalfspaceIntersection(halfspaces, interior).intersections).volume
# done computing rate_factors
......
......@@ -6,11 +6,3 @@ test_scripts += \
date_verify.py \
snglcoinc_verify.py \
$(END_OF_LIST)
# with python-ligo-lw installed, and scipy<0.19.0
# snglcoinc_verify.py will fail, see lalburst's configure.ac and
# https://git.ligo.org/lscsoft/lalsuite/issues/208
# for more details
if !SNGLCOINC_XPASS
XFAIL_TESTS += snglcoinc_verify.py
endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment