From eac54767b570e1577887cd95fa1127491061bf09 Mon Sep 17 00:00:00 2001 From: stanislas Date: Mon, 2 Dec 2024 16:21:56 +0100 Subject: [PATCH] day 1 - part 2 - refactoring --- 2024/pyproject.toml => pyproject.toml | 0 {2024 => src/aoc_2024}/day1/common.py | 0 {2024 => src/aoc_2024}/day1/input-data | 0 {2024 => src/aoc_2024}/day1/part1.py | 2 +- {2024 => src/aoc_2024}/day1/part2.py | 2 +- tests/{2024 => aoc_2024}/day1/test-data | 0 tests/{2024 => aoc_2024}/day1/test_common.py | 2 +- tests/{2024 => aoc_2024}/day1/test_first.py | 0 tests/{2024 => aoc_2024}/day1/test_part1.py | 2 +- tests/{2024 => aoc_2024}/day1/test_part2.py | 2 +- 10 files changed, 5 insertions(+), 5 deletions(-) rename 2024/pyproject.toml => pyproject.toml (100%) rename {2024 => src/aoc_2024}/day1/common.py (100%) rename {2024 => src/aoc_2024}/day1/input-data (100%) rename {2024 => src/aoc_2024}/day1/part1.py (88%) rename {2024 => src/aoc_2024}/day1/part2.py (94%) rename tests/{2024 => aoc_2024}/day1/test-data (100%) rename tests/{2024 => aoc_2024}/day1/test_common.py (92%) rename tests/{2024 => aoc_2024}/day1/test_first.py (100%) rename tests/{2024 => aoc_2024}/day1/test_part1.py (89%) rename tests/{2024 => aoc_2024}/day1/test_part2.py (90%) diff --git a/2024/pyproject.toml b/pyproject.toml similarity index 100% rename from 2024/pyproject.toml rename to pyproject.toml diff --git a/2024/day1/common.py b/src/aoc_2024/day1/common.py similarity index 100% rename from 2024/day1/common.py rename to src/aoc_2024/day1/common.py diff --git a/2024/day1/input-data b/src/aoc_2024/day1/input-data similarity index 100% rename from 2024/day1/input-data rename to src/aoc_2024/day1/input-data diff --git a/2024/day1/part1.py b/src/aoc_2024/day1/part1.py similarity index 88% rename from 2024/day1/part1.py rename to src/aoc_2024/day1/part1.py index 26e86f6..9d0653e 100644 --- a/2024/day1/part1.py +++ b/src/aoc_2024/day1/part1.py @@ -1,6 +1,6 @@ from pathlib import Path -from day1.common import get_ordered_lists +from aoc_2024.day1.common import get_ordered_lists def compute_distance(list1, list2) -> int: diff --git a/2024/day1/part2.py b/src/aoc_2024/day1/part2.py similarity index 94% rename from 2024/day1/part2.py rename to src/aoc_2024/day1/part2.py index 3184e5e..693a376 100644 --- a/2024/day1/part2.py +++ b/src/aoc_2024/day1/part2.py @@ -1,6 +1,6 @@ from pathlib import Path -from day1.common import get_ordered_lists +from aoc_2024.day1.common import get_ordered_lists def get_elem_amount(data: list[int]) -> dict[int, int]: diff --git a/tests/2024/day1/test-data b/tests/aoc_2024/day1/test-data similarity index 100% rename from tests/2024/day1/test-data rename to tests/aoc_2024/day1/test-data diff --git a/tests/2024/day1/test_common.py b/tests/aoc_2024/day1/test_common.py similarity index 92% rename from tests/2024/day1/test_common.py rename to tests/aoc_2024/day1/test_common.py index 0d85d7f..a84b559 100644 --- a/tests/2024/day1/test_common.py +++ b/tests/aoc_2024/day1/test_common.py @@ -1,6 +1,6 @@ from pathlib import Path -from day1 import common +from aoc_2024.day1 import common TEST_FILE = Path(__file__).parent / "test-data" diff --git a/tests/2024/day1/test_first.py b/tests/aoc_2024/day1/test_first.py similarity index 100% rename from tests/2024/day1/test_first.py rename to tests/aoc_2024/day1/test_first.py diff --git a/tests/2024/day1/test_part1.py b/tests/aoc_2024/day1/test_part1.py similarity index 89% rename from tests/2024/day1/test_part1.py rename to tests/aoc_2024/day1/test_part1.py index 183ce32..4dcf957 100644 --- a/tests/2024/day1/test_part1.py +++ b/tests/aoc_2024/day1/test_part1.py @@ -1,6 +1,6 @@ from pathlib import Path -from day1 import part1 +from aoc_2024.day1 import part1 def test_compute_distance(): diff --git a/tests/2024/day1/test_part2.py b/tests/aoc_2024/day1/test_part2.py similarity index 90% rename from tests/2024/day1/test_part2.py rename to tests/aoc_2024/day1/test_part2.py index c62e007..1278dff 100644 --- a/tests/2024/day1/test_part2.py +++ b/tests/aoc_2024/day1/test_part2.py @@ -1,6 +1,6 @@ from pathlib import Path -from day1 import part2 +from aoc_2024.day1 import part2 def test_compute_similarity_score():