Skip to content

Commit 2c1d3a1

Browse files
authored
fixing a bug - installation from .tar
1 parent 47de6fc commit 2c1d3a1

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
include *.md
22
include docs/index.rst
33
include LICENSE
4+
include Version
45
include requirements.txt
56
include spkit/__init__.py
67
include spkit/data/EEG16SecData.pkl
8+
include spkit/data/primitive_polynomials_GF2_dict.txt
79

810
recursive-include spkit *.py
911
recursive-include spkit *.txt

Version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.7
1+
0.0.8

setup.py

+14-3
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,21 @@
55
long_description = fh.read()
66

77
top_dir, _ = os.path.split(os.path.abspath(__file__))
8+
if os.path.isfile(os.path.join(top_dir, 'Version')):
9+
with open(os.path.join(top_dir, 'Version')) as f:
10+
version = f.readline().strip()
11+
else:
12+
import urllib
13+
Vpath = 'https://raw.githubusercontent.com/Nikeshbajaj/spkit/master/Version'
14+
version = urllib.request.urlopen(Vpath).read().strip().decode("utf-8")
815

9-
with open(os.path.join(top_dir, 'Version')) as f:
10-
version = f.readline().strip()
1116

1217
setuptools.setup(
1318
name="spkit",
1419
version= version,
1520
author="Nikesh Bajaj",
1621
author_email="[email protected]",
17-
description="SpKit: Signal Processing toolkit",
22+
description="SpKit: Signal Processing toolkit \n Author::Nikesh Bajaj \n https://github.com/Nikeshbajaj/spkit",
1823
long_description=long_description,
1924
long_description_content_type="text/markdown",
2025
url="https://github.com/Nikeshbajaj/spkit",
@@ -42,6 +47,12 @@
4247

4348
'Development Status :: 5 - Production/Stable',
4449
],
50+
project_urls={
51+
'Documentation': 'https://spkit.readthedocs.io/',
52+
'Say Thanks!': 'https://github.com/Nikeshbajaj',
53+
'Source': 'https://github.com/Nikeshbajaj/spkit',
54+
'Tracker': 'https://github.com/Nikeshbajaj/spkit/issues',
55+
},
4556
include_package_data=True,
4657
install_requires=['numpy','matplotlib','scipy','scikit-learn','python-picard']
4758
)

spkit/ml/Trees.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,13 @@ def __init__(self, min_samples_split=2, min_impurity=1e-7, max_depth=float("inf"
6767
self.verbose = None
6868
self.feature_names = None
6969
self.randomBranch=None
70-
70+
self.__author__ = 'Nikesh Bajaj'
7171
# Function to calculate impurity (classif.=>info gain, regr=>variance reduct.)
7272
self._impurity_calculation = None
7373

7474
# Function to determine prediction of y at leaf
7575
self._leaf_value_calculation = None
76+
7677
def fit(self, X, y):
7778
'''
7879
Building a tree and saving in an dictionary at self.tree
@@ -110,7 +111,7 @@ def fit(self, X, y):
110111
self.tree = self.pruneTree(self.tree)
111112
self.tree = self.pruneTree(self.tree)
112113
self.tree = self.pruneTree(self.tree)
113-
if self.verbose>0:
114+
if self.verbose:
114115
print('|\n|.........................tree is buit!')
115116
print('---------------------------------------')
116117
self.trained = True
@@ -504,7 +505,7 @@ def get_tree(self):
504505
print("No tree found, haven't trained yet!!")
505506
def set_featureNames(self,feature_names=None):
506507
if feature_names is None or len(feature_names)!=self.nfeatures:
507-
print('setting feature names to default..f1, f2....fn')
508+
if self.verbose: print('setting feature names to default..f1, f2....fn')
508509
self.feature_names = ['f'+str(i) for i in range(1,self.nfeatures+1)]
509510
else:
510511
self.feature_names = feature_names

0 commit comments

Comments
 (0)