diff --git a/.github/workflows/fetch_data.yml b/.github/workflows/fetch_data.yml index 9d93705..a674afd 100644 --- a/.github/workflows/fetch_data.yml +++ b/.github/workflows/fetch_data.yml @@ -1,6 +1,12 @@ name: Fetch Data -on: [push] +on: + push: + branches: + - main + schedule: + # every night at 01:30 UTC + - cron: "30 1 * * *" jobs: get_data: diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 47a8bce..7ac24db 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 diff --git a/src/__main__.py b/src/__main__.py index ac28de1..92ccb27 100644 --- a/src/__main__.py +++ b/src/__main__.py @@ -6,7 +6,7 @@ from src.logs import Logs if __name__ == '__main__': - Logs().log_to_stderr().log_to_file( + Logs(enable=True).log_to_stderr().log_to_file( sink='logs/irish_weather.log', level='DEBUG', backtrace=True, diff --git a/src/fetch_weather_data.py b/src/fetch_weather_data.py index e7d474f..20bb10c 100644 --- a/src/fetch_weather_data.py +++ b/src/fetch_weather_data.py @@ -37,7 +37,7 @@ def __init__( data_formats: list[str] | None = None, max_rows: int = MAX_ROWS, min_date: str = MIN_DATE, - overwrite_files: bool = False, + overwrite_files: bool = True, sleep_delay: int = SLEEP_DELAY, station_url: str = STATION_DATA_URL, enable_logging: bool = True, @@ -66,7 +66,7 @@ def __init__( if enable_logging: Logs(enable=enable_logging).log_to_stderr() - self.df_all_stations = None + self.df_all_stations = pd.DataFrame() self.first_warning = True def fetch_data(self):