[pysal] 01/02: Add patch to fix TabErrors.
Bas Couwenberg
sebastic at debian.org
Sat Jul 30 23:27:05 UTC 2016
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch master
in repository pysal.
commit 600c7d1c2760af4abfca3dfd31c2f9c5104e3b00
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Sun Jul 31 01:08:44 2016 +0200
Add patch to fix TabErrors.
---
debian/changelog | 1 +
debian/patches/series | 1 +
debian/patches/taberror.patch | 130 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 132 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 270dcc7..3312f42 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ pysal (1.11.2-3) UNRELEASED; urgency=medium
* Team upload.
* Remove unneeded conditional in reproducible-build-and-output.patch.
+ * Add patch to fix TabErrors.
-- Bas Couwenberg <sebastic at debian.org> Sat, 30 Jul 2016 20:00:20 +0200
diff --git a/debian/patches/series b/debian/patches/series
index 2c793e3..8600986 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
unusual-interpreter.patch
reproducible-build-and-output.patch
+taberror.patch
diff --git a/debian/patches/taberror.patch b/debian/patches/taberror.patch
new file mode 100644
index 0000000..2e87d79
--- /dev/null
+++ b/debian/patches/taberror.patch
@@ -0,0 +1,130 @@
+Description: Fix TabErrors.
+ Sorry: TabError: inconsistent use of tabs and spaces in indentation (klincs.py, line 34)
+ Sorry: TabError: inconsistent use of tabs and spaces in indentation (lincs.py, line 287)
+Author: Bas Couwenberg <sebastic at debian.org>
+
+--- a/pysal/contrib/network/klincs.py
++++ b/pysal/contrib/network/klincs.py
+@@ -31,11 +31,11 @@ class WeightedRandomSampleGenerator(obje
+ """
+
+ def __init__(self, weights, population, n):
+- """
+- weights: an iterable with m numeric elements
+- population: a numpy array with m elements
+- n: an integer representing sample size
+- """
++ """
++ weights: an iterable with m numeric elements
++ population: a numpy array with m elements
++ n: an integer representing sample size
++ """
+ self.totals = np.cumsum(weights)
+ self.population = population
+ self.n = n
+@@ -57,10 +57,10 @@ class RandomSampleGenerator(object):
+ from a population group
+ """
+ def __init__(self, population, n):
+- """
+- population: a numpy array with m elements
+- n: an integer representing sample size
+- """
++ """
++ population: a numpy array with m elements
++ n: an integer representing sample size
++ """
+ self.population = population
+ self.n = n
+
+--- a/pysal/contrib/network/lincs.py
++++ b/pysal/contrib/network/lincs.py
+@@ -284,11 +284,11 @@ def lincs(network, event, base, weight,
+ w, edges, e, b, edges_geom = None, None, None, None, []
+ if weight == 'Node-based':
+ w, edges = node_weights(network, attribute=True)
+- n = len(edges)
+- e, b = np.zeros(n), np.zeros(n)
+- for edge in edges:
++ n = len(edges)
++ e, b = np.zeros(n), np.zeros(n)
++ for edge in edges:
+ edges_geom.append(edges[edge][0])
+- e[edge] = edges[edge][event]
++ e[edge] = edges[edge][event]
+ b[edge] = getBase(edges, edge, base)
+ w.id_order = edges.keys()
+ elif dist is not None:
+@@ -298,50 +298,50 @@ def lincs(network, event, base, weight,
+ network[n1][n2] = network[n1][n2][0]
+ w, edges = dist_weights(network, id2edgepoints, edge2id, dist)
+ n = len(id2attr)
+- e, b = np.zeros(n), np.zeros(n)
++ e, b = np.zeros(n), np.zeros(n)
+ if base:
+ base -= 1
+- for edge in id2attr:
++ for edge in id2attr:
+ edges_geom.append(edges[edge])
+- e[edge] = id2attr[edge][event - 1]
++ e[edge] = id2attr[edge][event - 1]
+ b[edge] = getBase(id2attr, edge, base)
+ w.id_order = id2attr.keys()
+
+ Is, p_sim, Zs = None,None, None
+ if sim_method == 'permutation':
+ if lisa_func == pysal.esda.moran.Moran_Local:
+- lisa_i = lisa_func(e*1.0/b,w,transformation="r",permutations=sim_num)
++ lisa_i = lisa_func(e*1.0/b,w,transformation="r",permutations=sim_num)
+ Is = lisa_i.Is
+ Zs = lisa_i.q
+ else:
+- lisa_i = lisa_func(e*1.0/b,w,transform="R",permutations=sim_num,star=star)
++ lisa_i = lisa_func(e*1.0/b,w,transform="R",permutations=sim_num,star=star)
+ Is = lisa_i.Gs
+ Zs = lisa_i.Zs
+ p_sim = lisa_i.p_sim
+ else:
+- sims = None
++ sims = None
+ if lisa_func == pysal.esda.moran.Moran_Local:
+- lisa_i = lisa_func(e*1.0/b,w,transformation="r",permutations=0)
++ lisa_i = lisa_func(e*1.0/b,w,transformation="r",permutations=0)
+ Is = lisa_i.Is
+ Zs = lisa_i.q
+ else:
+- lisa_i = lisa_func(e*1.0/b,w,transform="R",permutations=0,star=star)
+- Is = lisa_i.Gs
+- Zs = lisa_i.Zs
+- if sim_method == 'binomial':
+- sims = unconditional_sim(e, b, sim_num)
+- elif sim_method == 'poisson':
+- sims = unconditional_sim_poisson(e, b, sim_num)
+- else:
+- sims = conditional_multinomial(e, b, sim_num)
++ lisa_i = lisa_func(e*1.0/b,w,transform="R",permutations=0,star=star)
++ Is = lisa_i.Gs
++ Zs = lisa_i.Zs
++ if sim_method == 'binomial':
++ sims = unconditional_sim(e, b, sim_num)
++ elif sim_method == 'poisson':
++ sims = unconditional_sim_poisson(e, b, sim_num)
++ else:
++ sims = conditional_multinomial(e, b, sim_num)
+ if lisa_func == pysal.esda.moran.Moran_Local:
+- for i in range(sim_num):
+- sims[:,i] = lisa_func(sims[:,i]*1.0/b,w,transformation="r",permutations=0).Is
++ for i in range(sim_num):
++ sims[:,i] = lisa_func(sims[:,i]*1.0/b,w,transformation="r",permutations=0).Is
+ else:
+- for i in range(sim_num):
+- sims[:,i] = lisa_func(sims[:,i]*1.0/b,w,permutations=0,star=star).Gs
+- sim_res = pseudo_pvalues(Is, sims)
+- p_sim = sim_res[0]
++ for i in range(sim_num):
++ sims[:,i] = lisa_func(sims[:,i]*1.0/b,w,permutations=0,star=star).Gs
++ sim_res = pseudo_pvalues(Is, sims)
++ p_sim = sim_res[0]
+
+ w.transform = 'O'
+ return zip(edges_geom, e, b, Is, Zs, p_sim), w
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pysal.git
More information about the Pkg-grass-devel
mailing list