Skip to content

Commit c69a2fc

Browse files
committed
Remove filename comments and fix formatting of templates
1 parent c850d43 commit c69a2fc

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

advent-of-code/aoc_grid.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# aoc_grid.py
2-
31
import numpy as np
42
from colorama import Cursor
53

advent-of-code/aoc_state_machine.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# aoc_state_machine.py
2-
31
from dataclasses import dataclass
42

3+
54
@dataclass
65
class StateMachine:
76
memory: dict[str, int]

advent-of-code/templates/aoc_template.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
# aoc_template.py
2-
31
import pathlib
42
import sys
53

4+
65
def parse(puzzle_input):
76
"""Parse input"""
87

8+
99
def part1(data):
1010
"""Solve part 1"""
1111

12+
1213
def part2(data):
1314
"""Solve part 2"""
1415

16+
1517
def solve(puzzle_input):
1618
"""Solve the puzzle for the given input"""
1719
data = parse(puzzle_input)
@@ -20,6 +22,7 @@ def solve(puzzle_input):
2022

2123
return solution1, solution2
2224

25+
2326
if __name__ == "__main__":
2427
for path in sys.argv[1:]:
2528
print(f"{path}:")

advent-of-code/templates/test_aoc_template.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,41 @@
1-
# test_aoc_template.py
2-
31
import pathlib
4-
import pytest
2+
53
import aoc_template as aoc
4+
import pytest
65

76
PUZZLE_DIR = pathlib.Path(__file__).parent
87

8+
99
@pytest.fixture
1010
def example1():
1111
puzzle_input = (PUZZLE_DIR / "example1.txt").read_text().strip()
1212
return aoc.parse(puzzle_input)
1313

14+
1415
@pytest.fixture
1516
def example2():
1617
puzzle_input = (PUZZLE_DIR / "example2.txt").read_text().strip()
1718
return aoc.parse(puzzle_input)
1819

20+
1921
@pytest.mark.skip(reason="Not implemented")
2022
def test_parse_example1(example1):
2123
"""Test that input is parsed properly"""
2224
assert example1 == ...
2325

26+
2427
@pytest.mark.skip(reason="Not implemented")
2528
def test_part1_example1(example1):
2629
"""Test part 1 on example input"""
2730
assert aoc.part1(example1) == ...
2831

32+
2933
@pytest.mark.skip(reason="Not implemented")
3034
def test_part2_example1(example1):
3135
"""Test part 2 on example input"""
3236
assert aoc.part2(example1) == ...
3337

38+
3439
@pytest.mark.skip(reason="Not implemented")
3540
def test_part2_example2(example2):
3641
"""Test part 2 on example input"""

0 commit comments

Comments
 (0)