Skip to content

Commit d988e02

Browse files
committed
chore: day template updates
1 parent d6f776a commit d988e02

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

2024/python/src/grice_py_aoc_2024/templates/main.py-tpl

+10-6
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,28 @@ DIR = Path(__file__).parent
77
FILE = DIR.parents[3] / "inputs" / f"{DIR.stem}.txt"
88

99

10-
def part1(contents: str):
11-
return "Not done yet!"
10+
def part1(contents: str) -> int:
11+
total = 0
12+
# TODO part 1
13+
return total
1214

1315

14-
def part2(contents: str):
15-
return "Not done yet!"
16+
def part2(contents: str) -> int:
17+
total = 0
18+
# TODO part 2
19+
return total
1620

1721

1822
def main():
1923
contents = FILE.read_text()
2024

2125
_start1 = time.perf_counter()
22-
result1 = part1(contents)
26+
result1 = part1(contents=contents)
2327
_delta1 = time.perf_counter() - _start1
2428
print(f">> Part 1: {result1} ({_delta1:.6f}s)")
2529

2630
_start2 = time.perf_counter()
27-
result2 = part2(contents)
31+
result2 = part2(contents=contents)
2832
_delta2 = time.perf_counter() - _start2
2933
print(f">> Part 2: {result2} ({_delta2:.6f}s)")
3034

2024/python/src/grice_py_aoc_2024/templates/test_day.py-tpl

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ from .main import part1, part2
88

99
DIR = Path(__file__).parent
1010
TEST_FILE = DIR.parents[3] / "inputs/tests" / f"test_{DIR.stem}.txt"
11-
EXPECTED_PART_1 = "REPLACE ME!"
12-
EXPECTED_PART_2 = "REPLACE ME!"
11+
EXPECTED_PART_1 = 123 # TODO replace!
12+
EXPECTED_PART_2 = 456 # TODO replace!
1313

1414

1515
def test_part1():
1616
contents = TEST_FILE.read_text()
17-
result = part1(contents)
17+
result = part1(contents=contents)
1818
assert result == EXPECTED_PART_1
1919

2020

2121
@pytest.mark.xfail(reason=f"{DIR.stem} P1 incomplete")
2222
def test_part2():
2323
contents = TEST_FILE.read_text()
24-
result = part2(contents)
24+
result = part2(contents=contents)
2525
assert result == EXPECTED_PART_2

0 commit comments

Comments
 (0)