Skip to content

Commit

Permalink
Merge pull request #544 from karandesai-96/cmontecarlo-extend-pr-530
Browse files Browse the repository at this point in the history
Continue cmontecarlo tests refactor. Extend #530.
  • Loading branch information
unoebauer committed May 10, 2016
2 parents ef235c6 + 51cbe16 commit 95b117d
Show file tree
Hide file tree
Showing 6 changed files with 243 additions and 793 deletions.
31 changes: 3 additions & 28 deletions tardis/montecarlo/setup_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,13 @@
def get_extensions():
sources = ['tardis/montecarlo/montecarlo.pyx']
sources += [os.path.relpath(fname) for fname in glob(
os.path.join(os.path.dirname(__file__), 'src', '*.c'))
if not os.path.basename(fname).startswith('test')]
os.path.join(os.path.dirname(__file__), 'src', '*.c'))]
sources += [os.path.relpath(fname) for fname in glob(
os.path.join(os.path.dirname(__file__), 'src/randomkit', '*.c'))]
deps = [os.path.relpath(fname) for fname in glob(
os.path.join(os.path.dirname(__file__), 'src', '*.h'))]
deps += [os.path.relpath(fname) for fname in glob(
os.path.join(os.path.dirname(__file__), 'src/randomkit', '*.h'))]
#tests = [os.path.relpath(fname) for fname in os.wakk(
# os.path.join(os.path.dirname(__file__), 'src', '*.c'))
# if os.path.basename(fname).startswith('test')]
test_sources = [
os.path.relpath(os.path.join(r,fname)) for r,p,fnames in os.walk(os.path.dirname(__file__))
for fname in fnames
if os.path.basename(fname).endswith('.c')
]
test_deps = [
os.path.relpath(os.path.join(r,fname)) for r,p,fnames in os.walk(os.path.dirname(__file__))
for fname in fnames
if os.path.basename(fname).endswith('.h')
]

return cythonize(
Extension('tardis.montecarlo.montecarlo', sources,
Expand All @@ -53,19 +39,8 @@ def get_extensions():
extra_compile_args=compile_args,
extra_link_args=link_args,
define_macros=define_macros)
) + [
# Test extension
Extension('tardis.montecarlo.test_montecarlo', test_sources,
include_dirs=['tardis/montecarlo/src',
'tardis/montecarlo/src/randomkit',
'numpy'],
depends=test_deps,
extra_compile_args=compile_args,
extra_link_args=link_args,
# library_dirs=['tardis/montecarlo'],
# libraries= ['montecarlo'],
define_macros=define_macros),
]
)


def get_package_data():
return {'tardis.montecarlo.tests':['data/*.npy']}
Loading

0 comments on commit 95b117d

Please sign in to comment.