Skip to content

Commit 1ec5647

Browse files
committed
CircleCI: v2.1 + docker auth + small resource executor; update dependencies
1 parent c845330 commit 1ec5647

File tree

4 files changed

+24
-12
lines changed

4 files changed

+24
-12
lines changed

algorithms/recursive_backtracker.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ def on(self, grid: Grid) -> None:
2626
walked_path = []
2727
walked_path.append(self.starting_cell)
2828

29-
while len(walked_path) > 0:
29+
while walked_path:
3030
current_cell = walked_path[-1]
3131

32-
unvisited_neighbors = [neighbor for neighbor in current_cell.neighbors if len(neighbor.links) == 0]
33-
if len(unvisited_neighbors) == 0:
32+
unvisited_neighbors = [neighbor for neighbor in current_cell.neighbors if not neighbor.links]
33+
if not unvisited_neighbors:
3434
walked_path.pop()
3535
else:
3636
neighbor = choice(unvisited_neighbors)

circle.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1-
version: 2
1+
version: 2.1
2+
3+
workflows:
4+
build-and-test:
5+
jobs:
6+
- build:
7+
context: dockerauth
8+
29
jobs:
310
build:
411
docker:
5-
- image: circleci/python:3.6.1
12+
- image: circleci/python:3.8
13+
auth:
14+
username: $DOCKERHUB_USERNAME
15+
password: $DOCKERHUB_PASSWORD
16+
resource_class: small
617
steps:
718
- checkout
819
- run: sudo pip install -r requirements.txt

demos/stats_demo.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import argparse
22
import time
33

4-
from typing import cast, Union
4+
from typing import cast, Dict, Type, Union
55

6+
from algorithms.base_algorithm import Algorithm
67
from base.grid import Grid
78
from base.distance_grid import DistanceGrid
89

@@ -27,8 +28,8 @@
2728
pathfinding = args.pathfinding
2829

2930
algorithm_averages = {}
30-
algorithm_benchmarks = {}
31-
pathfinding_benchmarks = {}
31+
algorithm_benchmarks = {} # type: Dict[Type[Algorithm], Dict[str, float]]
32+
pathfinding_benchmarks = {} # type: Dict[Type[Algorithm], Dict[str, float]]
3233

3334
print("Rows: {}\ncolumns: {}\nTotal cells: {}\nRuns per algorithm: {}".format(rows, columns, size, tries))
3435
print("Pathfinding: {}".format(pathfinding))

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Pillow==7.1.0
1+
Pillow==7.2.0
22

33
# test-related (but not separated for now)
4-
mypy==0.770
5-
pytest==5.4.1
6-
flake8==3.7.9
4+
mypy==0.790
5+
pytest==6.1.2
6+
flake8==3.8.4

0 commit comments

Comments
 (0)