From 710d3aa452bd47eba8bf3ae51d75552a75bc90ed Mon Sep 17 00:00:00 2001 From: Mark Ramotowski Date: Sat, 1 Apr 2017 19:05:11 +0100 Subject: [PATCH 1/2] Updated method order --- Kruskals/kruskals.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Kruskals/kruskals.py b/Kruskals/kruskals.py index b719188..613959e 100644 --- a/Kruskals/kruskals.py +++ b/Kruskals/kruskals.py @@ -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) @@ -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 @@ -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 From e7a9a806e08f390ab2536ae0e93bef86a045372a Mon Sep 17 00:00:00 2001 From: Mark Ramotowski Date: Mon, 3 Apr 2017 12:45:24 +0100 Subject: [PATCH 2/2] Improved circle run speed --- circle.yml | 8 +++----- tox.ini | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/circle.yml b/circle.yml index 9f8ad9d..2d9a758 100644 --- a/circle.yml +++ b/circle.yml @@ -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 diff --git a/tox.ini b/tox.ini index bf9f524..578b2c1 100644 --- a/tox.ini +++ b/tox.ini @@ -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