Skip to content

Commit

Permalink
feat: complete migration to ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
1995parham committed Jul 15, 2024
1 parent 5ff1826 commit 0cd0581
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ jobs:
with:
version: 'latest'
- run: rye sync
- run: ruff check
7 changes: 5 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
import datetime
import logging
import pathlib

import geopandas as gpd
from openmeteopy import OpenMeteo
from openmeteopy.hourly import HourlyHistorical
from openmeteopy.options import HistoricalOptions

logger = logging.getLogger(__name__)

if __name__ == "__main__":
districts: gpd.GeoDataFrame = gpd.read_file("districts.geojson")

since = datetime.date(2024, 4, 28)
to = datetime.date(2024, 5, 18)

for _, district in districts.iterrows():
print(f"Reading weather data for {district.name}")
logger.info("Reading weather data for %s", district.name)

if pathlib.Path(f"{district.id}.csv").exists:
print(f"Weather data for {district.name} is already downloaded")
logger.info("Weather data for %d is already downloaded", district.name)
continue

center = district.geometry.centroid
Expand Down

0 comments on commit 0cd0581

Please sign in to comment.