aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gensvm/core.py2
-rw-r--r--gensvm/cython_wrapper/wrapper.pxd (renamed from src/wrapper.pxd)0
-rw-r--r--gensvm/cython_wrapper/wrapper.pyx (renamed from src/wrapper.pyx)0
-rw-r--r--gensvm/gridsearch.py2
-rw-r--r--setup.py16
5 files changed, 8 insertions, 12 deletions
diff --git a/gensvm/core.py b/gensvm/core.py
index a729bea..77a3a7f 100644
--- a/gensvm/core.py
+++ b/gensvm/core.py
@@ -18,7 +18,7 @@ from sklearn.utils import check_X_y, check_random_state
from sklearn.utils.multiclass import type_of_target
from sklearn.utils.validation import check_is_fitted
-from . import wrapper
+from .cython_wrapper import wrapper
def _fit_gensvm(X, y, n_class, p, lmd, kappa, epsilon, weights, kernel, gamma,
diff --git a/src/wrapper.pxd b/gensvm/cython_wrapper/wrapper.pxd
index 441c15b..441c15b 100644
--- a/src/wrapper.pxd
+++ b/gensvm/cython_wrapper/wrapper.pxd
diff --git a/src/wrapper.pyx b/gensvm/cython_wrapper/wrapper.pyx
index 4ded637..4ded637 100644
--- a/src/wrapper.pyx
+++ b/gensvm/cython_wrapper/wrapper.pyx
diff --git a/gensvm/gridsearch.py b/gensvm/gridsearch.py
index e49d3ce..d5ea31e 100644
--- a/gensvm/gridsearch.py
+++ b/gensvm/gridsearch.py
@@ -25,7 +25,7 @@ from sklearn.utils import check_X_y
from sklearn.utils.multiclass import type_of_target
from sklearn.utils.validation import indexable
-from . import wrapper
+from .cython_wrapper import wrapper
from .core import GenSVM
from .sklearn_util import (_skl_format_cv_results, _skl_check_scorers,
_skl_check_is_fitted, _skl_grid_score)
diff --git a/setup.py b/setup.py
index 1d8a873..c70b81d 100644
--- a/setup.py
+++ b/setup.py
@@ -94,18 +94,14 @@ def configuration():
# Wrapper code in Cython uses the .pyx extension if we want to USE_CYTHON,
# otherwise it ends in .c.
- wrappers = [
- os.path.join('src', 'wrapper.pyx'),
- ]
- if not USE_CYTHON:
- wrappers = [os.path.splitext(w)[0] + '.c' for w in wrappers]
+ wrapper_extension = "*.pyx" if USE_CYTHON else "*.c"
# Sources include the C/Cython code from the wrapper and the source code of
# the C library
- gensvm_sources = wrappers[:]
- gensvm_sources.append([
- os.path.join('src', 'gensvm', 'src', '*.c'),
- ])
+ gensvm_sources = [
+ os.path.join("gensvm", "cython_wrapper", wrapper_extension),
+ os.path.join("src", "gensvm", "src", "*.c"),
+ ]
# Dependencies are the header files of the C library and any potential
# helper code between the library and the Cython code
@@ -115,7 +111,7 @@ def configuration():
]
from numpy import get_include
- config.add_extension('wrapper',
+ config.add_extension('cython_wrapper.wrapper',
sources=gensvm_sources,
libraries=cblas_libs,
include_dirs=[