Skip to content

Commit ba9a6d8

Browse files
committed
Fix SmartSmartFileInputProvider to use data directory relative to the working directory
1 parent cd481ac commit ba9a6d8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1414
- Adapt ruff config for a newer version
1515
- Fix day template to consider also the year of the challenge
1616
- Fix tests to include the year of the challenge
17+
- Fix `SmartSmartFileInputProvider` to use data directory relative to the working directory
1718

1819
### Changed
1920
- Update repository to the newest cookiecutter template

src/aoc/input_providers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ class InputProvider(abc.ABC):
1111
day: int
1212

1313
@abc.abstractmethod
14-
def provide_input(self, part: int | None) -> str:
15-
...
14+
def provide_input(self, part: int | None) -> str: ...
1615

1716
@property
1817
def _day(self) -> int:
@@ -30,7 +29,7 @@ class SmartFileInputProvider(InputProvider):
3029
data_dir: InitVar[Path | None] = None
3130

3231
def __post_init__(self, data_dir: Path | None):
33-
self._data_dir = data_dir or Path(__file__).parents[2].joinpath("data")
32+
self._data_dir = data_dir or Path.cwd().joinpath("data")
3433

3534
def provide_input(self, part: int | None) -> str:
3635
filename = self.get_input_filename(part)

0 commit comments

Comments
 (0)