Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ ci:
repos:
# Autoformat: Python code, syntax patterns are modernized
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.21.2
hooks:
- id: pyupgrade
args:
- --py37-plus

# Autoformat: Python code
- repo: https://github.com/PyCQA/autoflake
rev: v2.2.1
rev: v2.3.1
hooks:
- id: autoflake
# args ref: https://github.com/PyCQA/autoflake#advanced-usage
Expand All @@ -33,25 +33,25 @@ repos:

# Autoformat: Python code
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 7.0.0
hooks:
- id: isort

# Autoformat: Python code
- repo: https://github.com/psf/black
rev: 23.10.1
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.1.0
hooks:
- id: black

# Autoformat: markdown, yaml, javascript (see the file .prettierignore)
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v4.0.0-alpha.8
hooks:
- id: prettier

# Autoformat and linting, misc. details
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v6.0.0
hooks:
- id: end-of-file-fixer
- id: requirements-txt-fixer
Expand All @@ -60,13 +60,13 @@ repos:

# Linting: Python code (see the file .flake8)
- repo: https://github.com/PyCQA/flake8
rev: "6.1.0"
rev: "7.3.0"
hooks:
- id: flake8

# formatting notebooks
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
rev: 1.9.1
hooks:
- id: nbqa-pyupgrade
args:
Expand Down
6 changes: 3 additions & 3 deletions lectures/pandas/PublicAPIs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3320,9 +3320,9 @@
"source": [
"url = \"https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=51.5&lon=0\"\n",
"s = requests.Session()\n",
"s.headers[\n",
" \"User-Agent\"\n",
"] = \"uio-in3110 https://github.com/uio-in3110/uio-in3110.github.io\"\n",
"s.headers[\"User-Agent\"] = (\n",
" \"uio-in3110 https://github.com/uio-in3110/uio-in3110.github.io\"\n",
")\n",
"r = s.get(url)\n",
"r"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .cli import main

if __name__ == "__main__":
main()
main()
3 changes: 1 addition & 2 deletions lectures/python/exercises.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,7 @@
"metadata": {},
"outputs": [],
"source": [
"class Square(...):\n",
" ...\n",
"class Square(...): ...\n",
"\n",
"\n",
"sq = Square(5)\n",
Expand Down
3 changes: 1 addition & 2 deletions lectures/python/point.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
class Point:
"""Class representing a 2-D Cartesian point"""

def __init__(self, x, y):
...
def __init__(self, x, y): ...

def __repr__(self):
return f"Point({self.x}, {self.y})"
Expand Down
1 change: 0 additions & 1 deletion lectures/web-servers/monty-hall-game/game_server2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
- The template contains a form with a POST request to the /reselect.
"""


from fastapi import FastAPI, Request
from fastapi.responses import HTMLResponse
from fastapi.templating import Jinja2Templates
Expand Down
1 change: 0 additions & 1 deletion lectures/web-servers/monty-hall-game/game_server3.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
and displays it in the reselect3.html template
"""


from fastapi import FastAPI, Form, Request
from fastapi.responses import HTMLResponse
from fastapi.templating import Jinja2Templates
Expand Down
1 change: 0 additions & 1 deletion lectures/web-servers/monty-hall-game/game_server4.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"""


import random
import uuid

Expand Down
1 change: 0 additions & 1 deletion lectures/web-servers/monty-hall-game/game_server6.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
information
"""


import random
import uuid
from statistics import mean
Expand Down
1 change: 0 additions & 1 deletion lectures/web-servers/monty-hall-game/game_server7.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
information
"""


import random
import uuid
from statistics import mean
Expand Down
1 change: 0 additions & 1 deletion lectures/web-servers/monty-hall-game/game_server_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
information
"""


import random
import uuid
from functools import partial
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use in combination with autoplay.py to play monty hall via a REST API.
"""


import random
import uuid
from enum import IntEnum
Expand Down
Loading