Commit 5465f710 authored by Adam Mercer's avatar Adam Mercer

migrate minke branch

parent 837952ed
This diff is collapsed.
FROM ligo/lalsuite-runtime:jessie
COPY /opt/lalsuite /opt/lalsuite
ENV LD_LIBRARY_PATH="/opt/lalsuite/lib" \
OCTAVE_PATH="/opt/lalsuite/lib/x86_64-linux-gnu/octave/3.8.2/site/oct/x86_64-pc-linux-gnu" \
PATH="/opt/lalsuite/bin:${PATH}" \
PKG_CONFIG_PATH="/opt/lalsuite/lib/pkgconfig" \
PYTHONPATH="/opt/lalsuite/lib/python2.7/site-packages" \
# LALSuite
This is the main LALSuite development repository, past development is
captured in the repository below:
https://git.ligo.org/lscsoft/lalsuite-archive
This new repository utilizes [git-lfs](https://wiki.ligo.org/DASWG/GitLFS#Install_the_git_LFS_client) for the managament of large files and as such `git-lfs` needs to be installed and configured to correctly clone this repository. After installing `git-lfs` it can be configured using:
```
$ git lfs install
```
This only needs to be done once for each machine you access the repository. It can then be cloned using:
```
$ git clone git@git.ligo.org:lscsoft/lalsuite.git
```
AC_PREREQ([2.63])
AC_INIT([LALSuite],[6.48.1],[lal-discuss@ligo.org])
AC_INIT([LALSuite],[6.46.1],[lal-discuss@ligo.org])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_AUX_DIR([gnuscripts])
AC_CONFIG_MACRO_DIR([gnuscripts])
......
# -*- mode: autoconf; -*-
# lalsuite_build.m4 - top level build macros
#
# serial 141
# serial 138
# restrict which LALSUITE_... patterns can appearing in output (./configure);
# useful for debugging problems with unexpanded LALSUITE_... Autoconf macros
......@@ -44,11 +44,6 @@ AC_DEFUN([AC_OUTPUT],[
AC_SUBST(AM_[]uvar,"${AM_[]uvar} ${sys_[]uvar}")
uvar="${uvar_prefix[]uvar}"
])
# append extra values for user variables to be added after configuration
m4_foreach_w([uvar],uvar_list,[
AC_ARG_VAR([POSTCONFIG_]uvar,[Extra ]uvar[ to be added after configuration])
uvar="${uvar} ${POSTCONFIG_[]uvar}"
])
# call original AC_OUTPUT
lalsuite_AC_OUTPUT
])
......@@ -1146,7 +1141,7 @@ AS_IF([test "x${osx_version_check}" = "xtrue"],[
AC_MSG_RESULT([$MACOSX_VERSION])])
AS_CASE(["$MACOSX_VERSION"],
[10.0*|10.1|10.1.*|10.2*|10.3*],AC_MSG_ERROR([This version of Mac OS X is not supported]),
[10.4*|10.5*|10.6*|10.7*|10.8*|10.9*|10.10*|10.11*|10.12*|10.13*],,
[10.4*|10.5*|10.6*|10.7*|10.8*|10.9*|10.10*|10.11*|10.12*],,
AC_MSG_WARN([Unknown Mac OS X version]))
])])])
......@@ -1398,8 +1393,6 @@ double volatile d = round(c);
])
m4_popdef([option])
m4_popdef([symbol])
])
# string listing all the SIMD extensions supported by the compiler
......
......@@ -131,7 +131,7 @@ swig_octave_flags = -octave $(SWIG_OCTAVE_FLAGS) -outdir swiglal_octave/ $(swig_
octexec_LTLIBRARIES = swiglal_octave.la
nodist_swiglal_octave_la_SOURCES = swiglal_octave.cpp
swiglal_octave_la_SOURCES = SWIGTest.c
swiglal_octave_la_CPPFLAGS = $(SWIG_OCTAVE_CPPFLAGS_IOCTAVE) $(swig_cppflags) $(SWIG_OCTAVE_CPPFLAGS) $(LAL_SYSTEM_INCLUDES)
swiglal_octave_la_CPPFLAGS = $(SWIG_OCTAVE_CPPFLAGS_IOCTAVE) $(swig_cppflags) $(SWIG_OCTAVE_CPPFLAGS)
swiglal_octave_la_CXXFLAGS = $(SWIG_OCTAVE_CXXFLAGS)
swiglal_octave_la_LDFLAGS = $(LDADD) $(swig_ldflags) $(SWIG_OCTAVE_LDFLAGS)
swiglal_octave_la_LIBTOOLFLAGS = $(swig_libtoolflags)
......@@ -186,8 +186,8 @@ pkgpyexec_LTLIBRARIES = swiglal_python.la
nodist_pkgpyexec_PYTHON = swiglal_python/$(PACKAGE).py
nodist_swiglal_python_la_SOURCES = swiglal_python.c
swiglal_python_la_SOURCES = SWIGTest.c
swiglal_python_la_CPPFLAGS = $(swig_cppflags) $(SWIG_PYTHON_CPPFLAGS) $(LAL_SYSTEM_INCLUDES)
swiglal_python_la_CFLAGS = $(SWIG_PYTHON_CFLAGS)
swiglal_python_la_CPPFLAGS = $(swig_cppflags) $(SWIG_PYTHON_CPPFLAGS)
swiglal_python_la_LDFLAGS = $(LDADD) $(swig_ldflags) $(SWIG_PYTHON_LDFLAGS) $(EXTRA_SWIG_PYTHON_LDFLAGS)
swiglal_python_la_LIBTOOLFLAGS = $(swig_libtoolflags)
......
......@@ -2,7 +2,7 @@
# lalsuite_swig.m4 - SWIG configuration
# Author: Karl Wette, 2011--2017
#
# serial 102
# serial 98
AC_DEFUN([_LALSUITE_CHECK_SWIG_VERSION],[
# $0: check the version of $1, and store it in ${swig_version}
......@@ -54,7 +54,7 @@ AC_DEFUN([LALSUITE_ENABLE_SWIG],[
# C++ is required to build Octave wrappings
LALSUITE_REQUIRE_CXX
])
LALSUITE_ENABLE_SWIG_LANGUAGE([Python],[true],[
LALSUITE_ENABLE_SWIG_LANGUAGE([Python],[false],[
# Python is required to configure Python wrappings
LALSUITE_REQUIRE_PYTHON([2.6])
])
......@@ -115,8 +115,7 @@ AC_DEFUN([LALSUITE_USE_SWIG],[
_LALSUITE_CHECK_SWIG_VERSION([${SWIG}])
LALSUITE_VERSION_COMPARE([${swig_version}],[<],[${swig_min_version}],[
AC_MSG_RESULT([no (${swig_version})])
AC_MSG_ERROR([[SWIG version ${swig_min_version} or later is required ${swig_min_version_info}
SWIG support can be disabled by using the --disable-swig configure option]])
AC_MSG_ERROR([SWIG version ${swig_min_version} or later is required ${swig_min_version_info}])
])
AC_MSG_RESULT([yes (${swig_version})])
],[
......@@ -132,8 +131,7 @@ SWIG support can be disabled by using the --disable-swig configure option]])
AC_MSG_RESULT([no (${swig_version})])
])
],[
AC_MSG_ERROR([[SWIG version ${swig_min_version} or later is required ${swig_min_version_info}
SWIG support can be disabled by using the --disable-swig configure option]])
AC_MSG_ERROR([SWIG version ${swig_min_version} or later is required ${swig_min_version_info}])
])
SWIG="${ac_cv_path_SWIG}"
])
......@@ -226,11 +224,6 @@ AC_DEFUN([LALSUITE_USE_SWIG_OCTAVE],[
# $0: configure SWIG Octave bindings
LALSUITE_USE_SWIG_LANGUAGE([Octave],[C++],[
# check for GSL, needed for LAL complex number support in C++
PKG_CHECK_MODULES([GSL],[gsl],[true],[false])
LALSUITE_ADD_FLAGS([C],[${GSL_CFLAGS}],[${GSL_LIBS}])
AC_CHECK_HEADERS([gsl/gsl_complex.h],,[AC_MSG_ERROR([could not find the gsl/gsl_complex.h header])])
# check for Octave
AC_PATH_PROGS(OCTAVE,[octave-cli octave],[],[])
AS_IF([test "x${OCTAVE}" = x],[
......@@ -418,19 +411,6 @@ AC_DEFUN([LALSUITE_USE_SWIG_PYTHON],[
# $0: configure SWIG Python bindings
LALSUITE_USE_SWIG_LANGUAGE([Python],[C],[
# check Python version
AC_MSG_CHECKING([${PYTHON} version])
AS_IF([test "x${PYTHON_VERSION}" = x],[
AC_MSG_ERROR([could not determine ${PYTHON} version])
])
AC_MSG_RESULT([${PYTHON_VERSION}])
LALSUITE_VERSION_COMPARE([${PYTHON_VERSION}],[>=],[3.0.0],[
LALSUITE_VERSION_COMPARE([${swig_min_version}],[<],[3.0.9],[
swig_min_version=3.0.9
swig_min_version_info="for Python version ${PYTHON_VERSION}"
])
])
# check for distutils
AC_MSG_CHECKING([for distutils])
cat <<EOD | ${PYTHON} - 2>/dev/null
......
......@@ -7,7 +7,6 @@
*.pc
*.pyc
*.pyo
__pycache__
.adoc
.deps
.dvi-dep
......@@ -57,8 +56,7 @@ src/lal_version
src/stamp-h1
src/stamp-h2
src/version.c
swig/swiglal.i*
swig/swiglal_*
swig/swiglal*
test/*/*.dat
test/*/*.out
test/*/*.txt
......@@ -141,7 +139,6 @@ test/utilities/EigenTest
test/utilities/FindRootTest
test/utilities/IntegrateTest
test/utilities/InterpolateTest
test/utilities/LALBitsetTest
test/utilities/LALHashFuncTest
test/utilities/LALHashTblTest
test/utilities/LALHeapTest
......
......@@ -31,6 +31,6 @@ For More Information
Please visit the [LALSuite project page][project].
[install]: https://wiki.ligo.org/DASWG/LALSuiteInstall
[install]: http://www.lsc-group.phys.uwm.edu/daswg/docs/howto/lal-install.html
[bugs]: https://bugs.ligo.org/redmine/projects/lalsuite
[project]: https://wiki.ligo.org/DASWG/LALSuite
......@@ -20,7 +20,7 @@ doxygen_redir_1 =
html-local: Makefile $(CONFIG_CLEAN_FILES)
$(AM_V_at)set -e; \
echo "$(subdir)/Makefile: getting input sources ..."; \
( cd $(top_builddir) && $(MAKE) V=$(V) distdir $(doxygen_redir) ); \
( cd $(top_builddir) && make V=$(V) distdir $(doxygen_redir) ); \
rm -rf in/; \
mv "$(top_builddir)/$(PACKAGE)-$(VERSION)/" in/; \
rm -rf in/doxygen/; \
......@@ -33,14 +33,6 @@ html-local: Makefile $(CONFIG_CLEAN_FILES)
doxygen_version="$${doxygen_version}-$${gitid}$${unclean}"; \
fi; \
fi; \
for tagfile in $(DOXYGEN_TAGFILES); do \
tagfile=`echo "$${tagfile}" | $(SED) 's/=.*$$//'`; \
if ! test -r "$${tagfile}"; then \
echo "$(subdir)/Makefile: ERROR: missing tag file $${tagfile}" >&2; \
echo "$(subdir)/Makefile: (hint: you may need to rebuild the Doxygen documentation for the corresponding library)" >&2; \
exit 1; \
fi; \
done; \
export doxygen_tagfiles; doxygen_tagfiles="$(DOXYGEN_TAGFILES)"; \
export doxygen_quiet; doxygen_quiet="$(doxygen_quiet)"; \
export doxygen_exclude; doxygen_exclude=`cat $(abs_srcdir)/exclude.list | tr '\n' ' '`; \
......
......@@ -30,4 +30,4 @@ for elem in tree.iter('docanchor'):
anchors[elem.text] = 1
for anchor in anchors:
if anchors[anchor] > 1:
print('%s: warning: duplicate anchor %s' % (tagfile, anchor))
print '%s: warning: duplicate anchor %s' % (tagfile, anchor)
......@@ -4,7 +4,13 @@
__version__ = "@PACKAGE_VERSION@"
## \addtogroup lal_python
"""This package provides Python wrappings and extensions to LAL"""
"""This package provides Python wrappings and extensions to the @ref lal_general and @ref lal_math.
"""
#@{
# \defgroup lal_py_gpstime GPSTime
# \defgroup lal_py_spectrum Spectrum
# \defgroup lal_py_utils Utilities
#@}
#
# =============================================================================
......
......@@ -14,8 +14,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
## \defgroup lal_py_gpstime GPSTime
## \ingroup lal_python
## \addtogroup lal_py_gpstime
"""Utilties for calculating and modifying GPS times using the LAL date
package
"""
......@@ -47,8 +46,7 @@ except ImportError:
raise ImportError("LAL SWIG-wrappings are not available, you must install "
"these to use the gpstime module")
from . import git_version
import git_version
__author__ = "Duncan Macleod <duncan.macleod@ligo.org>"
__version__ = git_version.verbose_msg
__date__ = git_version.date
......
......@@ -618,13 +618,13 @@ class LinearPlusOverflowBins(LoHiCountBins):
raise IndexError(x)
def lower(self):
return numpy.concatenate((numpy.array([NegInf]), numpy.linspace(self.min, self.max - self.delta, len(self) - 1)))
return numpy.concatenate((numpy.array([NegInf]), self.min + self.delta * numpy.arange(len(self) - 2), numpy.array([self.max])))
def centres(self):
return numpy.concatenate((numpy.array([NegInf]), numpy.linspace(self.min + self.delta / 2., self.max - self.delta / 2., len(self) - 2), numpy.array([PosInf])))
return numpy.concatenate((numpy.array([NegInf]), self.min + self.delta * (numpy.arange(len(self) - 2) + 0.5), numpy.array([PosInf])))
def upper(self):
return numpy.concatenate((numpy.linspace(self.min + self.delta, self.max, len(self) - 1), numpy.array([PosInf])))
return numpy.concatenate((numpy.array([self.min]), self.min + self.delta * (numpy.arange(len(self) - 2) + 1), numpy.array([PosInf])))
#
# XML I/O related methods and data
......@@ -1486,49 +1486,12 @@ class BinnedArray(object):
"""
Add the contents of another BinnedArray object to this one.
Both must have identical binnings.
Example:
>>> x = BinnedArray(NDBins((LinearBins(-0.5, 1.5, 2), LinearBins(-0.5, 1.5, 2))))
>>> x[0, 0] = 0
>>> x[0, 1] = 1
>>> x[1, 0] = 2
>>> x[1, 1] = 4
>>> x.at_centres()
array([[ 0., 1.],
[ 2., 4.]])
>>> x += x
>>> x.at_centres()
array([[ 0., 2.],
[ 4., 8.]])
"""
if self.bins != other.bins:
raise TypeError("incompatible binning: %s" % repr(other))
self.array += other.array
return self
def __add__(self, other):
"""
Add two BinnedArray objects together.
Example:
>>> x = BinnedArray(NDBins((LinearBins(-0.5, 1.5, 2), LinearBins(-0.5, 1.5, 2))))
>>> x[0, 0] = 0
>>> x[0, 1] = 1
>>> x[1, 0] = 2
>>> x[1, 1] = 4
>>> x.at_centres()
array([[ 0., 1.],
[ 2., 4.]])
>>> (x + x).at_centres()
array([[ 0., 2.],
[ 4., 8.]])
"""
self = self.copy()
self += other
return self
def copy(self):
"""
Return a copy of the BinnedArray. The .bins attribute is
......@@ -1551,14 +1514,14 @@ class BinnedArray(object):
item retrieval and assignment some additional work might be
required to obtain this array. In those cases, this method
is a convenience wrapper to avoid coding the evaluation
logic in the calling code.
loop in the calling code.
Because subclasses expect to be able to override this, in
almost all cases calling code that wishes to access the
values stored in the internal array directly should
probably use this method to do so.
almost call cases calling code that wishes to access the
internal array directly should probably use this method
instead.
NOTE:
Notes:
- The return value might be a newly-constructed object or a
reference to an internal object.
......@@ -1585,16 +1548,7 @@ class BinnedArray(object):
def to_pdf(self):
"""
Normalize the internal array's contents so that when
multiplied by the corresponding bin volumes the result sums
to 1 (neglecting bins with infinite volume).
NOTE:
- This is a legacy method that has been superceded by the
BinnedDensity and BinnedLnPDF classes. You almost
certainly want to be using those instead of whatever
you're doing that needs this method.
Convert into a probability density.
"""
# zero bins whose volumes are infinite so the rest will
# appear to be normalized
......@@ -1609,13 +1563,6 @@ class BinnedArray(object):
Find bins <= 0, and set them to epsilon, This has the
effect of allowing the logarithm of the array to be
evaluated without error.
NOTE:
- This is a legacy method that has been superceded by the
BinnedDensity and BinnedLnPDF classes. You almost
certainly want to be using those instead of whatever
you're doing that needs this method.
"""
self.array[self.array <= 0] = epsilon
return self
......@@ -2048,7 +1995,7 @@ class BinnedLnPDF(BinnedDensity):
As with the BinnedDensity class, the internal array contains counts
(not densities, nor natural logarithms of densities), and the
.count attribute continues to be a BinnedArray interface to those
.counts attribute continues to be a BinnedArray interface to those
counts. The intention is for the counts themselves to provide an
additional degree of freedom apart from the normalized density.
For example, see the .__iadd__() method where it is assumed that
......@@ -2090,7 +2037,7 @@ class BinnedLnPDF(BinnedDensity):
>>> # ln probability density = ln 1/(2 * 3) = -1.791759469228055
>>> y.at_centres()
array([ -inf, -1.79175947, -1.79175947, -1.79175947, -inf])
>>> # assuming \\sqrt{N} counting fluctuations, compute the fractional uncertainty
>>> # assuming \\sqrt{N} counting flucutations, compute the fractional uncertainty
>>> import numpy
>>> d = BinnedArray(x.bins, 1. / numpy.sqrt(x.count.at_centres()))
>>> d.at_centres()
......@@ -2102,7 +2049,7 @@ class BinnedLnPDF(BinnedDensity):
"""
def __init__(self, *args, **kwargs):
super(BinnedLnPDF, self).__init__(*args, **kwargs)
self.normalize()
self.norm = 0.0
def __getitem__(self, coords):
return numpy.log(super(BinnedLnPDF, self).__getitem__(coords)) - self.norm
......@@ -2160,7 +2107,7 @@ class BinnedLnPDF(BinnedDensity):
# between them are preserved. forbidden cases include:
# infinite bin size, total count is initially 0.
#
raise NotImplementedError("item assignment operation not defined. assign to .count then invoke .normalize()")
raise NotImplementedError("item assignment operation not defined. assign to .counts then invoke .normalize()")
def mkinterp(self):
"""
......@@ -2203,8 +2150,7 @@ class BinnedLnPDF(BinnedDensity):
return InterpBinnedArray(self)
def at_centres(self):
with numpy.errstate(divide = "ignore", invalid = "ignore"):
return numpy.log(super(BinnedLnPDF, self).at_centres()) - self.norm
return numpy.log(super(BinnedLnPDF, self).at_centres()) - self.norm
def marginalize(self, dim):
new = super(BinnedLnPDF, self).marginalize(dim)
......@@ -2249,11 +2195,6 @@ class BinnedLnPDF(BinnedDensity):
self.norm = other.norm + math.log1p(math.exp(self.norm - other.norm))
return self
def __add__(self, other):
self = super(BinnedLnPDF, self).__add__(other)
self.normalize()
return self
def copy(self):
new = super(BinnedLnPDF, self).copy()
new.norm = self.norm
......@@ -2270,9 +2211,7 @@ class BinnedLnPDF(BinnedDensity):
accounted for in the normalization although the density
reported for those bins will be 0.
"""
self.norm = self.array.sum()
assert self.norm >= 0.
self.norm = math.log(self.norm) if self.norm != 0. else NegInf
self.norm = math.log(self.array.sum())
def to_xml(self, *args, **kwargs):
elem = super(BinnedLnPDF, self).to_xml(*args, **kwargs)
......
......@@ -33,7 +33,6 @@ from glue.ligolw import ligolw
from glue.ligolw import array as ligolw_array