-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
74 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=46", | ||
"wheel", | ||
"oldest-supported-numpy", | ||
] | ||
build-backend = "setuptools.build_meta" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
[metadata] | ||
name = redmapper | ||
description = Python implementation of redMaPPer cluster finder | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown | ||
author = Eli Rykoff | ||
url = https://github.com/erykoff/redmapper | ||
author_email = [email protected] | ||
classifiers = | ||
Intended Audience :: Science/Research | ||
License :: OSI Approved :: Apache Software License | ||
Operating System :: POSIX :: Linux | ||
Operating System :: MacOS | ||
Programming Language :: C | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
Programming Language :: Python :: 3.10 | ||
|
||
[options] | ||
packages = find: | ||
python_requires = >=3.8 | ||
install_requires = | ||
astropy | ||
matplotlib | ||
pyyaml | ||
fitsio | ||
esutil | ||
numpy | ||
scipy | ||
healsparse | ||
hpgeom | ||
tests_require = | ||
pytest | ||
zip_safe = True | ||
|
||
[options.packages.find] | ||
exclude = | ||
tests | ||
|
||
[options.package_data] | ||
redmapper = data/initcolors/*.fit, data/mstar/*.fit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
# -*- coding: utf-8 -*- | ||
from setuptools import setup, Extension | ||
import numpy | ||
import os | ||
|
||
from setuptools import setup, find_packages, Extension, Command | ||
import numpy,os,glob | ||
|
||
with open('README.md') as f: | ||
readme = f.read() | ||
|
||
with open('LICENSE') as f: | ||
license = f.read() | ||
|
||
exec(open('redmapper/_version.py').read()) | ||
|
||
|
@@ -31,55 +25,30 @@ | |
'bin/redmapper_weight_randoms.py', | ||
'bin/redmapper_predict_memory.py'] | ||
|
||
include_dirs = [numpy.get_include()] | ||
|
||
ext_modules=[] | ||
|
||
# solver_nfw | ||
solver_nfw_sources=['redmapper/solver_nfw/solver_nfw_pywrap.c', | ||
'redmapper/solver_nfw/solver_nfw.c', | ||
'redmapper/solver_nfw/nfw_weights.c'] | ||
solver_nfw_module = Extension('redmapper.solver_nfw._solver_nfw_pywrap', | ||
extra_compile_args=['-std=gnu99'], | ||
sources=solver_nfw_sources, | ||
include_dirs=include_dirs) | ||
ext_modules.append(solver_nfw_module) | ||
|
||
# chisq_dist | ||
chisq_dist_sources=['redmapper/chisq_dist/chisq_dist.c', | ||
'redmapper/chisq_dist/chisq_dist_pywrap.c'] | ||
chisq_dist_module = Extension('redmapper.chisq_dist._chisq_dist_pywrap', | ||
extra_compile_args=['-std=gnu99',os.path.expandvars('-I${GSLI}')], | ||
extra_link_args=[os.path.expandvars('-L${GSLL}')], | ||
libraries=['gsl', 'gslcblas'], | ||
sources=chisq_dist_sources, | ||
include_dirs=include_dirs) | ||
ext_modules.append(chisq_dist_module) | ||
solver_nfw_ext = Extension( | ||
"redmapper.solver_nfw._solver_nfw_pywrap", | ||
extra_compile_args=["-std=gnu99"], | ||
sources=[ | ||
"redmapper/solver_nfw/solver_nfw_pywrap.c", | ||
"redmapper/solver_nfw/solver_nfw.c", | ||
"redmapper/solver_nfw/nfw_weights.c", | ||
], | ||
) | ||
|
||
class CleanCommand(Command): | ||
"""Custom clean command to tidy up the project root.""" | ||
user_options = [] | ||
def initialize_options(self): | ||
pass | ||
def finalize_options(self): | ||
pass | ||
def run(self): | ||
os.system('rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info') | ||
chisq_dist_ext = Extension( | ||
"redmapper.chisq_dist._chisq_dist_pywrap", | ||
extra_compile_args=["-std=gnu99", os.path.expandvars("-I${GSLI}")], | ||
extra_link_args=[os.path.expandbars("-L${GSLL}")], | ||
libraries=["gsl", "gslcblas"], | ||
sources=[ | ||
"redmapper/chisq_dist/chisq_dist.c", | ||
"redmapper/chisq_dist/chisq_dist_pywrap.c", | ||
], | ||
) | ||
|
||
setup( | ||
name='redmapper', | ||
ext_modules=[solver_nfw_ext, chisq_dist_ext], | ||
include_dirs=numpy.get_include(), | ||
version=__version__, | ||
description='Public, Python implementation of redMaPPer', | ||
long_description=readme, | ||
author='Eli Rykoff, Brett Harvey', | ||
author_email='[email protected], [email protected]', | ||
url='https://github.com/erykoff/redmapper', | ||
license=license, | ||
ext_modules=ext_modules, | ||
scripts=scripts, | ||
install_requires=['numpy'], | ||
packages=find_packages(exclude=('tests', 'docs')), | ||
include_package_data=True, | ||
cmdclass={'clean': CleanCommand} | ||
) | ||
|