Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
csae8092 committed Jan 2, 2025
1 parent 523e76a commit 8468da5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions network/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,13 @@ def iso_to_lat_long(iso_date, start_date="1700-01-01", end_date="1990-12-31"):

# Longitude: Inverted position of the day within the year (0–180)
day_of_year = date_obj.timetuple().tm_yday
days_in_year = (date(datetime(date_obj.year, 12, 31).year, 12, 31) - date(datetime(date_obj.year, 1, 1).year, 1, 1)).days + 1
day_position = (day_of_year - 1) / days_in_year # Normalize day position in the year
days_in_year = (
date(datetime(date_obj.year, 12, 31).year, 12, 31)
- date(datetime(date_obj.year, 1, 1).year, 1, 1)
).days + 1
day_position = (
day_of_year - 1
) / days_in_year # Normalize day position in the year
lon = 180 * day_position

return lat, lon
Expand Down

0 comments on commit 8468da5

Please sign in to comment.