Skip to content

Commit 83e0316

Browse files
bump v0.15.4
1 parent a308ff4 commit 83e0316

File tree

15 files changed

+34
-159
lines changed

15 files changed

+34
-159
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ clean-build: ## remove build artifacts
3333
rm -fr .eggs/
3434
find . -name '*.egg-info' -exec rm -fr {} +
3535
find . -name '*.egg' -exec rm -f {} +
36+
find . -name '*.so' -exec rm -f {} +
3637

3738
clean-pyc: ## remove Python file artifacts
3839
find . -name '*.pyc' -exec rm -f {} +

mlsauce.egg-info/PKG-INFO

Lines changed: 0 additions & 36 deletions
This file was deleted.

mlsauce.egg-info/SOURCES.txt

Lines changed: 0 additions & 64 deletions
This file was deleted.

mlsauce.egg-info/dependency_links.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

mlsauce.egg-info/not-zip-safe

Lines changed: 0 additions & 1 deletion
This file was deleted.

mlsauce.egg-info/requires.txt

Lines changed: 0 additions & 14 deletions
This file was deleted.

mlsauce.egg-info/top_level.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

mlsauce/adaopt/_adaopt.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import pickle
23
import numpy as np
34
import pandas as pd
@@ -13,15 +14,11 @@
1314
from ..utils import cythonize_file
1415

1516
try:
16-
from . import _adaoptc as adaoptc
17-
except ModuleNotFoundError:
18-
try:
19-
cythonize_file("./_adaoptc.pyx")
20-
import _adaoptc
21-
except ModuleNotFoundError:
22-
subprocess.run(['python3', './fallbacksetup.py', 'build_ext', '--inplace'])
23-
import _adaoptc
24-
17+
from . import _adaoptc as adaoptc
18+
except ImportError:
19+
import pyximport; pyximport.install()
20+
import _adaoptc
21+
2522

2623
class AdaOpt(BaseEstimator, ClassifierMixin):
2724
"""AdaOpt classifier.

mlsauce/booster/_booster_classifier.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,8 @@
1212
try:
1313
from . import _boosterc as boosterc
1414
except ModuleNotFoundError:
15-
try:
16-
cythonize_file("./_boosterc.pyx")
17-
import _boosterc
18-
except ModuleNotFoundError:
19-
subprocess.run(['python3', './fallbacksetup.py', 'build_ext', '--inplace'])
20-
import _boosterc
15+
import pyximport; pyximport.install()
16+
import _boosterc
2117

2218

2319
class LSBoostClassifier(BaseEstimator, ClassifierMixin):

mlsauce/booster/_booster_regressor.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,8 @@
1212
try:
1313
from . import _boosterc as boosterc
1414
except ModuleNotFoundError:
15-
try:
16-
cythonize_file("./_boosterc.pyx")
17-
import _boosterc
18-
except ModuleNotFoundError:
19-
subprocess.run(['python3', './fallbacksetup.py', 'build_ext', '--inplace'])
20-
import _boosterc
15+
import pyximport; pyximport.install()
16+
import _boosterc
2117

2218
class LSBoostRegressor(BaseEstimator, RegressorMixin):
2319
"""LSBoost regressor.

mlsauce/booster/fallbacksetup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
dir_path = os.path.dirname(os.path.realpath(__file__))
66

7-
setup(ext_modules=cythonize(os.path.join(dir_path, "_stumpc.pyx"),
7+
setup(ext_modules=cythonize(os.path.join(dir_path, "_boosterc.pyx"),
88
compiler_directives={'language_level' : "3"}))

mlsauce/lasso/_lasso.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,8 @@
1717
try:
1818
from . import _lassoc as mo
1919
except ModuleNotFoundError:
20-
try:
21-
cythonize_file("./_lassoc.pyx")
22-
import _lassoc
23-
except ModuleNotFoundError:
24-
subprocess.run(['python3', './fallbacksetup.py', 'build_ext', '--inplace'])
25-
import _lassoc
20+
import pyximport; pyximport.install()
21+
import _lassoc
2622

2723

2824
class LassoRegressor(BaseEstimator, RegressorMixin):

mlsauce/ridge/_ridge.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,8 @@
1616
try:
1717
from . import _ridgec as mo
1818
except ModuleNotFoundError:
19-
try:
20-
cythonize_file("./_ridgec.pyx")
21-
import _ridgec
22-
except ModuleNotFoundError:
23-
subprocess.run(['python3', './fallbacksetup.py', 'build_ext', '--inplace'])
24-
import _ridgec
19+
import pyximport; pyximport.install()
20+
import _ridgec
2521

2622

2723
class RidgeRegressor(BaseEstimator, RegressorMixin):

mlsauce/stump/_stump_classifier.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@
77
try:
88
from . import _stumpc as stumpc
99
except ModuleNotFoundError:
10-
try:
11-
cythonize_file("./_stumpc.pyx")
12-
import _stumpc
13-
except ModuleNotFoundError:
14-
subprocess.run(['python3', './fallbacksetup.py', 'build_ext', '--inplace'])
15-
import _stumpc
10+
import pyximport; pyximport.install()
11+
import _stumpc
1612

1713

1814
class StumpClassifier(BaseEstimator, ClassifierMixin):

setup.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
MAINTAINER_EMAIL = 'thierry.moudiki@gmail.com'
3939
LICENSE = 'BSD3 Clause Clear'
4040

41-
__version__ = '0.15.3'
41+
__version__ = '0.15.4'
4242

4343
VERSION = __version__
4444

@@ -200,4 +200,18 @@ def setup_package():
200200
setup(**metadata)
201201

202202
if __name__ == "__main__":
203-
setup_package()
203+
204+
# /!\ do not change the order of execution of the following commands
205+
206+
setup_package()
207+
208+
dir_path = os.path.dirname(os.path.realpath(__file__))
209+
folders = ['adaopt', 'booster', 'lasso', 'ridge', 'stump']
210+
211+
for folder in folders:
212+
213+
filename = os.path.join(dir_path, "mlsauce", folder, 'fallbacksetup.py')
214+
215+
print(f"\n\n Running command: {filename} \n\n")
216+
217+
subprocess.run(['python3', filename, 'build_ext', '--inplace'])

0 commit comments

Comments
 (0)