Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a restructure of the C-file file structure #210

Merged
merged 10 commits into from
Dec 11, 2014
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ __pycache__
# Ignore .c files by default to avoid including generated code. If you want to
# add a non-generated .c extension, use `git add -f filename.c`.
*.c
!tardis/montecarlo/src/*.c

# Other generated files
*/version.py
Expand Down
2 changes: 1 addition & 1 deletion tardis/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import scipy.special

from tardis import packet_source, plasma_array
import montecarlo
from tardis.montecarlo import montecarlo
from util import intensity_black_body


Expand Down
1 change: 1 addition & 0 deletions tardis/montecarlo/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 1 addition & 1 deletion tardis/montecarlo.pyx → tardis/montecarlo/montecarlo.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ np.import_array()

ctypedef np.int64_t int_type_t

cdef extern from "cmontecarlo.h":
cdef extern from "src/cmontecarlo.h":
ctypedef enum rpacket_status_t:
TARDIS_PACKET_STATUS_IN_PROCESS = 0
TARDIS_PACKET_STATUS_EMITTED = 1
Expand Down
19 changes: 19 additions & 0 deletions tardis/montecarlo/setup_package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#setting the right include
from setuptools import Extension
import numpy as np
import os

from glob import glob


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'))]
sources += [os.path.relpath(fname) for fname in glob(
os.path.join(os.path.dirname(__file__), 'src/randomkit', '*.c'))]

return [Extension('tardis.montecarlo.montecarlo', sources,
include_dirs=['tardis/montecarlo/src',
'tardis/montecarlo/src/randomkit',
np.get_include()])]
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include "randomkit.h"
#include "randomkit/randomkit.h"

#ifdef __clang__
#define INLINE extern inline
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 0 additions & 22 deletions tardis/parallel.py

This file was deleted.

13 changes: 0 additions & 13 deletions tardis/setup_package.py

This file was deleted.