66
77import pathlib
88import datetime
9+ import warnings
910import zoneinfo
1011
1112import pandas as pd
12- import pytz
1313import h5py
1414
1515from pvlib import solarposition , clearsky , atmosphere , irradiance
@@ -22,13 +22,11 @@ class Location:
2222 time zone, and altitude data associated with a particular geographic
2323 location. You can also assign a name to a location object.
2424
25- Location objects have two time-zone attributes :
25+ Location objects have a time-zone attribute :
2626
2727 * ``tz`` is an IANA time-zone string.
28- * ``pytz`` is a pytz-based time-zone object (read only).
2928
30- The read-only ``pytz`` attribute will stay in sync with any changes made
31- using ``tz``.
29+ The ``pytz`` attribute was removed. Use ``tz`` property instead.
3230
3331 Location objects support the print method.
3432
@@ -47,8 +45,7 @@ class Location:
4745 list of valid name strings. An `int` or `float` must be a whole-number
4846 hour offsets from UTC that can be converted to the IANA-supported
4947 'Etc/GMT-N' format. (Note the limited range of the offset N and its
50- sign-change convention.) Time zones from the pytz and zoneinfo packages
51- may also be passed here, as they are subclasses of datetime.tzinfo.
48+ sign-change convention.) Time zones from the zoneinfo packages may also be passed here.
5249
5350 The `tz` attribute is represented as a valid IANA time zone name
5451 string.
@@ -118,7 +115,7 @@ def tz(self, tz_):
118115
119116 self ._zoneinfo = zoneinfo .ZoneInfo (f"Etc/GMT{ - int (tz_ ):+d} " )
120117 elif isinstance (tz_ , datetime .tzinfo ):
121- # Includes time zones generated by pytz and zoneinfo packages.
118+ # Includes time zones generated by zoneinfo packages.
122119 self ._zoneinfo = zoneinfo .ZoneInfo (str (tz_ ))
123120 else :
124121 raise TypeError (
@@ -127,11 +124,6 @@ def tz(self, tz_):
127124 "datetime.tzinfo object (including subclasses)"
128125 )
129126
130- @property
131- def pytz (self ):
132- """The location's pytz time zone (read only)."""
133- return pytz .timezone (str (self ._zoneinfo ))
134-
135127 @classmethod
136128 def from_tmy (cls , tmy_metadata , tmy_data = None , ** kwargs ):
137129 """
0 commit comments