Skip to content

Commit ed33f20

Browse files
[pre-commit.ci] pre-commit autoupdate (#349)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 22.12.0 → 23.1.0](psf/black@22.12.0...23.1.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 761e2c1 commit ed33f20

23 files changed

+1
-37
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 22.12.0
3+
rev: 23.1.0
44
hooks:
55
- id: black
66
language_version: python3

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def _get_requirements_from_files(groups_files):
2020

2121

2222
def setup_package():
23-
2423
_groups_files = {
2524
"base": "requirements.txt", # basic requirements
2625
"docs": "requirements_docs.txt", # requirements for building docs

spopt/locate/coverage.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ def from_cost_matrix(
247247
)
248248

249249
if demand_quantity_arr is not None:
250-
251250
sum_demand = demand_quantity_arr.sum()
252251
sum_capacity = facility_capacity_arr.sum()
253252
if sum_demand > sum_capacity:

spopt/locate/util.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ def simulated_geo_points(
8585
numpy.random.seed(seed)
8686

8787
while not simulated_points_all:
88-
8988
# generate (x,y) coordinates within bounding box of ``geom``
9089
x = numpy.random.uniform(xmin, xmax, 1)
9190
y = numpy.random.uniform(ymin, ymax, 1)

spopt/region/azp.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ def __init__(
131131
initial_labels=None,
132132
objective_func=ObjectiveFunctionPairwise(),
133133
):
134-
135134
self.gdf = gdf
136135
self.w = w
137136
self.attrs_name = attrs_name
@@ -862,7 +861,6 @@ def fit_from_scipy_sparse_matrix(
862861
initial_labels = self.azp.labels_
863862

864863
if old_sol is not None:
865-
866864
if (old_sol == initial_labels).all():
867865
break
868866
# added termination condition (not in Openshaw & Rao (1995))
@@ -1096,7 +1094,6 @@ def _azp_connected_component(self, adj, initial_clustering, attr):
10961094
if self.allow_move_strategy(
10971095
aspiration_move.area, aspiration_move.new_region, labels
10981096
):
1099-
11001097
self._make_move(
11011098
aspiration_move.area,
11021099
aspiration_move.new_region,

spopt/region/azp_util.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ def __call__(self, moving_area, new_region, labels):
6464
self.objective_val += diff
6565
return True
6666
else:
67-
6867
return False
6968

7069

@@ -86,7 +85,6 @@ def __call__(self, moving_area, new_region, labels):
8685
self.notify_move_made()
8786
return True
8887
else:
89-
9088
prob = math.exp(-diff / self.t)
9189
move_allowed = random.random() < prob
9290
if move_allowed:

spopt/region/maxp.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ def growClusterForPoly(
310310
i = 0
311311

312312
while i < len(NeighborPolys):
313-
314313
if spatialAttrTotal >= spatialThre:
315314
break
316315
Pn = NeighborPolys[i]
@@ -802,7 +801,6 @@ def __init__(
802801
verbose=False,
803802
policy="single",
804803
):
805-
806804
self.gdf = gdf
807805
self.w = w
808806
self.attrs_name = attrs_name

spopt/region/random_region.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ def __init__(
141141
max_swaps=1000000,
142142
permutations=99,
143143
):
144-
145144
solutions = []
146145
for i in range(permutations):
147146
solutions.append(
@@ -280,7 +279,6 @@ def __init__(
280279
compact=False,
281280
max_swaps=1000000,
282281
):
283-
284282
self.n = len(area_ids)
285283
ids = copy.copy(area_ids)
286284
self.ids = list(np.random.permutation(ids))
@@ -439,7 +437,6 @@ def build_contig_regions(
439437
grow_region = self.grow_free
440438
iter = 0
441439
while iter < maxiter:
442-
443440
# regionalization setup
444441
regions = []
445442
size_pre = 0
@@ -461,7 +458,6 @@ def build_contig_regions(
461458
size_pre = len(regions)
462459
# test if swapping is needed
463460
if counter == len(candidates):
464-
465461
# start swapping
466462
# -- swapping simply changes the candidate list
467463
swap_in = None # area to become new candidate

spopt/region/ward.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ class WardSpatial(BaseSpOptHeuristicSolver):
6969
"""
7070

7171
def __init__(self, gdf, w, attrs_name, n_clusters=5, clustering_kwds=dict()):
72-
7372
self.gdf = gdf
7473
self.w = w
7574
self.attrs_name = attrs_name

spopt/tests/test_azp.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
class TestAZP:
1818
def setup_method(self):
19-
2019
self.mexico = MEXICO.copy()
2120

2221
# labels for from_w:

0 commit comments

Comments
 (0)