Skip to content

Commit b1ac0f8

Browse files
committed
type annotations for Location
1 parent 4644fa0 commit b1ac0f8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pvlib/location.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
# Will Holmgren, University of Arizona, 2014-2016.
66

77
import datetime
8-
import warnings
8+
from typing import Union
99

1010
import pandas as pd
1111
import pytz
1212

1313
from pvlib import solarposition, clearsky, atmosphere, irradiance
1414

15+
1516
class Location:
1617
"""
1718
Location objects are convenient containers for latitude, longitude,
@@ -53,7 +54,14 @@ class Location:
5354
pvlib.pvsystem.PVSystem
5455
"""
5556

56-
def __init__(self, latitude, longitude, tz='UTC', altitude=0, name=None):
57+
def __init__(
58+
self,
59+
latitude: float,
60+
longitude: float,
61+
tz: Union[str, int, float, pytz.timezone] = 'UTC',
62+
altitude: float = 0,
63+
name: str = None
64+
):
5765

5866
self.latitude = latitude
5967
self.longitude = longitude

0 commit comments

Comments
 (0)