Skip to content

Commit a1a0261

Browse files
Remove addition of zoneinfo attribute
1 parent e35eb42 commit a1a0261

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

pvlib/location.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ class Location:
2626
2727
* ``tz`` is an IANA time-zone string.
2828
* ``pytz`` is a pytz-based time-zone object (read-only).
29-
* ``zoneinfo`` is a zoneinfo.ZoneInfo time-zone object (read-only).
3029
31-
As with Location-object initialization, use the ``tz`` attribute update
32-
the Location's time zone after instantiation, and the read-only ``pytz``
33-
and ``zoneinfo`` attributes will stay in sync with any change in ``tz``.
30+
As with Location-object initialization, use the ``tz`` attribute to update
31+
the Location's object's time zone after instantiation, and the read-only
32+
``pytz`` attribute will stay in sync with any changes made using ``tz``.
3433
3534
Location objects support the print method.
3635
@@ -52,10 +51,6 @@ class Location:
5251
ints and floats must be whole-number hour offsets from UTC, which
5352
are converted to the IANA-suppored 'Etc/GMT-N' format (note the
5453
limited range of the offset N and its sign-change convention).
55-
Raises TypeError for time zone conversion issues or
56-
zoneinfo.ZoneInfoNotFoundError when the (stringified) time zone is
57-
not recognized as an IANA time zone by the zoneinfo.ZoneInfo
58-
initializer used for internal time-zone representation.
5954
6055
altitude : float, optional
6156
Altitude from sea level in meters.
@@ -66,6 +61,17 @@ class Location:
6661
name : string, optional
6762
Sets the name attribute of the Location object.
6863
64+
65+
Raises
66+
------
67+
ValueError
68+
when the time-zone ``tz`` input cannot be converted.
69+
70+
zoneinfo.ZoneInfoNotFoundError
71+
when the time zone ``tz`` is not recognizable as an IANA time zone by
72+
the zoneinfo.ZoneInfo initializer used for internal time-zone
73+
representation.
74+
6975
See also
7076
--------
7177
pvlib.pvsystem.PVSystem
@@ -124,10 +130,6 @@ def tz(self, tz_):
124130
def pytz(self):
125131
return pytz.timezone(str(self._zoneinfo))
126132

127-
@property
128-
def zoneinfo(self):
129-
return self._zoneinfo
130-
131133
@classmethod
132134
def from_tmy(cls, tmy_metadata, tmy_data=None, **kwargs):
133135
"""

pvlib/tests/test_location.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,11 @@ def test_location_tz_update():
5555
loc = Location(32.2, -111, -11)
5656
assert loc.tz == 'Etc/GMT+11'
5757
assert loc.pytz == pytz.timezone('Etc/GMT+11') # Deprecated attribute.
58-
assert loc.zoneinfo == zoneinfo.ZoneInfo('Etc/GMT+11')
5958

6059
# Updating Location's tz updates read-only time-zone attributes.
6160
loc.tz = 7
6261
assert loc.tz == 'Etc/GMT-7'
6362
assert loc.pytz == pytz.timezone('Etc/GMT-7') # Deprecated attribute.
64-
assert loc.zoneinfo == zoneinfo.ZoneInfo('Etc/GMT-7')
6563

6664

6765
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)