Skip to content

Commit b8d6369

Browse files
Merge pull request #1 from lmProgramming/lab02
Lab02
2 parents 4905118 + 8aa030b commit b8d6369

24 files changed

+995
-354
lines changed

.github/workflows/python-app.yml

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,40 @@ name: Python application
55

66
on:
77
push:
8-
branches: [ "main" ]
8+
branches: ["main", "lab02"]
99
pull_request:
10-
branches: [ "main" ]
10+
branches: ["main", "lab02"]
1111

1212
permissions:
1313
contents: read
1414

1515
jobs:
1616
build:
17-
1817
runs-on: ubuntu-latest
1918

2019
steps:
21-
- uses: actions/checkout@v4
22-
- name: Set up Python 3.10
23-
uses: actions/setup-python@v3
24-
with:
25-
python-version: "3.10"
26-
- name: Install dependencies
27-
run: |
28-
python -m pip install --upgrade pip
29-
pip install flake8 pytest
30-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31-
- name: Lint with flake8
32-
run: |
33-
# stop the build if there are Python syntax errors or undefined names
34-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37-
- name: Test with pytest
38-
run: |
39-
pytest
20+
- uses: actions/checkout@v4
21+
- name: Set up Python 3.10
22+
uses: actions/setup-python@v3
23+
with:
24+
python-version: "3.10"
25+
architecture: "x64"
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install flake8 pytest
30+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
- name: Cython
32+
run: |
33+
cd lab02
34+
python setup.py build_ext --inplace
35+
#- name: Lint with flake8
36+
# run: |
37+
# # stop the build if there are Python syntax errors or undefined names
38+
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
39+
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
40+
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
41+
- name: Test with pytest
42+
run: |
43+
cd lab02
44+
pytest

.markdownlint.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"MD041": false
3+
}

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[![CI](https://github.com/lmProgramming/uni-artificial-intelligence/actions/workflows/python-app.yml/badge.svg)](https://github.com/lmProgramming/uni-artificial-intelligence/actions/workflows/python-app.yml)
2+
3+
# Artificial Intelligence course
4+
5+
## running
6+
7+
On Windows, you might need to additionally install:
8+
9+
```sh
10+
pip install pywin32
11+
```
12+
13+
### lab02
14+
15+
To build cython files:
16+
17+
```sh
18+
cd lab02
19+
python setup.py build_ext --inplace
20+
```
21+
22+
#### Windows
23+
24+
I strongly recommend to make sure Python version has development options enabled
25+
(if not, best to reinstall with them enabled)
26+
27+
VS XX C++ Desktop Development must also be installed

lab01/main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from datetime import datetime, time
2-
import sys
32
from dijkstra import dijkstra
43
from a_star import a_star_search
54
from tabu import tabu_search

lab01/path_utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
from geopy.distance import geodesic
1+
from geopy.distance import geodesic # type: ignore
22
import models
33
from functools import lru_cache
44
from datetime import time
5-
from bisect import bisect_left
6-
from utils import seconds_to_time
75

86

97
@lru_cache(maxsize=None)

0 commit comments

Comments
 (0)