Skip to content

Commit

Permalink
Merge pull request #210 from wkerzendorf/montecarlo/restructure
Browse files Browse the repository at this point in the history
a restructure of the C-file file structure
  • Loading branch information
ssim committed Dec 11, 2014
2 parents 496f478 + 11bedc6 commit c0dbc5b
Show file tree
Hide file tree
Showing 19 changed files with 24 additions and 38 deletions.
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.
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.

0 comments on commit c0dbc5b

Please sign in to comment.