Add py-sncosmo package

This commit is contained in:
Adam J. Stewart 2016-06-10 09:24:52 -05:00
parent f351e011d1
commit a660c60eb1
6 changed files with 237 additions and 25 deletions

View File

@ -24,29 +24,40 @@
##############################################################################
from spack import *
class PyAstropy(Package):
"""
The Astropy Project is a community effort to develop a single core
package for Astronomy in Python and foster interoperability between
Python astronomy packages.
"""
homepage = 'http://www.astropy.org/'
class PyAstropy(Package):
"""The Astropy Project is a community effort to develop a single core
package for Astronomy in Python and foster interoperability between
Python astronomy packages."""
homepage = 'http://www.astropy.org/'
url = 'https://pypi.python.org/packages/source/a/astropy/astropy-1.1.2.tar.gz'
version('1.1.2', 'cbe32023b5b1177d1e2498a0d00cda51')
version('1.1.post1', 'b52919f657a37d45cc45f5cb0f58c44d')
def url_for_version(self, version):
return 'https://pypi.python.org/packages/source/a/astropy/astropy-{0}.tar.gz'.format(version)
extends('python')
# Required dependencies
extends('python@2.6.5:2.7,3.3:')
depends_on('py-numpy@1.6.0:')
# Optional dependencies
depends_on('cfitsio')
depends_on('expat')
depends_on('py-h5py')
depends_on('py-numpy')
depends_on('py-pyyaml')
depends_on('py-scipy')
depends_on('py-matplotlib')
depends_on('py-pytz')
depends_on('py-scikit-image')
depends_on('py-pandas')
# TODO: Add packages
# depends_on('py-beautiful-soup')
# depends_on('py-xmllint')
# depends_on('py-wcsaxes')
# depends_on('py-objgraph')
def install(self, spec, prefix):
python('setup.py', 'build', '--use-system-cfitsio',
'--use-system-expat')
python('setup.py', 'install', '--prefix=' + prefix)
'--use-system-expat')
python('setup.py', 'install', '--prefix={0}'.format(prefix))

View File

@ -0,0 +1,41 @@
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
class PyEmcee(Package):
"""emcee is an MIT licensed pure-Python implementation of Goodman & Weare's
Affine Invariant Markov chain Monte Carlo (MCMC) Ensemble sampler."""
homepage = "http://dan.iel.fm/emcee/current/"
url = "https://pypi.python.org/packages/source/e/emcee/emcee-2.1.0.tar.gz"
version('2.1.0', 'c6b6fad05c824d40671d4a4fc58dfff7')
extends('python')
depends_on('py-numpy')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix={0}'.format(prefix))

View File

@ -23,23 +23,34 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
import re
class PyH5py(Package):
"""The h5py package provides both a high- and low-level interface to the HDF5 library from Python."""
"""The h5py package provides both a high- and low-level interface to the
HDF5 library from Python."""
homepage = "https://pypi.python.org/pypi/h5py"
url = "https://pypi.python.org/packages/source/h/h5py/h5py-2.4.0.tar.gz"
version('2.4.0', '80c9a94ae31f84885cc2ebe1323d6758')
version('2.6.0', 'ec476211bd1de3f5ac150544189b0bf4')
version('2.5.0', '6e4301b5ad5da0d51b0a1e5ac19e3b74')
version('2.4.0', '80c9a94ae31f84885cc2ebe1323d6758')
extends('python', ignore=lambda f: re.match(r'bin/cy*', f))
depends_on('hdf5')
depends_on('py-numpy')
variant('mpi', default=False, description='Build with MPI support')
extends('python', ignore=r'bin/cy.*')
depends_on('hdf5@1.8.4:+mpi', when='+mpi')
depends_on('hdf5@1.8.4:~mpi', when='~mpi')
depends_on('py-numpy@1.6.1:')
depends_on('py-cython')
depends_on('py-six')
depends_on('py-pkgconfig')
depends_on('mpi', when='+mpi')
def install(self, spec, prefix):
python('setup.py', 'configure', '--hdf5=%s' % spec['hdf5'].prefix)
python('setup.py', 'install', '--prefix=%s' % prefix)
python('setup.py', 'configure',
'--hdf5={0}'.format(spec['hdf5'].prefix))
if '+mpi' in spec:
env['CC'] = spec['mpi'].mpicc
python('setup.py', 'configure', '--mpi')
python('setup.py', 'install', '--prefix={0}'.format(prefix))

View File

@ -0,0 +1,54 @@
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
class PyIminuit(Package):
"""Interactive IPython-Friendly Minimizer based on SEAL Minuit2."""
homepage = "https://pypi.python.org/pypi/iminuit"
url = "https://pypi.python.org/packages/source/i/iminuit/iminuit-1.2.tar.gz"
version('1.2', '4701ec472cae42015e26251703e6e984')
# Required dependencies
extends('python@2.7:2.8,3.4:')
depends_on('py-setuptools')
# Optional dependencies
depends_on('py-numpy')
depends_on('py-matplotlib')
def install(self, spec, prefix):
site_packages = '{0}/lib/python{1}/site-packages'.format(
prefix, spec['python'].version.up_to(2))
# site-packages directory must already exist
mkdirp(site_packages)
# PYTHONPATH must include site-packages directory
env['PYTHONPATH'] += ':{0}'.format(site_packages)
python('setup.py', 'install', '--prefix={0}'.format(prefix))

View File

@ -0,0 +1,44 @@
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
class PyNestle(Package):
"""Nested sampling algorithms for evaluating Bayesian evidence."""
homepage = "http://kbarbary.github.io/nestle/"
url = "https://pypi.python.org/packages/source/n/nestle/nestle-0.1.1.tar.gz"
version('0.1.1', '4875c0f9a0a8e263c1d7f5fa6ce604c5')
# Required dependencies
extends('python')
depends_on('py-numpy@1.6:')
# Optional dependencies
depends_on('py-scipy')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix={0}'.format(prefix))

View File

@ -0,0 +1,51 @@
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
class PySncosmo(Package):
"""SNCosmo is a Python library for high-level supernova cosmology
analysis."""
homepage = "http://sncosmo.readthedocs.io/"
url = "https://pypi.python.org/packages/source/s/sncosmo/sncosmo-1.2.0.tar.gz"
version('1.2.0', '028e6d1dc84ab1c17d2f3b6378b2cb1e')
# Required dependencies
# py-sncosmo binaries are duplicates of those from py-astropy
extends('python@2.6:2.7,3.3:', ignore=r'bin/*')
depends_on('py-numpy')
depends_on('py-scipy')
depends_on('py-astropy')
# Recommended dependencies
depends_on('py-matplotlib')
depends_on('py-iminuit')
depends_on('py-emcee')
depends_on('py-nestle')
def install(self, spec, prefix):
python('setup.py', 'install', '--prefix={0}'.format(prefix))