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

Updated method order and updated caching on Circle CI #2

Merged
merged 2 commits into from
Apr 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Kruskals/kruskals.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class Kruskals(object):
"""
Class to organise running Josef Kruskal's algorithm
Class to run Josef Kruskal's algorithm
Parameters
----------
ndarr : numpy.ndarray (dtype: float/int)
Expand Down Expand Up @@ -53,6 +53,12 @@ def distance(self):
self._distance = (pij_row_mean + pijm_row_mean) / ((ind_c - 1) + fact)
return self._distance

def percentage(self):
"""
Distance as a relative percentage
"""
return self.distance() / self.distance().sum() * 100

def generate_diff(self, ndarr, arr):
"""
Internal method to calculate the difference between all points
Expand All @@ -73,9 +79,3 @@ def pcor_squared(ndarr):
"""
icvx = np.linalg.inv(np.cov(ndarr))
return (icvx[0, 1] * icvx[0, 1]) / (icvx[0, 0] * icvx[1, 1])

def percentage(self):
"""
Distance as a relative percentage
"""
return self.distance() / self.distance().sum() * 100
8 changes: 3 additions & 5 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ dependencies:
override:
- pip install tox tox-pyenv detox pytest-cov numpy pandas scipy codecov
- pyenv local 2.7.12 3.4.4 3.5.2 3.6.0
- if [[ ! -e .tox ]]; then tox --notest; fi
- ls .tox | tr " " "\n" | awk 'NR>1' | xargs -I {} -P 5 sh -c '.tox/{}/bin/pip install .'
cache_directories:
- "/home/ubuntu/CHAID/.tox/py27"
- "/home/ubuntu/CHAID/.tox/py34"
- "/home/ubuntu/CHAID/.tox/py35"
- "/home/ubuntu/CHAID/.tox/py36"
- "bin"
- ".tox"
test:
override:
- detox
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ skipsdist = True
envlist = py27,py34,py35,py36
[testenv]
commands =
pip install .
py.test
publish: python setup.py sdist upload --sign -r pypi