From 03b21d091fa4714a557536faf77995ac5af743c7 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Tue, 3 Oct 2023 20:24:49 -0400 Subject: [PATCH 01/12] ruff __init__ --- giddy/__init__.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/giddy/__init__.py b/giddy/__init__.py index 8e89fee..2b9aa05 100644 --- a/giddy/__init__.py +++ b/giddy/__init__.py @@ -7,10 +7,10 @@ """ -from . import directional -from . import ergodic -from . import markov -from . import mobility -from . import rank -from . import util -from . import sequence +from . import directional # noqa F401, E402 +from . import ergodic # noqa F401, E402 +from . import markov # noqa F401, E402 +from . import mobility # noqa F401, E402 +from . import rank # noqa F401, E402 +from . import util # noqa F401, E402 +from . import sequence # noqa F401, E402 From fe4db564c88f9d0e2b5b966b0a648f7938c8f6d9 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Tue, 3 Oct 2023 20:28:02 -0400 Subject: [PATCH 02/12] ruff directional - check commented out --- giddy/directional.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/giddy/directional.py b/giddy/directional.py index f3999d4..682e9a7 100644 --- a/giddy/directional.py +++ b/giddy/directional.py @@ -6,7 +6,7 @@ __all__ = ["Rose"] -import warnings + import numpy as np from libpysal import weights from libpysal.common import requires as _requires @@ -27,7 +27,8 @@ class Rose(object): Parameters ---------- Y : array (n,2) - Columns correspond to end-point time periods to calculate LISA vectors for n object. + Columns correspond to end-point time periods to + calculate LISA vectors for n object. w : PySAL W Spatial weights object. k : int @@ -349,10 +350,10 @@ def plot_origin(self): # TODO add attribute option to color vectors Plot vectors of positional transition of LISA values starting from the same origin. """ - import matplotlib.cm as cm + #import matplotlib.cm as cm import matplotlib.pyplot as plt - ax = plt.subplot(111) + #ax = plt.subplot(111) xlim = [self._dx.min(), self._dx.max()] ylim = [self._dy.min(), self._dy.max()] for x, y in zip(self._dx, self._dy): From a4b3f4e0a3d9678d742eb494d46a87f9e9c5945c Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Tue, 3 Oct 2023 20:32:13 -0400 Subject: [PATCH 03/12] ruff ergodic --- giddy/ergodic.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/giddy/ergodic.py b/giddy/ergodic.py index 73d91ff..a0a9186 100644 --- a/giddy/ergodic.py +++ b/giddy/ergodic.py @@ -124,7 +124,7 @@ def steady_state(P, fill_empty_classes=False): ... ValueError: Input transition probability matrix has 1 rows full of 0s. Please set fill_empty_classes=True to set diagonal elements for these rows to be 1 to make sure the matrix is stochastic. - """ + """ # noqa E501 P = np.asarray(P) rows0 = (P.sum(axis=1) == 0).sum() @@ -204,7 +204,7 @@ def _mfpt_ergodic(P): for i in range(k): A[:, i] = ss A = A.transpose() - I = np.identity(k) + I = np.identity(k) # noqa E741 Z = la.inv(I - P + A) E = np.ones_like(Z) A_diag = np.diag(A) @@ -293,7 +293,7 @@ def mfpt(P, fill_empty_classes=False): Traceback (most recent call last): ... ValueError: Input transition probability matrix has 1 rows full of 0s. Please set fill_empty_classes=True to set diagonal elements for these rows to be 1 to make sure the matrix is stochastic. - """ + """ # noqa E501 P = np.asarray(P) rows0 = (P.sum(axis=1) == 0).sum() @@ -353,7 +353,10 @@ def mfpt(P, fill_empty_classes=False): def var_fmpt_ergodic(p): warn( - "var_fmpt_ergodic is deprecated. It will be replaced in giddy 2.5 with var_fmpt_ergodic", + ( + "var_fmpt_ergodic is deprecated. It will be " + "replaced in giddy 2.5 with var_fmpt_ergodic" + ), DeprecationWarning, stacklevel=2, ) @@ -398,7 +401,7 @@ def var_mfpt_ergodic(p): k = P.shape[0] A = _steady_state_ergodic(P) A = np.tile(A, (k, 1)) - I = np.identity(k) + I = np.identity(k) # noqa E741 Z = la.inv(I - P + A) E = np.ones_like(Z) D = np.diag(1.0 / np.diag(A)) From 891b425a50fa1619a03a00f22929b2c93676f012 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Tue, 3 Oct 2023 20:48:52 -0400 Subject: [PATCH 04/12] ruff markov - check commented out --- giddy/markov.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/giddy/markov.py b/giddy/markov.py index 6876613..84bce93 100644 --- a/giddy/markov.py +++ b/giddy/markov.py @@ -19,7 +19,6 @@ from .ergodic import steady_state, mfpt from .util import fill_empty_diagonals from .components import Graph -from warnings import warn from scipy import stats from scipy.stats import rankdata from operator import gt @@ -282,12 +281,12 @@ def __init__(self, class_ids, classes=None, fill_empty_classes=False, summary=Tr ) print(*self.astates_indices, sep=", ") - @property - def mfpt(self): - warn("self._mfpt is deprecated. Please use self._mfpt") - if not hasattr(self, "_mfpt"): - self._mfpt = mfpt(self.p, fill_empty_classes=True) - return self._mfpt + #@property + #def mfpt(self): + # warn("self._mfpt is deprecated. Please use self._mfpt") + # if not hasattr(self, "_mfpt"): + # self._mfpt = mfpt(self.p, fill_empty_classes=True) + # return self._mfpt @property def mfpt(self): @@ -708,7 +707,9 @@ class Spatial_Markov(object): We can easily adjust this assigning `fill_empty_classes = True` when initializing `Spatial_Markov`. - >>> sm = Spatial_Markov(rpci, w, cutoffs=cc, lag_cutoffs=cc, fill_empty_classes=True) + >>> sm = Spatial_Markov( + ... rpci, w, cutoffs=cc, lag_cutoffs=cc, fill_empty_classes=True + ... ) >>> for p in sm.P: ... print(p) [[0.96703297 0.03296703 0. 0. 0. ] @@ -1127,7 +1128,7 @@ def chi2(T1, T2): .. math:: - E_{i,j} = \sum_j T1_{i,j} * T2_{i,j}/\sum_j T2_{i,j} + E_{i,j} = \\sum_j T1_{i,j} * T2_{i,j}/\\sum_j T2_{i,j} Degrees of freedom corrected for any rows in either T1 or T2 that have zero total transitions. @@ -1849,7 +1850,7 @@ def summary(self, file_name=None, title="Markov Homogeneity Test"): lead = "-" * width head = title.center(width) contents = [lead, head, lead] - l = "Number of regimes: %d" % int(self.m) + l = "Number of regimes: %d" % int(self.m) # noqa E741 k = "Number of classes: %d" % int(self.k) r = "Regime names: " r += ", ".join(regime_names) @@ -2085,13 +2086,13 @@ def sojourn_time(p, summary=True): >>> sojourn_time(p) Sojourn times are infinite for absorbing states! In this Markov Chain, states [2] are absorbing states. array([ 2., 1., inf]) - """ + """ # noqa E501 p = np.asarray(p) if (p.sum(axis=1) == 0).sum() > 0: p = fill_empty_diagonals(p) - markovchain = qe.MarkovChain(p) + #markovchain = qe.MarkovChain(p) pii = p.diagonal() if not (1 - pii).all(): @@ -2212,8 +2213,10 @@ class GeoRank_Markov(Markov): """ def __init__(self, y, fill_empty_classes=False, summary=True): + y = np.asarray(y) - n = y.shape[0] + #n = y.shape[0] + # resolve ties: All values are given a distinct rank, corresponding # to the order that the values occur in each cross section. ranks = np.array([rankdata(col, method="ordinal") for col in y.T]).T From 5a00d05dc40443013ec5e19d9484d67344a8f170 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Tue, 3 Oct 2023 20:51:11 -0400 Subject: [PATCH 05/12] ruff rank - check commented out --- giddy/rank.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/giddy/rank.py b/giddy/rank.py index d89fff9..f1be977 100644 --- a/giddy/rank.py +++ b/giddy/rank.py @@ -16,7 +16,6 @@ from scipy.stats.mstats import rankdata from scipy.special import erfc import numpy as np -import scipy as sp from libpysal import weights @@ -184,7 +183,7 @@ def _calc(self, x, y): n = len(y) perm = list(range(n)) perm.sort(key=lambda a: (x[a], y[a])) - vals = y[perm] + #vals = y[perm] ExtraY = 0 ExtraX = 0 ACount = 0 @@ -315,8 +314,9 @@ class SpatialTau(object): taus : float spatial tau values for permuted samples (if permutations>0). tau_spatial_psim : float - one-sided pseudo p-value for observed tau_spatial under the null - of spatial randomness of rank exchanges (if permutations>0). + one-sided pseudo p-value for observed tau_spatial + under the null of spatial randomness of rank exchanges + (if permutations>0). Notes ----- From 9007cd458fd310bedbf470850886cee62436dd5e Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Tue, 3 Oct 2023 20:56:46 -0400 Subject: [PATCH 06/12] ruff sequence --- giddy/sequence.py | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/giddy/sequence.py b/giddy/sequence.py index 4eb3ccd..6ecd2c6 100644 --- a/giddy/sequence.py +++ b/giddy/sequence.py @@ -84,7 +84,14 @@ class Sequence(object): 1.2 User-defined substitution cost matrix and indel cost - >>> subs_mat = np.array([[0, 0.76, 0.29, 0.05],[0.30, 0, 0.40, 0.60],[0.16, 0.61, 0, 0.26],[0.38, 0.20, 0.12, 0]]) + >>> subs_mat = np.array( + ... [ + ... [0, 0.76, 0.29, 0.05], + ... [0.30, 0, 0.40, 0.60], + ... [0.16, 0.61, 0, 0.26], + ... [0.38, 0.20, 0.12, 0] + ... ] + ... ) >>> indel = subs_mat.max() >>> seqAna = Sequence([seq1,seq2,seq3], subs_mat=subs_mat, indel=indel) >>> seqAna.seq_dis_mat @@ -117,7 +124,14 @@ class Sequence(object): between different types is always 1 and indel cost is 2) - give the same sequence distance matrix as "hamming" distance - >>> subs_mat = np.array([[0., 1., 1., 1.],[1., 0., 1., 1.],[1., 1., 0., 1.],[1., 1., 1., 0.]]) + >>> subs_mat = np.array( + ... [ + ... [0., 1., 1., 1.], + ... [1., 0., 1., 1.], + ... [1., 1., 0., 1.], + ... [1., 1., 1., 0.] + ... ] + ... ) >>> indel = 2 >>> seqAna = Sequence([seq1,seq2,seq3], subs_mat=subs_mat, indel=indel) >>> seqAna.seq_dis_mat @@ -130,7 +144,14 @@ class Sequence(object): slightly different sequence distance matrix from "hamming" distance since insertion and deletion is happening - >>> subs_mat = np.array([[0., 1., 1., 1.],[1., 0., 1., 1.],[1., 1., 0.,1.],[1., 1., 1., 0.]]) + >>> subs_mat = np.array( + ... [ + ... [0., 1., 1., 1.], + ... [1., 0., 1., 1.], + ... [1., 1., 0., 1.], + ... [1., 1., 1., 0.] + ... ] + ... ) >>> indel = 1 >>> seqAna = Sequence([seq1,seq2,seq3], subs_mat=subs_mat, indel=indel) >>> seqAna.seq_dis_mat @@ -151,7 +172,7 @@ class Sequence(object): >>> seqAna = Sequence([seq1,seq2,seq3], indel=indel) Traceback (most recent call last): ValueError: Please specify a proper `dist_type` or `subs_mat` and `indel` to proceed! - """ + """ # noqa E501 def __init__(self, y, subs_mat=None, dist_type=None, indel=None, cluster_type=None): y = np.asarray(y) From 147140f4844b2ee321f2ce8efc677364f53c0239 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Tue, 3 Oct 2023 20:56:59 -0400 Subject: [PATCH 07/12] ruff test_sequence --- giddy/tests/test_sequence.py | 1 - 1 file changed, 1 deletion(-) diff --git a/giddy/tests/test_sequence.py b/giddy/tests/test_sequence.py index 8c2ae05..02426f5 100644 --- a/giddy/tests/test_sequence.py +++ b/giddy/tests/test_sequence.py @@ -1,4 +1,3 @@ -import unittest import numpy as np import pytest from ..sequence import Sequence From f689cea08226d71de30165a828cb7d2e580e8d6e Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Tue, 3 Oct 2023 20:57:32 -0400 Subject: [PATCH 08/12] re-blacken --- giddy/directional.py | 4 ++-- giddy/markov.py | 9 ++++----- giddy/rank.py | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/giddy/directional.py b/giddy/directional.py index 682e9a7..13c5188 100644 --- a/giddy/directional.py +++ b/giddy/directional.py @@ -350,10 +350,10 @@ def plot_origin(self): # TODO add attribute option to color vectors Plot vectors of positional transition of LISA values starting from the same origin. """ - #import matplotlib.cm as cm + # import matplotlib.cm as cm import matplotlib.pyplot as plt - #ax = plt.subplot(111) + # ax = plt.subplot(111) xlim = [self._dx.min(), self._dx.max()] ylim = [self._dy.min(), self._dy.max()] for x, y in zip(self._dx, self._dy): diff --git a/giddy/markov.py b/giddy/markov.py index 84bce93..1ccd529 100644 --- a/giddy/markov.py +++ b/giddy/markov.py @@ -281,8 +281,8 @@ def __init__(self, class_ids, classes=None, fill_empty_classes=False, summary=Tr ) print(*self.astates_indices, sep=", ") - #@property - #def mfpt(self): + # @property + # def mfpt(self): # warn("self._mfpt is deprecated. Please use self._mfpt") # if not hasattr(self, "_mfpt"): # self._mfpt = mfpt(self.p, fill_empty_classes=True) @@ -2092,7 +2092,7 @@ def sojourn_time(p, summary=True): if (p.sum(axis=1) == 0).sum() > 0: p = fill_empty_diagonals(p) - #markovchain = qe.MarkovChain(p) + # markovchain = qe.MarkovChain(p) pii = p.diagonal() if not (1 - pii).all(): @@ -2213,9 +2213,8 @@ class GeoRank_Markov(Markov): """ def __init__(self, y, fill_empty_classes=False, summary=True): - y = np.asarray(y) - #n = y.shape[0] + # n = y.shape[0] # resolve ties: All values are given a distinct rank, corresponding # to the order that the values occur in each cross section. diff --git a/giddy/rank.py b/giddy/rank.py index f1be977..8ef936b 100644 --- a/giddy/rank.py +++ b/giddy/rank.py @@ -183,7 +183,7 @@ def _calc(self, x, y): n = len(y) perm = list(range(n)) perm.sort(key=lambda a: (x[a], y[a])) - #vals = y[perm] + # vals = y[perm] ExtraY = 0 ExtraX = 0 ACount = 0 From 9972017c6617dd0e081f7ab177f6e3a94a2a9515 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Tue, 3 Oct 2023 20:59:10 -0400 Subject: [PATCH 09/12] adding pre-commit --- .pre-commit-config.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..78f73a7 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +files: "giddy\/" +repos: + - repo: https://github.com/psf/black + rev: "23.9.1" + hooks: + - id: black + language_version: python3 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.0.292" + hooks: + - id: ruff + +ci: + autofix_prs: false + autoupdate_schedule: quarterly From 0ca8a5312b9a7bcd2627bbf021e2cba420389abd Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Thu, 5 Oct 2023 13:19:48 -0400 Subject: [PATCH 10/12] update raw string input --- giddy/markov.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/giddy/markov.py b/giddy/markov.py index 1ccd529..3a1507c 100644 --- a/giddy/markov.py +++ b/giddy/markov.py @@ -1076,7 +1076,7 @@ def _maybe_classify(self, y, k, cutoffs): def chi2(T1, T2): - """ + r""" chi-squared test of difference between two transition matrices. Parameters @@ -1128,7 +1128,7 @@ def chi2(T1, T2): .. math:: - E_{i,j} = \\sum_j T1_{i,j} * T2_{i,j}/\\sum_j T2_{i,j} + E_{i,j} = \sum_j T1_{i,j} * T2_{i,j}/\sum_j T2_{i,j} Degrees of freedom corrected for any rows in either T1 or T2 that have zero total transitions. From 8a7e6f97f530ea59d3ba1755e72bd9ab5d24a209 Mon Sep 17 00:00:00 2001 From: Wei Kang Date: Tue, 17 Oct 2023 09:51:01 -0500 Subject: [PATCH 11/12] remove noqa comments and resolve issues in https://github.com/pysal/giddy/pull/202 --- giddy/__init__.py | 14 +++++++------- giddy/ergodic.py | 22 +++++++++++----------- giddy/markov.py | 13 +++---------- giddy/sequence.py | 2 +- 4 files changed, 22 insertions(+), 29 deletions(-) diff --git a/giddy/__init__.py b/giddy/__init__.py index 2b9aa05..8e89fee 100644 --- a/giddy/__init__.py +++ b/giddy/__init__.py @@ -7,10 +7,10 @@ """ -from . import directional # noqa F401, E402 -from . import ergodic # noqa F401, E402 -from . import markov # noqa F401, E402 -from . import mobility # noqa F401, E402 -from . import rank # noqa F401, E402 -from . import util # noqa F401, E402 -from . import sequence # noqa F401, E402 +from . import directional +from . import ergodic +from . import markov +from . import mobility +from . import rank +from . import util +from . import sequence diff --git a/giddy/ergodic.py b/giddy/ergodic.py index a0a9186..12497ae 100644 --- a/giddy/ergodic.py +++ b/giddy/ergodic.py @@ -124,7 +124,7 @@ def steady_state(P, fill_empty_classes=False): ... ValueError: Input transition probability matrix has 1 rows full of 0s. Please set fill_empty_classes=True to set diagonal elements for these rows to be 1 to make sure the matrix is stochastic. - """ # noqa E501 + """ P = np.asarray(P) rows0 = (P.sum(axis=1) == 0).sum() @@ -201,17 +201,17 @@ def _mfpt_ergodic(P): k = P.shape[0] A = np.zeros_like(P) ss = _steady_state_ergodic(P) - for i in range(k): - A[:, i] = ss + for j in range(k): + A[:, j] = ss A = A.transpose() - I = np.identity(k) # noqa E741 - Z = la.inv(I - P + A) + i = np.identity(k) + Z = la.inv(i - P + A) E = np.ones_like(Z) A_diag = np.diag(A) A_diag = A_diag + (A_diag == 0) D = np.diag(1.0 / A_diag) Zdg = np.diag(np.diag(Z)) - M = (I - Z + E.dot(Zdg)).dot(D) + M = (i - Z + E.dot(Zdg)).dot(D) return M @@ -293,7 +293,7 @@ def mfpt(P, fill_empty_classes=False): Traceback (most recent call last): ... ValueError: Input transition probability matrix has 1 rows full of 0s. Please set fill_empty_classes=True to set diagonal elements for these rows to be 1 to make sure the matrix is stochastic. - """ # noqa E501 + """ P = np.asarray(P) rows0 = (P.sum(axis=1) == 0).sum() @@ -401,13 +401,13 @@ def var_mfpt_ergodic(p): k = P.shape[0] A = _steady_state_ergodic(P) A = np.tile(A, (k, 1)) - I = np.identity(k) # noqa E741 - Z = la.inv(I - P + A) + i = np.identity(k) + Z = la.inv(i - P + A) E = np.ones_like(Z) D = np.diag(1.0 / np.diag(A)) Zdg = np.diag(np.diag(Z)) - M = (I - Z + E.dot(Zdg)).dot(D) + M = (i - Z + E.dot(Zdg)).dot(D) ZM = Z.dot(M) ZMdg = np.diag(np.diag(ZM)) - W = M.dot(2 * Zdg.dot(D) - I) + 2 * (ZM - E.dot(ZMdg)) + W = M.dot(2 * Zdg.dot(D) - i) + 2 * (ZM - E.dot(ZMdg)) return np.array(W - np.multiply(M, M)) diff --git a/giddy/markov.py b/giddy/markov.py index 3a1507c..6166d9f 100644 --- a/giddy/markov.py +++ b/giddy/markov.py @@ -281,13 +281,6 @@ def __init__(self, class_ids, classes=None, fill_empty_classes=False, summary=Tr ) print(*self.astates_indices, sep=", ") - # @property - # def mfpt(self): - # warn("self._mfpt is deprecated. Please use self._mfpt") - # if not hasattr(self, "_mfpt"): - # self._mfpt = mfpt(self.p, fill_empty_classes=True) - # return self._mfpt - @property def mfpt(self): if not hasattr(self, "_mfpt"): @@ -1850,14 +1843,14 @@ def summary(self, file_name=None, title="Markov Homogeneity Test"): lead = "-" * width head = title.center(width) contents = [lead, head, lead] - l = "Number of regimes: %d" % int(self.m) # noqa E741 + L = "Number of regimes: %d" % int(self.m) k = "Number of classes: %d" % int(self.k) r = "Regime names: " r += ", ".join(regime_names) t = "Number of transitions: %d" % int(self.t_total) contents.append(k) contents.append(t) - contents.append(l) + contents.append(L) contents.append(r) contents.append(lead) h = "%7s %20s %20s" % ("Test", "LR", "Chi-2") @@ -2086,7 +2079,7 @@ def sojourn_time(p, summary=True): >>> sojourn_time(p) Sojourn times are infinite for absorbing states! In this Markov Chain, states [2] are absorbing states. array([ 2., 1., inf]) - """ # noqa E501 + """ p = np.asarray(p) if (p.sum(axis=1) == 0).sum() > 0: diff --git a/giddy/sequence.py b/giddy/sequence.py index 6ecd2c6..8d9d481 100644 --- a/giddy/sequence.py +++ b/giddy/sequence.py @@ -172,7 +172,7 @@ class Sequence(object): >>> seqAna = Sequence([seq1,seq2,seq3], indel=indel) Traceback (most recent call last): ValueError: Please specify a proper `dist_type` or `subs_mat` and `indel` to proceed! - """ # noqa E501 + """ def __init__(self, y, subs_mat=None, dist_type=None, indel=None, cluster_type=None): y = np.asarray(y) From fc9993fdf8309b53dc7fbf9a2e7e749fe00e5e9d Mon Sep 17 00:00:00 2001 From: Wei Kang Date: Tue, 17 Oct 2023 09:53:53 -0500 Subject: [PATCH 12/12] remove lines that are redundant --- giddy/directional.py | 2 -- giddy/rank.py | 1 - 2 files changed, 3 deletions(-) diff --git a/giddy/directional.py b/giddy/directional.py index 13c5188..6136881 100644 --- a/giddy/directional.py +++ b/giddy/directional.py @@ -350,10 +350,8 @@ def plot_origin(self): # TODO add attribute option to color vectors Plot vectors of positional transition of LISA values starting from the same origin. """ - # import matplotlib.cm as cm import matplotlib.pyplot as plt - # ax = plt.subplot(111) xlim = [self._dx.min(), self._dx.max()] ylim = [self._dy.min(), self._dy.max()] for x, y in zip(self._dx, self._dy): diff --git a/giddy/rank.py b/giddy/rank.py index 8ef936b..efb6cf2 100644 --- a/giddy/rank.py +++ b/giddy/rank.py @@ -183,7 +183,6 @@ def _calc(self, x, y): n = len(y) perm = list(range(n)) perm.sort(key=lambda a: (x[a], y[a])) - # vals = y[perm] ExtraY = 0 ExtraX = 0 ACount = 0